Sharp Text [MZ + MV]

Moderator note: Moving to Plugin Support

The text outline has nothing to do with the Sharp Text plugin (unless you can confirm that having that plugin disabled makes it do what you want it to do), so I have split your post from that thread into its own.

If your parameter is being ignored, perhaps you have given the plugin the wrong name? It must be saved as YEP_MessageCore.js
Moderator note: Moving to Plugin Support

The text outline has nothing to do with the Sharp Text plugin (unless you can confirm that having that plugin disabled makes it do what you want it to do), so I have split your post from that thread into its own.

If your parameter is being ignored, perhaps you have given the plugin the wrong name? It must be saved as YEP_MessageCore.js
This is what the dialogue text looks like with the Sharp Text plugin off. There is no outline.
Spoiler: Sharp Text plugin Off
without sharp text.png
This is what the dialogue text looks like with the Sharp Text plugin on. It adds an outline.

Spoiler: Sharp Text plugin On
outline.png

There's no outline when the Sharp Text plugin is off, so I believe it's related to the Sharp Text plugin.

YEP_MessageCore.js is how the message core plugin file is named. I have not changed it. This is in RPG Maker MV.
Thanks for clarifying.

What is your plugin order? Is the sharp text plugin above or below the other two? If you change the order around does it make any difference?
Thanks for clarifying.

What is your plugin order? Is the sharp text plugin above or below the other two? If you change the order around does it make any difference?
I currently have Sharp Text under YEP Core Engine, YEP Main Menu Manager and YEP Message Core (but well above Galv's Message Styles) as the plugin said it should be near the top.

However it makes no difference if the plugin is right at the top of the plugin order, in the middle or at the bottom. I've tried various orders. Same issue.
Cool. Thanks for going through the process with me. As it does appear to be related to the Sharp Text plugin, I've merged your post back with the original thread.

Tagging @MechPen, who might have seen the original notification but couldn't find the post after I moved it out.
@ZedKraze my go to is to just write
Bitmap.prototype._drawTextOutline = function(text, tx, ty, maxWidth) { var context = this._context; context.strokeStyle = this.outlineColor; context.lineWidth = this.outlineWidth; context.lineJoin = 'round'; if (context.lineWidth > 0) { context.strokeText(text, tx, ty, maxWidth); } }; and then just change the outlineWidth of whatever text. If you add that to my plug in the other plug ins that let you change outline size will probably work assuming they were written to use outlineWidth. And like, why wouldn't they?

@PhilRay I bet your font size is too large. default MV is 28, your font would like to be drawn at 24. Hopefully you are using MZ and can just change it otherwise you need a mini plugin
Window_Base.prototype.lineHeight = function() { return 32; }; Window_Base.prototype.standardFontSize = function() { return 24; };
@ZedKraze my go to is to just write
Bitmap.prototype._drawTextOutline = function(text, tx, ty, maxWidth) { var context = this._context; context.strokeStyle = this.outlineColor; context.lineWidth = this.outlineWidth; context.lineJoin = 'round'; if (context.lineWidth > 0) { context.strokeText(text, tx, ty, maxWidth); } }; and then just change the outlineWidth of whatever text. If you add that to my plug in the other plug ins that let you change outline size will probably work assuming they were written to use outlineWidth. And like, why wouldn't they?
Heya thanks for looking into it. I tried putting the code at the end of the plugin and it made no difference. Not sure if I have it in the right location or not.

Spoiler
extra code.png
Hey @ZedKraze, I had a similar problem but was able to remove the outline by simply commenting out this line within the DrawNewTextOutline function:
// this._drawTextOutline(text, tx, ty, maxWidth);

Hope that helps!
Hey @ZedKraze, I had a similar problem but was able to remove the outline by simply commenting out this line within the DrawNewTextOutline function:
// this._drawTextOutline(text, tx, ty, maxWidth);

Hope that helps!
Awesome. Thanks for the tip @cordvid . That worked.The outline is now gone both in dialogue and menus.

I should note that code line appears twice in the plugin, and removing the outline only seemed to work if I commented out both lines.

Now the outline removal is solved, now I'm noticing the font isn't showing pixel perfect like in the S and f here.
Spoiler: Pixel font in RPG Maker not pixel perfect
notpixelperfect.png

There's jaggy parts and the pixels overlap a bit. When it should look like this...

Spoiler: Pixel font in Word pixel perfect
pixel perfect in word.png

Will try playing around with different Text Thickness settings in the Sharp Text plugin, otherwise might have to find a new solution.
Did you check the size of the font, as in the other user's question a few posts up? Those jags could be the result of resizing.
Yeah, I had to adjust the font size quite a bit, as well as the thickness, to get things looking right. Unfortunately the smaller numbers in the HP/TP bar still look a bit distorted.

EDIT: @ZedKraze Figured I would add some more details on what worked for me, since it seems to be working for a few different pixel fonts that I tried. For the font size I used 32, and for the thickness somewhere between 0.28 and 0.36 seems to look best but at the 32 font size this really only seems to affect especially small text, like the MP/HP bar on the status screen. I imagine increasing the base font size for those numbers would work even better, but I'm not sure how to do that.
If you need a new font, the ones I tried from here worked well (namely ChiKareGo2 and Battlenet)
So I tried resizing the font (mine was set to 22), and yes that worked for getting rid of the jaggies and overlapping.

24 seems to be smallest size for this to work. From my testing if you kinda do multiples of 48 (MV tile size) you get pixel perfect, no jaggies, no overlapping pixels. So sizes 24, 32 and 48 seem to work perfectly.

As long as your font size 24 or over, you don't seem to get jaggies, but if it's not one of the 3 sizes I mentioned, you do get overlapping, ie if you use say 28.

So that does seem to solve that problem. I'm going to go with 24 for now. It does mean it limits font sizes, but I'll see how I go with those font sizes, and if not, then maybe another solution will be needed (I haven't tried the Victor SFont plugin yet).

But for now, got sharp text, no outlines, pixel perfect with no jaggies or overlapping pixels thanks to the Sharp Text plugin. Thanks for all of your help everyone.
I can't get this plugin to not make the font heavier than it should be.

In RMMV the font looked like this at 16px with a bunch of anti-font blurring plugins installed:

Screen Shot 2021-08-22 at 13.20.55.png


However, this is how the same font looks in RMMZ with this plugin installed, and "Text Thickness" set to 0:

Screen Shot 2021-08-22 at 13.20.41.png


It doesn't seem quite right.

Anything I can do to fix this?
This plug in doesn't do anything to change text outlines. if your outline is black, and your text is black, then the behavior you are seeing would be expected. I use Text Thickness 0.4, Font Size is 24. and removed the outline. my game therefore looks like this.
sharp_text.png
So i have a few things to report, aka problems:
- When having Sharp Outline Selected it's dark green instead of dark blue. This fixes itself when having Blurry Outline Option Selected instead.

- Hudmaker seems to be having a little trouble with this plugin as the text itself behaves weirdly aka it doesn't match the color it's set to be.

- Plugin isn't compatible with VE_ControlText.

- For some reason when in battle and scrolling through the skill list there's a bit of lag going on when wanting to see another skill.
Spoiler: Images
The Red Outline is me messing around with Hudmaker, don't mind that.


Screenshot_23.png
Screenshot_24.png
Screenshot_25.png
Screenshot_26.png
There's a problem when using Yanfly's Save Core.
1. The problem occurs when the levels of the actor is displayed.
Spoiler: IMAGE
2021-09-09T13-55-26-202Z.png
2. I deactivated the level display, but problem occurs when the confirmation window appears. (something like "Are you sure to delete this file?")
Spoiler: IMAGE
2021-09-09T13-56-25-699Z.png
I'm guessing textWidthEx from VE_BasicModule is causing the issue.

As for the color issue with HUDMaker, I guess it stores the outlineColor or textColor in a format I'm not expecting. I expect a certain kind of text string but technically HTML5 will accept a few different kinds. try entering your outline color as rgba(0, 0, 0, 0.5) and your textColor as hex #RRBBGGAA.

Overall this plugin doesn't work very well in MV due to how it draws characters letter by letter (MZ will buffer and draw as many characters as it can until a control code). If this ever moves out of In Development I'll either have to rewrite how MV does text (and break a lot of plug-ins I bet) or drop MV support.

It is MIT Licensed though so if I can't fix it hopefully someone else will be able to.
There's a problem when using Yanfly's Save Core.
1. The problem occurs when the levels of the actor is displayed.
Spoiler: IMAGE
2. I deactivated the level display, but problem occurs when the confirmation window appears. (something like "Are you sure to delete this file?")
Spoiler: IMAGE
I encountered the same issue. After doing some digging, it appears to be caused by empty or missing text. I solved the issue by adding this code at the beginning of the "Bitmap.prototype.getUnbluredImageData" function:
Code:
if (isNaN(width) || isNaN(height)) {
    return new ImageData(1, 1);
}
Basically, if the text source image is blank, it now passes some dummy data instead of attempting to process the blank image.
I encountered the same issue. After doing some digging, it appears to be caused by empty or missing text. I solved the issue by adding this code at the beginning of the "Bitmap.prototype.getUnbluredImageData" function:
Code:
if (isNaN(width) || isNaN(height)) {
    return new ImageData(1, 1);
}
Basically, if the text source image is blank, it now passes some dummy data instead of attempting to process the blank image.
I solved the problem by simply deactivating the VE_BasicModule.
But using that code, everything works fine even if I activate the VE_BasicModule.
Thank you for your help!
I love this plugin, apart from the fact that it doesn't play well with HudMaker. I'll try rewriting the way it handles colors but I don't know if I'm proficient enough.

Original thread: https://forums.rpgmakerweb.com/threads/sharp-text-mz-mv.132598/