Problem with text font blurring

Hello
I'm making a game in low resolution pixel artstyle and wanted to change my text font to fit the whole thing, however the font I downloaded is brutally blurred by the engine.
I tried using Pixel Perfect Scaling Mode by Galenmereth but it only works for other graphics.
I'm using Yanfly Message Core if it changes anything.
Is there a way to make the text look pixel perfect?
1742188661323.png
Hmm I don't see anything in the engine that would blur fonts, mind sharing some demo project so that I can debug?
Hmm I don't see anything in the engine that would blur fonts, mind sharing some demo project so that I can debug?
Sure. I have nothing except one debug map so I can send the whole project.
Here you go:
Here is how it looks on my machine:
1742241215036.png


It may be the matter of display device you are using. You can try going into rpg_core.js and (make a copy first) find
JavaScript:
Bitmap.prototype._createCanvas = function(width, height){
line (it should be line 754). You can try replacing it (entire function, not just first line) with:

JavaScript:
Bitmap.prototype._createCanvas = function(width, height){
    this.__canvas = this.__canvas || document.createElement('canvas');
    this.__context = this.__canvas.getContext('2d');
    this.__dpr = window.devicePixelRatio;

    this.__canvas.width = Math.max(width || 0, 1) * this.__dpr;
    this.__canvas.height = Math.max(height || 0, 1) * this.__dpr;

    this.__context.scale(this.__dpr, this.__dpr);

    this.__canvas.style.width = `${Math.max(width || 0, 1)}px`;
    this.__canvas.style.height = `${Math.max(height || 0, 1)}px`;

    if(this._image){
        var w = Math.max(this._image.width || 0, 1);
        var h = Math.max(this._image.height || 0, 1);
        this.__canvas.width = w;
        this.__canvas.height = h;
        this._createBaseTexture(this._canvas);

        this.__context.drawImage(this._image, 0, 0);
    }

    this._setDirty();
};
and see if it helps.

I'm afraid this is a complicated topic because the blurry fonts is something that fillText on 2d context is doing. And this is what RPG maker uses to draw fonts.

If the code is not working for you then I would try few different fonts as simpler fonts should be less blurry.
Here is how it looks on my machine:View attachment 334765

It may be the matter of display device you are using. You can try going into rpg_core.js and (make a copy first) find
JavaScript:
Bitmap.prototype._createCanvas = function(width, height){
line (it should be line 754). You can try replacing it (entire function, not just first line) with:

JavaScript:
Bitmap.prototype._createCanvas = function(width, height){
    this.__canvas = this.__canvas || document.createElement('canvas');
    this.__context = this.__canvas.getContext('2d');
    this.__dpr = window.devicePixelRatio;

    this.__canvas.width = Math.max(width || 0, 1) * this.__dpr;
    this.__canvas.height = Math.max(height || 0, 1) * this.__dpr;

    this.__context.scale(this.__dpr, this.__dpr);

    this.__canvas.style.width = `${Math.max(width || 0, 1)}px`;
    this.__canvas.style.height = `${Math.max(height || 0, 1)}px`;

    if(this._image){
        var w = Math.max(this._image.width || 0, 1);
        var h = Math.max(this._image.height || 0, 1);
        this.__canvas.width = w;
        this.__canvas.height = h;
        this._createBaseTexture(this._canvas);

        this.__context.drawImage(this._image, 0, 0);
    }

    this._setDirty();
};
and see if it helps.

I'm afraid this is a complicated topic because the blurry fonts is something that fillText on 2d context is doing. And this is what RPG maker uses to draw fonts.

If the code is not working for you then I would try few different fonts as simpler fonts should be less blurry.
1742244502735.png

Sadly it still does that. It's really weird that on your computer it works perfectly but on mine it's a mess. Also I don't think that would be the font's issue cuz in font explorer it scales up perfectly.
1742244649060.png
Maybe you can try my plugin:
Maybe you can try my plugin:
OMG It worked! Thank you so much 🙂

Maybe you can try my plugin:
Okay I have one problem.
While using Yanfly's Message Core to lower the size of the text it makes it all jagged and weird looking. Is there a way to change the text size in any other way?
Without YEP:
1742309929157.png

With YEP:
1742309947836.png
OMG It worked! Thank you so much 🙂


Okay I have one problem.
While using Yanfly's Message Core to lower the size of the text it makes it all jagged and weird looking. Is there a way to change the text size in any other way?
Without YEP:
View attachment 334859
With YEP:
View attachment 334860
You can try the newest version or the passive mode version on that page.
I made an update so the font size can no longer be lower than its base size.
You can try the newest version or the passive mode version on that page.
I made an update so the font size can no longer be lower than its base size.
Thank you! I also had that problem

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-text-font-blurring.176302/