Bug 21197 - hinted numerals aren't fixed-width in all sizes of dejavu sans font
Summary: hinted numerals aren't fixed-width in all sizes of dejavu sans font
Status: RESOLVED FIXED
Alias: None
Product: freetype
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium trivial
Assignee: Werner Lemberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-15 05:56 UTC by whyoh
Modified: 2009-04-27 10:43 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description whyoh 2009-04-15 05:56:25 UTC
using the default dejavu sans font on fedora 11 snap1 numerals aren't all the same width when 'full' or 'medium' hinting is enabled.  this leads to a 'jiggling text' effect on ticking clocks.

versions are:
freetype-2.3.9-3.fc11.i586
dejavu-sans-fonts-2.29-2.fc11.noarch

for more details see redhat bug 495820
Comment 1 Werner Lemberg 2009-04-15 09:02:01 UTC
Reading the redhat bug description I see that you are not using the TT hinter.

With the autohinter I fear this problem is unavoidable.  It probably has to
be handled on a level higher than FreeType: If you pass a font to the library,
the autohinter simply doesn't know that the digits 0-9 are intended to have the
same width.  As you certainly aware there are fonts containing `old digits'
which intentionally have different widths.

I can imagine that there is an option to `fontconfig' which forces the
same width to all digits if the autohinter is used (probably using the average
value of all digit widths).
Comment 2 whyoh 2009-04-15 09:20:40 UTC
thanks for the quick response.

hmm.  can't the library tell that the numerals are all the same width in the unhinted font?

if so then might there be an option or rule to tell the autohinter: "numerals are special - don't hint them (much) if they're all the same width in this font"?

i think that would be enough for me.  but i'm a little hesitant about where (if at all) it's appropriate to assert the "specialness" of numerals vs hinting.

and what should we say when everyone starts raising "my numerals are fuzzy!!" bugs?  ;-)
Comment 3 Werner Lemberg 2009-04-15 22:15:21 UTC
It's completely irrelevant whether the unhinted numerals have the same width
or not.  In a TrueType font, the hinting instructions modify the advance width
as needed, and this information is not available to the autohinter.

There are two possibilities: Either FreeType gets an option for the autohinting
module to instruct that some glyphs (numerals and probably some others too)
should have the same width, or the library which uses FreeType does this.  IMHO
it should be the latter.
Comment 4 Behdad Esfahbod 2009-04-15 23:21:01 UTC
The autohinter already has lots of heuristics based on individual Latin characters.  I'd rather it also handles the issue at hand (that is, if all input ASCII glyphs have the same width, they should be hinted to have the same output width also).  There is no place for this kind of tweak higher in the stack really.
Comment 5 Werner Lemberg 2009-04-15 23:28:20 UTC
Behdad, it's not clear to me what you mean with `all input ASCII glyphs
have the same width'.
Comment 6 Behdad Esfahbod 2009-04-16 00:29:24 UTC
(In reply to comment #5)
> Behdad, it's not clear to me what you mean with `all input ASCII glyphs
> have the same width'.

I mean, if the unhinted, design width, of the ASCII digit glyphs are all the same, the autohinter should ensure that their hinted width is also the same.
Comment 7 Werner Lemberg 2009-04-27 10:43:15 UTC
This is now fixed in the FreeType git repository.  Please test.


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.