<commit_before>function Screen(canvas, resolution) {
    
    if (!(canvas instanceof HTMLCanvasElement)) {
        throw new InvalidArgumentError("canvas", "Invalid canvas object passed: " + canvas);
    }
    
    this.size = new Vector2(canvas.width, canvas.height);
    this.font = "20px HelveticaNeue Liberation Roboto Sans";
    this.fontColor = "#FFF";
    
    if ( !(resolution instanceof Vector2) ) {
        this.resolution = this.size;
    } else {
        this.resolution = resolution;
    }

    var context = canvas.getContext("2d");

    Log.info("Screen initialized. Canvas Size: " + this.size + " Resolution: " + this.resolution, this);
    
    this.render = function (image, position, size) {
        context.drawImage(image, position.x, position.y, size.x, size.y);
    };

    this.clear = function () {
        context.clearRect(0, 0, this.size.x, this.size.y);
    };

    this.renderText = function(text, position, colour, font) {
        if (typeof font === 'undefined') {
            font = this.font;
        } else if (typeof font !== 'string') {
            throw new InvalidArgumentError("font", "Fonts have to be strings containing both the font size and one or more font families. Received: " + font);
        }

        if (typeof colour === 'undefined') {
            colour = this.fontColor;
        } else if (typeof colour !== 'string') {
            throw new InvalidArgumentError("colour", "Colours have to be strings. Received: " + colour);
        }

        if ( typeof position === 'undefined') {
            position = new Vector2();
        } else if ( !(position instanceof Vector2) ) {
            throw new InvalidArgumentError("position", "Position should be a Vector2. Received: " + position);
        }

        context.font = font;
        context.fillStyle = colour;
        context.fillText(text, position.x, position.y);
    };
}

Screen.prototype.toString = function () {
    return "Screen"
};<commit_msg>Decouple text size from the font so it can be set dynamically<commit_after>function Screen(canvas, resolution) {
    
    if (!(canvas instanceof HTMLCanvasElement)) {
        throw new InvalidArgumentError("canvas", "Invalid canvas object passed: " + canvas);
    }
    
    this.size = new Vector2(canvas.width, canvas.height);
    this.font = "HelveticaNeue Liberation Roboto Sans";
    this.fontColor = "#FFF";
    this.fontSize = 20;
    
    if ( !(resolution instanceof Vector2) ) {
        this.resolution = this.size;
    } else {
        this.resolution = resolution;
    }

    var context = canvas.getContext("2d");

    Log.info("Screen initialized. Canvas Size: " + this.size + " Resolution: " + this.resolution, this);
    
    this.render = function (image, position, size) {
        context.drawImage(image, position.x, position.y, size.x, size.y);
    };

    this.clear = function () {
        context.clearRect(0, 0, this.size.x, this.size.y);
    };

    this.renderText = function(text, position, size, colour, font) {
        if (typeof font === 'undefined') {
            font = this.font;
        } else if (typeof font !== 'string') {
            throw new InvalidArgumentError("font", "Fonts have to be strings containing both the font size and one or more font families. Received: " + font);
        }
        
        if (typeof size === 'undefined') {
            size = this.fontSize;
        } else if (typeof size !== 'number') {
            console.log(typeof size);
            throw new InvalidArgumentError("size", "size must be an integer. Received: " + size);
        }

        if (typeof colour === 'undefined') {
            colour = this.fontColor;
        } else if (typeof colour !== 'string') {
            throw new InvalidArgumentError("colour", "Colours have to be strings. Received: " + colour);
        }

        if ( typeof position === 'undefined') {
            position = new Vector2();
        } else if ( !(position instanceof Vector2) ) {
            throw new InvalidArgumentError("position", "Position should be a Vector2. Received: " + position);
        }

        context.font = size + "px " + font;
        context.fillStyle = colour;
        context.fillText(text, position.x, position.y);
    };
}

Screen.prototype.toString = function () {
    return "Screen"
};
{'fraction_non_alphanumeric': 0.12764966224085722, 'fraction_numerical': 0.004658746797111577, 'mean_word_length': 2.4160700079554496, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '174732', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1169, 'n_words': 346}