| Summary: | glyphs metrics should always be hinted, regardless of load_flags | ||
|---|---|---|---|
| Product: | cairo | Reporter: | Chia-I Wu <b90201047> |
| Component: | freetype font backend | Assignee: | Owen Taylor <otaylor> |
| Status: | RESOLVED NOTABUG | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
| Severity: | normal | ||
| Priority: | high | ||
| Version: | 1.1.1 | ||
| Hardware: | x86 (IA32) | ||
| OS: | Linux (All) | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
| Attachments: |
patch
I guess font metrics should be hinted too... clipped glyphs |
||
|
Description
Chia-I Wu
2006-02-11 17:46:42 UTC
Created attachment 4595 [details] [review] patch Created attachment 4596 [details] [review] I guess font metrics should be hinted too... Created attachment 4744 [details]
clipped glyphs
Metrics hinting in cairo, by definition, means quantizing them so that metrics
have integer values. Without doing this, the inter-character or inter-line
space may be inconsistent. Another issue is that glyphs may be clipped.
Imagine a typeface with descender 2.4px and a glyph which also has descender
2.4px. With anti-alias, the glyph has actually descender 3.0px. While 2.4 is
rounded to 2.0px, the bottom-most pixel of the glyph is clipped.
In this image, you can see that the `g' is clipped (firefox + pango).
This is the kind of thing that should go into 1.0 branch I believe. Pango output looks very bad with FreeType 2.2, so, this is kinda High priority IMO, and I really prefer not patching for this in Pango... (In reply to comment #4) > and I really prefer not patching for this in Pango... That's true. pango should not be patched for this, for otherwise performing device-independent layout is not possible with cairo backend. You cannot do device-independent layout anyway, if you do any kind of rounding/hinting. You always have a dpi setting and always laying out for that specific setting. If you have a big enough dpi and large enough fonts, it looks like it's device-independent. That's all. Can pango be used to do device-independent layout with cairo backend when metrics hinting is turned off? I thought pango is able to do that, as long as the backend in use can. My first try was to patch for this in pango. But that patch would make device-independent layout with cairo backend impossible. I soon turned to work on cairo because it also needs patching and it has a swtich to turn metrics hinting on or off, which makes my patch correct and cleaner. Metric hinting and glyph hinting can be turned on and off independently in Pango with pango_cairo_context_set_font_options() ... there are some caveats, of course; for example even with metric hinting off you won't get subpixel glyph positioning, unless you draw your text as outlines. So, yes, if you turn metric hinting off, you will get device independent layout. David Turner reverted that change. Closing. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.