Bug 23659

Summary: Tall glyphs like U+1EA2 (A+hook above) are clipped out and unreadable on Firefox/IE
Product: DejaVu Reporter: seelie317
Component: SansAssignee: Deja Vu bugs <dejavu-bugs>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: A sample to reproduce the problem on Firefox/IE
Image: this is what I'm seeing on my Firefox/IE when viewing test.html

Description seelie317 2009-09-02 15:57:52 UTC
Created attachment 29126 [details]
A  sample to reproduce the problem on Firefox/IE

When the glyph is very tall, for example,
U+1EA2 [ Ả ] LATIN CAPITAL LETTER A WITH HOOK ABOVE
U+1EAE [ Ắ ] LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
its highest part is clipped out on my Windows XP SP3,
and the character may get practically unreadable:
for example, U+1EA2 looks like 
U+00C1 [ Á ] LATIN CAPITAL LETTER A WITH ACUTE
because only the base of the hook is shown, and you can't read it
as 'A with HOOK ABOVE'; similarly U+1EAE looks like
U+0102 [ Ă ] LATIN CAPITAL LETTER A WITH BREVE

This problem appears to happen only when some kind of rendering (DrawTextEx etc.)
is used on Windows and doesn't happen on Notepad,
so technically this may be Windows' problem,
but it does happen on my Firefox and IE8.
Other fonts (Charis SIL, Courier New, Tahoma, Times New Roman, etc.)
don't have this problem, and work just fine on Firefox or IE.

Steps to Reproduce: View test.html (I'm attaching) by firefox or MSIE
Actual Results: LATIN CAPITAL LETTER A WITH HOOK ABOVE looks like
LATIN CAPITAL LETTER A WITH ACUTE and other similar problems.
Expected Results: These are two different glyphs.
Build Date & Platform: Windows XP SP3
 USP10 version 1.0626.6001.18000
 DejaVu Sans Version 2.30
Additional Information: Other fonts do not have this problem.

This is my first report here. I did read the Guidelines but
correct me if I'm not doing right.
Comment 1 seelie317 2009-09-02 15:59:40 UTC
Created attachment 29127 [details]
Image: this is what I'm seeing on my Firefox/IE when viewing test.html
Comment 2 Ben Laenen 2009-09-03 03:51:14 UTC
There's not much we can do here. First of all, Windows shouldn't just cut off those glyphs at a certain point. If you try Firefox on Linux, you'll see that all accents are properly rendered.

There's two things we could do to make it work in Windows: increase line spacing, but then we'd break all documents made with DejaVu, and would make the font a lot less appealing for usage as a system font. Or we could make the base glyphs smaller than the normal capitals, because there just isn't enough room to put all accents in the space between the letter and the point where Windows is clipping it off. But that wouldn't look very nice either.

So, in short, Windows should fix its rendering and don't cut the glyphs off anymore.
Comment 3 seelie317 2009-09-03 05:29:07 UTC
@Ben Laenen
You may be right, but there are some Windows-specific parameters,
as in the 'OS/2' table, and it might be possible to tweak the
settings for Windows without changing anything for non-Windows.
For example... 
http://www.microsoft.com/typography/otspec/os2.htm#wa
[QUOTE]
The ascender metric for Windows. [...]computed as the yMax for all characters[...] used to compute the Windows font height and default line spacing. For platform 3 encoding 0 fonts, it is the same as yMax. Windows will clip the bitmap of any portion of a glyph that appears above this value.
[/QUOTE]
Hopefully, couldn't we just adjust this value or similar value somewhere, which only Windows will use, to tell Windows that DejaVu's yMax is large, so it won't clip things prematurely? Or is the problem much more complicated?

Thanks for replying. I'd appreciate it even if this can't be fixed;
but since other cross-platform fonts do not have the same problem,
there should be some easy way to solve this. I'll look into it myself too
if I have time. 
Comment 4 Ben Laenen 2009-09-03 05:45:32 UTC
Those values aren't used on Windows only, and they do change things like line spacing, not only in Windows but on other platforms as well.

Other fonts don't have the problem because they were designed for it, by having more line spacing (i.e. more room between ascender height and cut-off height). Since we build on Vera we have to do it with what we've got. We could very well solve this by adding more line spacing but we aren't going to do that for obvious reasons.
Comment 5 seelie317 2009-09-03 06:39:30 UTC
OK, thank you for clarification.
Then, the only reasonable option would be not to use DejaVu on
web pages for languages like Vietnamese, as long as the
pages may be used by Windows users too.
Even so, DejaVu can be very useful for many other purposes.
Thank you.

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.