-
Notifications
You must be signed in to change notification settings - Fork 266
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
removing some serious inefficiencies, fixing a change that broke compatibility with opengl < 3 #44
base: master
Are you sure you want to change the base?
Conversation
…ch is then reversed by a custom transform matrix. What were you thinking?? Reverting to using the identity matrix (although technically it isn't necessary to set this explicitly at all since it's used by default)
…ont_load_glyphs() only to immediately load it again to calculate the kerning. Explanation: texture_font_generate_kerning() is called only in one place in the entire library, and that's inside texture_font_load_glyphs(). Moving it to before the cleanup of library and face allows us to avoid a costly and completely pointless unload followed by reload. texture_font_generate_kerning() is not declared in the headers so there is no risk of it being called elsewhere, so this change has no risk of breaking anything in any existing code. A pointer to the existing face is passed along instead.
…GL_RED Older versions of OpenGL do not support GL_RED but newer ones still do support GL_ALPHA. Rather than switching the whole thing to a deprecated format (which requires changes to the shaders also) for the sake of compatibility, I'm instead adding an #ifdef switch.
…ormats for single channel rendering
Could you make a new PR ? |
…ating its define from that of horizontal resolution to avoid confusion and increase configurability
Have added a new commit re-adding the stretched matrix (in a tidier form) and added a control to toggle this behaviour on or off, as well as adding your links to the documentation for that control. |
Thanks. I won"t be avail for one week (no internet). I will test & merge once I'm back. |
To disable horizontal hinting you can use hinting mode slight. |
@rougier Check FT_LOAD_TARGET_LIGHT |
Not quite sure this would be equivalent to horizontal hinting discard:
|
Also, from aflatin.c:
|
@rougier I personally think exposing as much of the underlying Freetype functionality to the user as possible is the best approach, so the user can select the right hinting mode for their application. I also think the default behaviour should always be in accordance with the "principle of least surprise", with the user requesting any unexpected or special hinting modes specifically. In the case of the existing hack to suppress horizontal hinting, I personally was quite surprised when I came across it, so I think defaulting to a more standard mode would be better along with adding some mechanism of allowing the user to select the hinting mode they want. And documenting the font hinting behaviour much better! :) |
@slowriot You are right in principle. But horizontal hinting doesn't make sense in this case because the SDF is supposed to be size-independent. |
@behdad Freetype-gl isn't used exclusively with SDF rendering, and moreover why would you want to enable vertical hinting but not horizontal in that case? Either way the result is potentially surprising and unexpected to the user. Best case is that they don't notice anything is wrong; worst case is that text renders incorrectly without the user being given the option to switch behaviour. |
See commit descriptions for more details.