The rendering of smaller fonts is blurry #3425
-
|
I tried several methods, but none of them resolved the issue of the system's built-in font, simsun.ttc, being blurry. Other fonts are also blurry, albeit slightly better. As long as the font size is set to 13 or 12, it becomes extremely blurry. This problem does not occur in native DX rendering. I would like to ask how to improve font clarity. For games, in multiplayer games, character or monster names are definitely displayed following the character, and the font must be very small, so it must be displayed clearly. I am using a 100% zoom here, but it is still very blurry. I have also tried the method below, but it didn't work. func (g Game) Draw(screen ebiten.Image) { func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) { face := &text.GoTextFace{ game := &Game{ |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 32 replies
-
|
Screenshots are the most useful tool for comparison in these cases. It's hard to say if the results are ok or not until we see it. You seem to be applying device scale factor properly. Maybe try You can always do a quick comparison with a different renderer too. E.g.: If this doesn't look any different from your results, then it's unlikely any better results are possible, unless you are expecting subpixel anti-aliasing, which is not done because it isn't generally advisable for games and against arbitrary backgrounds. The only other possible issue would be if the device scale factor is not being properly detected for some other reason, or if you are inadvertently rescaling somewhere else. Practically speaking, fonts at size 12/13 are at the limit of what can look ok without subpixel anti-aliasing, and even then they are not generally great. Bitmap fonts are often a good alternative at those sizes. In fact, some fonts include bitmaps directly for such small sizes, but notice that those are not being used, neither by sfnt nor go-typesetting if I recall correctly. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
This is a 12-pixel word drawn by DX9 using the font "simsun.ttc" |
Beta Was this translation helpful? Give feedback.
-
|
Hi ! See also go-text/typesetting#246 if you want to try the fix |
Beta Was this translation helpful? Give feedback.
-
|
What should I do now? All the fonts displayed in simsun.ttc are unclear, whether they are ASCII or other. |
Beta Was this translation helpful? Give feedback.
-
|
I used the multiface scheme, using tahoma for ASCII fonts and simsun for non ASCII fonts. In the 12 pixel and 13 pixel usage scenarios, I tried fonts such as TerminusTTF/tahoma/verdana. |
Beta Was this translation helpful? Give feedback.
My current understanding is, unfortunately Ebitengine doesn't and probably cannot support sharp glyphs for ASCII charactrers with
simsun.ttf. The font includes bitmap glyphs for CJK but not for ASCII, and probably Windows rendered sharp glyphs for ASCII based on its outline data and hinting. This technology is blackboxed and might be patented, and it is pretty hard to emulate this. I don't have a bandwidth to implemen this.Instead, I recommend other fonts like https://files.ax86.net/terminus-ttf/, which has embeded bitmap glyphs for various sizes. You can mix multiple font faces into one font face with MultiFace, so for example, you can use Terminus for ASCII and Simsun for CJK.