Bug 38683 - Japanese fonts rendered with unusually tall line height
Summary: Japanese fonts rendered with unusually tall line height
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.1 RC2
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard: target:4.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-25 14:50 UTC by Yuki Kawara
Modified: 2013-08-30 10:29 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Unusually tall line height (here shown in the menus and combo boxes) (74.22 KB, image/png)
2011-06-25 14:52 UTC, Yuki Kawara
Details
Comparing side by side : bugged line height calculation, and GEdit (10.77 KB, image/png)
2011-06-25 14:53 UTC, Yuki Kawara
Details
Comparing side-by-side with another random Japanese font (16.80 KB, image/png)
2011-06-25 14:54 UTC, Yuki Kawara
Details
Menus in Firefox (without bugged line height calculation) (62.86 KB, image/png)
2011-06-25 14:55 UTC, Yuki Kawara
Details
System menus (correct line height) (91.72 KB, image/png)
2011-06-25 14:57 UTC, Yuki Kawara
Details
Document showing the behaviour, font is Meiryo (メイリオ) (8.84 KB, application/vnd.oasis.opendocument.text)
2011-07-09 16:45 UTC, Yuki Kawara
Details
Snapshot of using Kozuka font. (65.87 KB, image/jpeg)
2013-08-29 14:08 UTC, Yuki Kawara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuki Kawara 2011-06-25 14:50:22 UTC
I am importing a very old bug from OpenOffice that is still present in LibO 3.4.1 RC2 and which I believe is a major issue for any Japanese user.
http://openoffice.org/bugzilla/show_bug.cgi?id=109454

All Japanese fonts (except the system one) are displayed with an unusually tall line height, making it impossible to use the office suite efficiently. It affects every place where a Japanese font is used: the editing window and the UI.

Firefox displays the same problem until one opens the advanced settings and turns
browser.display.normal_lineheight_calc_control to "0" (disabling it).

I am importing the Oo bug snapshots, since the behaviour hasn't changed.
Comment 1 Yuki Kawara 2011-06-25 14:52:15 UTC
Created attachment 48418 [details]
Unusually tall line height (here shown in the menus and combo boxes)
Comment 2 Yuki Kawara 2011-06-25 14:53:03 UTC
Created attachment 48419 [details]
Comparing side by side : bugged line height calculation, and GEdit
Comment 3 Yuki Kawara 2011-06-25 14:54:14 UTC
Created attachment 48420 [details]
Comparing side-by-side with another random Japanese font
Comment 4 Yuki Kawara 2011-06-25 14:55:16 UTC
Created attachment 48421 [details]
Menus in Firefox (without bugged line height calculation)
Comment 5 Yuki Kawara 2011-06-25 14:57:34 UTC
Created attachment 48422 [details]
System menus (correct line height)
Comment 6 Khaled Hosny 2011-07-04 09:49:07 UTC
(In reply to comment #0)
> I am importing a very old bug from OpenOffice that is still present in LibO
> 3.4.1 RC2 and which I believe is a major issue for any Japanese user.
> http://openoffice.org/bugzilla/show_bug.cgi?id=109454
> 
> All Japanese fonts (except the system one) are displayed with an unusually tall
> line height, making it impossible to use the office suite efficiently. It
> affects every place where a Japanese font is used: the editing window and the
> UI.

Can you give specific font names (FOSS fonts preferred)? Also a sample document using fonts showing the buggy behaviour can be helpful too. I think I know what might be causing this (I've been beaten by it) and may try to fix it.
Comment 7 Yuki Kawara 2011-07-09 16:43:47 UTC
I don't have a FOSS font that displays that behaviour,, the huge majority of Japanese fonts on the market aren't FOSS.
But if you happen to have a cdrom of Windows Vista and up, the Meiryo font displays that behaviour.

You don't even need a document to show the behaviour, just set your Gnome font to the problematic font and look at the menus in LibreOffice... 

But I've provided a really simple document for you anyway.
Comment 8 Yuki Kawara 2011-07-09 16:45:13 UTC
Created attachment 48929 [details]
Document showing the behaviour, font is Meiryo (メイリオ)
Comment 9 Khaled Hosny 2011-08-28 13:00:56 UTC
I think I've found the root of this, in vcl/unx/generic/glyphs/gcach_ftyp.cxx:1042 there is a comment about line height in "asian" fonts being too small and reference to some bug ids, and it tries to "fix" this by adding extra line height for fonts with CJK support. This IMO is brain damaged, it is either the font is broken and need to be fixed or the behaviour is desired and should be kept, software should not play such tricks to "fix" fonts.

The other part of the issue is that LibreOffice uses OS/2 WinAscent/WinDescent to set line spacing, which again is wrong as those values are intended for clipping and typoAscender/typoDescender/typoLineGap should be used instead. It seems those fonts have WinAscent/WinDescent values that are larger than typoAscender/typoDescender (which is perfectly OK) which adds to the increased line spacing.
Comment 10 Eike Rathke 2011-08-31 17:25:43 UTC
I believe this is fixed on master with http://cgit.freedesktop.org/libreoffice/core/commit/?id=3364fefe1e2dec522211040f2f9ea37bf5cd7466

Please verify as I don't have a usable font for this.
Comment 11 Yuki Kawara 2013-08-29 13:14:38 UTC
Version 4.0.2.2 (Build ID: 400m0(Build:2)), still having the problem.
Comment 12 Khaled Hosny 2013-08-29 13:19:07 UTC
This is fixed in 4.1.0
Comment 13 Yuki Kawara 2013-08-29 14:06:53 UTC
Version 4.1.1.2 Build ID: 7e4286b58adc75a14f6d83f53a03b6c11fa2903

Definately fixed on the UI, and for most fonts in the editing window, but japanese opentype fonts (like Adobe's Kozuka) still have an unusual line height.
Comment 14 Yuki Kawara 2013-08-29 14:08:40 UTC
Created attachment 84844 [details]
Snapshot of using Kozuka font.

Attaching a snapshot of using Kozuka font. (UI uses a different japanese opentype font and looks right, but using the same font in the edit window produces the same result as with Kozuka.)
Comment 15 Khaled Hosny 2013-08-29 15:14:57 UTC
Please don’t keep re-opening this issue, the original bug has been fixed.

Kozuka font issue is a different one, this font has a very big line gap value so it works as intended AFAIC, may be we souldn’t be using line gap above the first line (or below the last line), but that is an entirely different issue and is not Japanese specific.
Comment 16 Yuki Kawara 2013-08-29 15:33:31 UTC
I don't think the bug has been completely fixed. The behaviour I described is practically the same as I reported two years ago. I checked the attachment I sent back then and all but the Meiryo one use a japanese opentype (ShinGo from Morisawa actually).

I don't think either that as you say these fonts were desgined to display such a huge amount of space above them, since they are basically aimed at space-concious desktop publishing. They display fine in GIMP, Inkscape, gedit/caja. LibreOffice, Firefox and Thunderbird on the other hand have problems with them. (For the two latter, at least that can be fixed with an advanced setting)
Comment 17 Yuki Kawara 2013-08-29 15:50:02 UTC
I remember that back then I tested with different fonts, including non-opentype japanese fonts. Most had an unusual line height, but the opentype (and some truetype like Meiryo) had it way over what is acceptable. What the fix that was applied in 4.1.0 has fixed is the UI (no matter what font is used), and the display of the fonts whose display was just slightly off back then. The opentype ones now feel like the extra space below has been added to the extra space above, which isn't a resolved case really.

By the way, I wanted to check how is Meiryo behaving but I notice that LibreOffice is ignoring all installed .ttc (true type collections) ... Will have to find a way to split it to test...
Comment 18 Khaled Hosny 2013-08-29 15:54:12 UTC
Fine, I’m done here.
Comment 19 retired 2013-08-29 23:38:33 UTC
Yuki, please open a separate issue if you still are seeing problems with LO and fonts. We'll then investigate if LO is at fault or the font or TrueType fonts are support or not. Setting this here to fixed, since that what it is.

Let's continue in a new bug from scratch with a clean plate.

merci :)
Comment 20 Yuki Kawara 2013-08-30 02:23:58 UTC
You mean that I should start a bug report with the same title and almost the same description, really?
Comment 21 Yuki Kawara 2013-08-30 03:37:57 UTC
Moved to bug 68735.
Comment 22 Eike Rathke 2013-08-30 10:11:22 UTC
You don't understand. This bug here is about a problem that has been fixed. What you are experiencing with some specific fonts is something different and hence will have a different solution and thus a different bug is appreciated. Thanks for understanding.
Comment 23 Yuki Kawara 2013-08-30 10:29:52 UTC
Right. I am the original report of this bug, I notice the same behaviour as 2 years ago but I am told it's fixed. Oh well. If you say so... There's nothing else I can do.