Bug 7825

Summary: Cyrillic Sans Bold unaligned, too high at small sizes
Product: DejaVu Reporter: Pavel Roskin <proski>
Component: SansAssignee: Deja Vu bugs <dejavu-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: test screenshot
kcontrol with antialiasing disabled, using DejaVu Sans

Description Pavel Roskin 2006-08-09 11:40:28 UTC
I'm using current DejaVu fonts from Subversion (days before 2.9 release). 
Cyrillic letters look pretty bad in DejaVu Sans Bold at low sizes (10 and
below).  The screenshot shows DejaVu Sans Bold at size 10 (96dpi) with RGB
subpixel rendering (which shouldn't be relevant - it just makes it easy to see
the problem on an LCD).

It's obvious that sha (ш) is lower than scha (щ), and pe (п) is lower than o
(о).  er (р) has some strange kink near in the top left corner.  It's supposed
to look exactly like Latin "p".

Furthermore, all Cyrillic capital letters are higher than the Latin
counterparts.  The small letters are bigger too, and they are also unaligned
among themselves.
Comment 1 Pavel Roskin 2006-08-09 11:41:23 UTC
Created attachment 6507 [details]
test screenshot
Comment 2 Ben Laenen 2006-08-09 12:31:09 UTC
Are you using the autohinter? The glyphs you talk about are all hinted, and 
should display much better than in your screenshot, with the bytecode 
interpreter enabled. Capitals being bigger in Cyrillic shouldn't happen 
either, since the ones that look like Latin capitals are references to the 
Latin ones, meaning that they are essentially the same glyph, and should 
render exactly the same.

If you are using the autohinter, there is nothing we can do about this.

If you use KDE, you can always test by tweaking the hinting style in the fonts 
settings in kcontrol.
Comment 3 Pavel Roskin 2006-08-10 14:45:32 UTC
(In reply to comment #2)

> Are you using the autohinter?

I guess I am.

> The glyphs you talk about are all hinted, and 
> should display much better than in your screenshot, with the bytecode 
> interpreter enabled.

I understand I should have provided more information about my system.  It's the
current Fedora Development with freetype 2.2.1.  I don't know how to control
whether the interpreter is enabled.

> Capitals being bigger in Cyrillic shouldn't happen
> either, since the ones that look like Latin capitals are references to the 
> Latin ones, meaning that they are essentially the same glyph, and should 
> render exactly the same.

I can see it in the *.sfd files, so it's quite puzzling.  I guess the autohinter
is working differently on different scripts.

> If you are using the autohinter, there is nothing we can do about this.
> 
> If you use KDE, you can always test by tweaking the hinting style in the fonts 
> settings in kcontrol.

There are two hinting related controls in kcontrol.  One is "use sub-pixel
hinting" and the other is "hinting style".  I had the first of them set to RGB
and the second to "full".

Strangely enough, setting "hinting style" to "none" doesn't disable "use
sub-pixel hinting".  I guess "hinting style" is related to autohinting and "use
sub-pixel hinting" is not.

Unfortunately, setting "hinting style" to "none" makes the unwanted color
variations of the text too pronounced, and turning off "sub-pixel hinting" makes
the text blurry.  Turning off anti-aliasing makes the text extremely ugly.  And
that affects Latin symbols too.

I settled for the with blurry text for now (no sub-pixel hinting, style none),
but I guess I'm not actually using the hinting from the fonts, or the
non-antialiased text would be looking better.
Comment 4 Pavel Roskin 2006-08-10 14:46:47 UTC
Created attachment 6516 [details]
kcontrol with antialiasing disabled, using DejaVu Sans
Comment 5 Ben Laenen 2006-09-02 08:52:18 UTC
If you want to enable the real hinting instructions in the font, follow the 
instructions at https://bugs.freedesktop.org/show_bug.cgi?id=7825 to recompile 
the FreeType rpm.

It's possible that you have to edit your fonts.conf file as well to disable 
the autohinter.
Comment 6 Pavel Roskin 2006-09-05 07:57:30 UTC
The link in the above comment points to this bug.  It doesn't point to the
instructions how to recompile the FreeType rpm.  I guess what needs to be done
is to enable TT_CONFIG_OPTION_BYTECODE_INTERPRETER in
include/freetype/config/ftoption.h.  It's not hard to do.  Still, it would be
nice to have a working link to the "official" instructions here, especially if
that page discusses the patent implications.
Comment 7 Ben Laenen 2006-09-05 08:06:30 UTC
Oops, that must have been an error while copy-pasting. The correct link is 
http://cri.ch/linux/docs/sk0017.html
Comment 8 Andrey V. Panov 2006-10-10 16:45:54 UTC
I think freetype is forced to autohint glyphs with own algorithm on your 
system. On modern system check whether you have the 10-autohint.conf symlink 
at /etc/fonts/conf.d/ , remove it.

Proper check of rendering can be made using ftview program from ft2demos 
packages. It renders a font independently from X.

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.