-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small font rendering really unclear (blurry, missing pixels etc) #293
Comments
There's actually two issues here.
|
Haha! I completely forgot since I'm so used to dark mode! I'll update my images. |
nope not something i've experimented with, however I would say the issue with 'LCD' rendering is they only work for LCD displays (not paper etc) and also you need to know the subpixel layout of the screen and the exact position on the screen where it will render, you can't rasterize the pixels once and move them, for example, as moving the it half a pixel in any direction will cause the relative subpixels layout to be different in relation to the target. |
@tocsoft Ah no, sorry. What I mean is colorized antialiasing as described here and used by Cleartype. I know Antigrain have an implementation and PixelFarm wrote theirs based upon that but I'm not sure how we would integrate such an approach since we use the PixelBlender to do the rendering especially since we'd need to do it in a way that works with all our brushes like System.Drawing can as demonstrated with this linear brush example. |
I knew what you meant, but that technique can only be useful when rendering to screen where you can take advantage of the color shifting of the pixels rendered, it will produce fringing and be pretty useless in any other medium, and you also can't composite the rendered text on to another picture (post generation as there is not transparency retained). So unless your planning on rendering the vectors and displaying them directly to screen then it'll be very likely to produce suboptimal results. This is all remembering that real time screen graphics rendering is not a scenario we are actually targeting with this library. FYI, Antigrain and Cleartype (which System.Drawing uses cause its a relatively thin wrapper around the GDI screen rendering subsystem system) are both screen rendering technologies they where built to draw pixels on a screen which is why it makes sense for them. |
@tocsoft Ah right... I wonder whether it is something we should consider in the future though as it seems more people are beginning to use the library in gaming. I guess they can simply bring their own rasterizer. @myblindy Looks like I may be having some success with the interpreter. Here's Segoe UI at 10 pixels. Here's with (left) and without (right) hinting zoomed and compared. I have a LOT of visual testing to do now. |
Definitely an improvement, great work! I'll keep an eye on how this shapes up (no pun intended), but for now I switched to the tried and true |
Prerequisites
DEBUG
andRELEASE
modeDescription
Rendering small fonts is unreadable with alpha blending enabled, due to the really imprecise, blurry way they're being rendered:
ImageSharp (default antialiasing settings):
GDI+ (clear type):
This is with Segoe UI at 10 pixels. The vertical lines especially aren't clear, and with alpha blending enabled they just disappear.
I also tried disabling antialiasing in the ImageSharp render, but that makes it even more obvious how imprecise it is:
I also tried hinting, which is supposed to help with this, but it doesn't seem to work at all:
For Open Sans it's even less readable, and hinting just produces long vertical lines:
Is there some set of options I can enable to make small font rendering clear?
Steps to Reproduce
I have a sample repo that I used to generate those images at https://github.com/myblindy/font_test
System Configuration
The text was updated successfully, but these errors were encountered: