-
Notifications
You must be signed in to change notification settings - Fork 57
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
Can't turn off font hinting / metrics #296
Comments
|
I would if I was sure that I got it working correctly. Although I've tried the font property ccalls with the setting antialiasing off and that had an obvious effect. Not the metrics though..
I thought cairo was already the "backend" and it's just editing bezier curves of the fonts here, but anyway I'm running this on MacOS Mojave
I'm trying to animate text position and rotation, and the text does not smoothly travel but it jiggles with every glyph.
Here's a test gif:
Well should turning hinting off not be enough? That's part of my reason to post here, maybe someone has already solved that problem for themselves. It's weird that the documentation sounds like exactly what's happening, but my code has no effect. Unless I'm making a mistake. |
I thought MacOS doesn’t do font hinting. Of course, it’s possible that Cairo and macOS have some special arrangement.... |
libcairo hands over the rendering of fonts to bitmaps (if needed) to another library, in most cases freetype, but 'system' font handling can be configured at compile or runtime. I don't know where the 'myth' of MacOS doesn't do hinting comes from (it's not the first time i read this), but keep in mind, that in any case if you want to do good approximation of the font design to a discrete bitmap some hinting will be part of this, sometimes by using the hints in the glyph description (like in Type1, TrueType), sometimes by auto-hinting (reading the outline and do some heuristics in conversion), sometimes by using a cached bitmap. It could be that in your case you signal Cairo not to use hinting, but the lower library has own ideas what to do. I've seen similar effects like the above attached. non-axis aligned rendering of fonts is a major headache afacis no engine is handling it very well. See it like this: All single frames of your animation will look OK, it's the change in glyph placement and sub-features that make it jitter. Without testing this:
|
The ‘myth’ is created by type designers like Peter Bilak, but he may be wrong, of course. 😇 |
@cormullion I'm not using the same or 'correct' terminology. Afaics MacOS claims not to read-in hinting information in the font. I used hinting as the process of grid-fitting. |
When animating a drawing text glyphs jitter around, I assume they align to the underlying device space integer grid. I've found cairo functions to turn off that behavior that are not exposed in Cairo.jl's API. But using them doesn't work, maybe I'm doing something wrong. I think this would be beneficial to have included in Cairo.jl.
That's the code to turn off hinting that I use
The text was updated successfully, but these errors were encountered: