Bug 569340

Summary: When Hangul Jongseong displays single-consonant, rendering is wrong in GTK applications.
Product: [Fedora] Fedora Reporter: sangu <sangu.fedora>
Component: un-core-fontsAssignee: Daiki Ueno <dueno>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: behdad, dueno, fangqq, fonts-bugs, i18n-bugs, petersen, pwu, shawn.p.huang, smallvil, tfujiwar
Target Milestone: ---Keywords: MoveUpstream, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://kldp.net/projects/unfonts/issue/315235
Whiteboard:
Fixed In Version: 0.0.11-1.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-27 19:54:25 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
hangul jongseong text
none
open jongseong.txt with emacs.
none
open jongseong.txt with gedit.
none
Pango rendering result. none

Description sangu 2010-03-01 06:10:25 EST
Created attachment 397040 [details]
hangul jongseong text

Description of problem:
Hangul Jongseong wrong rendering in GTK applications.

Version-Release number of selected component (if applicable):
1.27.1-1.fc13

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
gtk2-2.19.6-1.fc13.x86_64
glib2-2.23.4-1.fc13.x86_64
fontconfig-2.8.0-1.fc13.x86_64
freetype-2.3.11-2.fc13.x86_64
Comment 1 sangu 2010-03-01 06:25:40 EST
Created attachment 397042 [details]
open jongseong.txt with emacs.

Hangul jongseong is good rendering in emacs.
Comment 2 sangu 2010-03-01 06:28:07 EST
Created attachment 397043 [details]
open jongseong.txt with gedit.

jongseong rendering is bad in gedit.
Comment 3 fujiwara 2010-03-19 02:09:04 EDT
The char is U+11AB (HANGUL JONGSEONG NIEUN)


% fc-match -v "Baekmuk Gulim"
...
	charset:
	0000: 00000000 ffffffff ffffffff 7fffffff 00000000 f7df2593 c1810040 41810040
	0001: 00020000 810e00c0 000c0e07 000000c0 00000000 00000000 00000000 00000000
...
	0004: ffff0002 ffffffff 0002ffff 00000000 00000000 00000000 00000000 00000000
	0020: 33200000 080d0063 00000000 80100000 0000001e 00001000 00000000 00000000
...


The charset in "Baekmuk Gulim" doesn't include U+11AB so _pango_engine_shape_covers() returns PANGO_COVERAGE_NONE and the font is not used in "Monospace 10".

4 * 8 * 8 == 256
0x11ab == 4523 == 256 * 17 + 171

The line #0017 is not covered by "Baekmuk Gulim" /usr/share/fonts/baekmuk-ttf/gulim.ttf

The workaround is to set the font "Baekmuk Gulim" == "백묵 굴림" with gedit preference dialog.
Comment 4 fujiwara 2010-03-22 22:14:36 EDT
OK, I confirmed wqy-zenhei includes the Korean char.
The following is the candidate fix:

--- /usr/share/fontconfig/conf.avail/65-baekmuk-ttf-gulim.conf.orig	2010-03-18 18:22:54.000000000 +0900
+++ /usr/share/fontconfig/conf.avail/65-baekmuk-ttf-gulim.conf	2010-03-23 10:29:39.000000000 +0900
@@ -2,7 +2,7 @@
 <!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
 <fontconfig>
   <match>
-    <test name="lang">
+    <test name="lang" compare="contains">
       <string>ko</string>
     </test>
     <test name="family">

--- /usr/share/fontconfig/conf.avail/65-wqy-zenhei.conf.orig	2010-01-22 10:19:43.000000000 +0900
+++ /usr/share/fontconfig/conf.avail/65-wqy-zenhei.conf	2010-03-23 10:29:55.000000000 +0900
@@ -11,7 +11,8 @@
     </match>
     
     <match>
-        <test name="lang">
+        <test name="lang" compare="contains">
+            <string>ko</string>
             <string>zh</string>
         </test>
         <test name="family">
@@ -30,7 +31,8 @@
     </alias>
 
     <match>
-        <test name="lang">
+        <test name="lang" compare="contains">
+            <string>ko</string>
             <string>zh</string>
         </test>
         <test name="family">
Comment 5 sangu 2010-03-22 23:01:12 EDT
baekmuk and wqy fonts don't be installed.

Default Korean font is UnDotum.

$ fc-match
UnDotum.ttf: "UnDotum" "Regular"

$ rpm -qa | grep fonts
kacst-one-fonts-2.0-6.fc13.noarch
thai-scalable-garuda-fonts-0.4.12-2.fc12.noarch
kacst-decorative-fonts-2.0-6.fc13.noarch
sil-abyssinica-fonts-1.0-8.fc13.noarch
kacst-title-fonts-2.0-6.fc13.noarch
lohit-malayalam-fonts-2.4.4-4.fc13.noarch
ipa-gothic-fonts-003.02-1.fc13.noarch
thai-scalable-sawasdee-fonts-0.4.12-2.fc12.noarch
kacst-farsi-fonts-2.0-6.fc13.noarch
cjkuni-fonts-common-0.2.20080216.1-35.fc13.noarch
lyx-fonts-1.6.5-5.fc13.noarch
jomolhari-fonts-0.003-8.fc12.noarch
dejavu-serif-fonts-2.30-2.fc12.noarch
un-core-dotum-fonts-1.0.2-0.10.080608.fc12.noarch
thai-scalable-waree-fonts-0.4.12-2.fc12.noarch
kacst-naskh-fonts-2.0-6.fc13.noarch
lohit-telugu-fonts-2.4.5-4.fc13.noarch
stix-fonts-0.9-13.fc12.noarch
liberation-serif-fonts-1.05.2.20091019-5.fc13.noarch
paktype-naqsh-fonts-3.0-2.fc13.noarch
urw-fonts-2.4-9.fc13.noarch
dejavu-sans-fonts-2.30-2.fc12.noarch
thai-scalable-tlwgtypewriter-fonts-0.4.12-2.fc12.noarch
kacst-screen-fonts-2.0-6.fc13.noarch
kacst-letter-fonts-2.0-6.fc13.noarch
lohit-kannada-fonts-2.4.4-3.fc13.noarch
lohit-bengali-fonts-2.4.3-4.fc13.noarch
thai-scalable-tlwgtypist-fonts-0.4.12-2.fc12.noarch
thai-scalable-tlwgmono-fonts-0.4.12-2.fc12.noarch
kacst-qurn-fonts-2.0-6.fc13.noarch
kacst-poster-fonts-2.0-6.fc13.noarch
lohit-assamese-fonts-2.4.3-3.fc13.noarch
lohit-tamil-fonts-2.4.5-2.fc13.noarch
cjkuni-fonts-ghostscript-0.2.20080216.1-35.fc13.noarch
liberation-fonts-common-1.05.2.20091019-5.fc13.noarch
liberation-sans-fonts-1.05.2.20091019-5.fc13.noarch
libfonts-1.1.3-1.fc13.x86_64
ghostscript-fonts-5.50-23.fc12.noarch
un-core-fonts-common-1.0.2-0.10.080608.fc12.noarch
thai-scalable-purisa-fonts-0.4.12-2.fc12.noarch
thai-scalable-kinnari-fonts-0.4.12-2.fc12.noarch
openoffice.org-opensymbol-fonts-3.2.0-12.13.fc13.noarch
kacst-art-fonts-2.0-6.fc13.noarch
kacst-office-fonts-2.0-6.fc13.noarch
lohit-punjabi-fonts-2.4.3-3.fc13.noarch
thai-scalable-tlwgtypo-fonts-0.4.12-2.fc12.noarch
thai-scalable-loma-fonts-0.4.12-2.fc12.noarch
sil-padauk-fonts-2.4-6.fc13.noarch
paktype-fonts-common-2.0-5.fc12.noarch
kacst-pen-fonts-2.0-6.fc13.noarch
lohit-gujarati-fonts-2.4.4-2.fc13.noarch
bitmap-fixed-fonts-0.3-16.fc13.noarch
thai-scalable-umpush-fonts-0.4.12-2.fc12.noarch
thai-scalable-fonts-compat-0.4.12-2.fc12.noarch
lklug-fonts-0.6-3.20090803cvs.fc13.noarch
lohit-devanagari-fonts-2.4.3-5.fc13.noarch
kacst-titlel-fonts-2.0-6.fc13.noarch
cjkuni-ukai-fonts-0.2.20080216.1-35.fc13.noarch
paktype-tehreer-fonts-2.0-8.fc13.noarch
dejavu-sans-mono-fonts-2.30-2.fc12.noarch
thai-scalable-norasi-fonts-0.4.12-2.fc12.noarch
kacst-book-fonts-2.0-6.fc13.noarch
dejavu-fonts-common-2.30-2.fc12.noarch
kacst-digital-fonts-2.0-6.fc13.noarch
liberation-mono-fonts-1.05.2.20091019-5.fc13.noarch
thai-scalable-fonts-common-0.4.12-2.fc12.noarch
kacst-fonts-common-2.0-6.fc13.noarch
cjkuni-uming-fonts-0.2.20080216.1-35.fc13.noarch
lohit-oriya-fonts-2.4.3-3.fc13.noarch
[sangu@localhost ~]$ rpm -qa | grep fonts | grep sort
[sangu@localhost ~]$ rpm -qa | grep fonts | sort
bitmap-fixed-fonts-0.3-16.fc13.noarch
cjkuni-fonts-common-0.2.20080216.1-35.fc13.noarch
cjkuni-fonts-ghostscript-0.2.20080216.1-35.fc13.noarch
cjkuni-ukai-fonts-0.2.20080216.1-35.fc13.noarch
cjkuni-uming-fonts-0.2.20080216.1-35.fc13.noarch
dejavu-fonts-common-2.30-2.fc12.noarch
dejavu-sans-fonts-2.30-2.fc12.noarch
dejavu-sans-mono-fonts-2.30-2.fc12.noarch
dejavu-serif-fonts-2.30-2.fc12.noarch
ghostscript-fonts-5.50-23.fc12.noarch
ipa-gothic-fonts-003.02-1.fc13.noarch
jomolhari-fonts-0.003-8.fc12.noarch
kacst-art-fonts-2.0-6.fc13.noarch
kacst-book-fonts-2.0-6.fc13.noarch
kacst-decorative-fonts-2.0-6.fc13.noarch
kacst-digital-fonts-2.0-6.fc13.noarch
kacst-farsi-fonts-2.0-6.fc13.noarch
kacst-fonts-common-2.0-6.fc13.noarch
kacst-letter-fonts-2.0-6.fc13.noarch
kacst-naskh-fonts-2.0-6.fc13.noarch
kacst-office-fonts-2.0-6.fc13.noarch
kacst-one-fonts-2.0-6.fc13.noarch
kacst-pen-fonts-2.0-6.fc13.noarch
kacst-poster-fonts-2.0-6.fc13.noarch
kacst-qurn-fonts-2.0-6.fc13.noarch
kacst-screen-fonts-2.0-6.fc13.noarch
kacst-title-fonts-2.0-6.fc13.noarch
kacst-titlel-fonts-2.0-6.fc13.noarch
liberation-fonts-common-1.05.2.20091019-5.fc13.noarch
liberation-mono-fonts-1.05.2.20091019-5.fc13.noarch
liberation-sans-fonts-1.05.2.20091019-5.fc13.noarch
liberation-serif-fonts-1.05.2.20091019-5.fc13.noarch
libfonts-1.1.3-1.fc13.x86_64
lklug-fonts-0.6-3.20090803cvs.fc13.noarch
lohit-assamese-fonts-2.4.3-3.fc13.noarch
lohit-bengali-fonts-2.4.3-4.fc13.noarch
lohit-devanagari-fonts-2.4.3-5.fc13.noarch
lohit-gujarati-fonts-2.4.4-2.fc13.noarch
lohit-kannada-fonts-2.4.4-3.fc13.noarch
lohit-malayalam-fonts-2.4.4-4.fc13.noarch
lohit-oriya-fonts-2.4.3-3.fc13.noarch
lohit-punjabi-fonts-2.4.3-3.fc13.noarch
lohit-tamil-fonts-2.4.5-2.fc13.noarch
lohit-telugu-fonts-2.4.5-4.fc13.noarch
lyx-fonts-1.6.5-5.fc13.noarch
openoffice.org-opensymbol-fonts-3.2.0-12.13.fc13.noarch
paktype-fonts-common-2.0-5.fc12.noarch
paktype-naqsh-fonts-3.0-2.fc13.noarch
paktype-tehreer-fonts-2.0-8.fc13.noarch
sil-abyssinica-fonts-1.0-8.fc13.noarch
sil-padauk-fonts-2.4-6.fc13.noarch
stix-fonts-0.9-13.fc12.noarch
thai-scalable-fonts-common-0.4.12-2.fc12.noarch
thai-scalable-fonts-compat-0.4.12-2.fc12.noarch
thai-scalable-garuda-fonts-0.4.12-2.fc12.noarch
thai-scalable-kinnari-fonts-0.4.12-2.fc12.noarch
thai-scalable-loma-fonts-0.4.12-2.fc12.noarch
thai-scalable-norasi-fonts-0.4.12-2.fc12.noarch
thai-scalable-purisa-fonts-0.4.12-2.fc12.noarch
thai-scalable-sawasdee-fonts-0.4.12-2.fc12.noarch
thai-scalable-tlwgmono-fonts-0.4.12-2.fc12.noarch
thai-scalable-tlwgtypewriter-fonts-0.4.12-2.fc12.noarch
thai-scalable-tlwgtypist-fonts-0.4.12-2.fc12.noarch
thai-scalable-tlwgtypo-fonts-0.4.12-2.fc12.noarch
thai-scalable-umpush-fonts-0.4.12-2.fc12.noarch
thai-scalable-waree-fonts-0.4.12-2.fc12.noarch
un-core-dotum-fonts-1.0.2-0.10.080608.fc12.noarch
un-core-fonts-common-1.0.2-0.10.080608.fc12.noarch
urw-fonts-2.4-9.fc13.noarch
Comment 6 Jens Petersen 2010-03-23 03:30:04 EDT
This also happens with F12 - I don't think it is a zenhei (or Baekmuk) issue
(though zenhei also steals numerous Hangul glyphs :-( )

eg pango-view jongseong.txt


@sangu: is a single U+11AB a valid character?
Comment 7 Jens Petersen 2010-03-23 03:52:29 EDT
I think it is better to report this bug upstream.
I doesn't look fedora specific.
Comment 8 fujiwara 2010-03-23 03:54:12 EDT
(In reply to comment #5)
> baekmuk and wqy fonts don't be installed.
> 
> Default Korean font is UnDotum.
> 
> $ fc-match
> UnDotum.ttf: "UnDotum" "Regular"
> 

OK, I confirmed UnDotum includes the char but cairo_scaled_font_glyph_extents()
returns x_advance = 0.
If I use WenQuanYi Zen Hei, cairo_scaled_font_glyph_extents() returns x_advance
= 13.
Comment 9 Peng Wu 2010-03-23 04:43:22 EDT
> OK, I confirmed UnDotum includes the char but cairo_scaled_font_glyph_extents()
> returns x_advance = 0.
> If I use WenQuanYi Zen Hei, cairo_scaled_font_glyph_extents() returns x_advance
> = 13.   

I dumped UnDotum.ttf with ttx(fonttools) as xml format.
And I checked the xml format of UnDotum font in UnDotum.ttx.

In the font hmtx table((horizontal metrics) table),
And find something which maybe relative with this problem:
In font UnDotum:
    <mtx name="uni11AA" width="0" lsb="-848"/>
    <mtx name="uni11AB" width="0" lsb="-828"/>
    <mtx name="uni11AC" width="0" lsb="-812"/>

And in font WenQuanYi:
    <mtx name="uni11A9" width="1024" lsb="157"/>
    <mtx name="uni11AB" width="1024" lsb="251"/>
    <mtx name="uni11AE" width="1024" lsb="245"/>
Comment 10 Jens Petersen 2010-03-23 21:12:09 EDT
So is it a font bug?
Comment 11 Peng Wu 2010-03-23 22:10:37 EDT
(In reply to comment #10)
> So is it a font bug?    

I think so.
I changed the above font as following:
    <mtx name="uni11AA" width="0" lsb="-848"/>
    <mtx name="uni11AB" width="1000" lsb="228"/>
    <mtx name="uni11AC" width="0" lsb="-812"/>
And it seems pango display is ok now.
Comment 12 Peng Wu 2010-03-23 22:14:22 EDT
Created attachment 402176 [details]
Pango rendering result.

I used the following command to check the rendering result:
$ pango-view jongseong.txt -o jongseong.png
And attach the result here.
Comment 13 fujiwara 2010-03-23 22:41:00 EDT
It seems cairo calls freetype which returns horiAdvance = 0 with UnDotum.
Probably the rendering is right.

I googled "jongseong" and it seems to mean the end char.
http://www.open-std.org/Jtc1/sc22/wg20/docs/n1037-Hangul%20Collation%20Requirements.htm

I'm not sure but I guess the jongseong char range U+1100 - U+11FF is designed to generate other chars and the UnDotum font creator expects with width 0 in the single usage.

I guess if you want to show the single consonant, probably you could use U+3134 'ㄴ' instead.
Then personally I think it's not a bug?
Comment 14 Jens Petersen 2010-03-23 23:36:16 EDT
Yeah looks you guys are right, thanks!

If I uninstall un-core-fonts, then U+11AB (jongseong.txt)
renders fine in firefox and gedit.

@sangu: Can you help to report this to the Un project?
http://kldp.net/projects/unfonts/issue/open
It might be worth testing current cvs to see if it is already
fixed upstream.
Comment 15 sangu 2010-03-24 00:42:19 EDT
Selecting another Korean fonts in gedit, Jongseong is Good Rendering.
Then, when moving Cursor on Jongseong characters, cursor moving is strange.
Comment 16 fujiwara 2010-03-24 01:24:30 EDT
(In reply to comment #15)
> Selecting another Korean fonts in gedit, Jongseong is Good Rendering.

If UnDotum is right, it might be another bug in WenQuanYi Zen Hei and the width needs to be changed to 0 because I guess UnDotum might be better maintained than WenQuanYi Zen Hei for Korean.
Comment 17 Peng Wu 2010-03-24 02:27:14 EDT
UnDotum with Bold style (UnDotumBold.ttf) shows the glyphs.
Maybe we can ask some Korean users why the two fonts show differently?
Comment 18 fujiwara 2010-04-08 22:37:25 EDT
The bug submitter:
Did you contact UnDotum community?

If none would not contact it, we Red Hat engineers may do it while the community could use Korean for almost discussions.
Comment 19 Fedora Admin XMLRPC Client 2010-04-24 01:46:31 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 20 Daiki Ueno 2010-04-26 22:18:23 EDT
FYI, sangu reported the issue to the Un project:

http://kldp.net/projects/unfonts/issue/315235

where one of the developers answered that the current UnDotumBold.ttf is rather unusual (if I understand correctly - I used machine translation services).
Comment 21 Bug Zapper 2010-07-30 06:56:01 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 22 sangu 2010-11-03 08:33:22 EDT
After updating libhangul 0.0.11, this issue was fixed. 
Thanks!
Comment 23 Daiki Ueno 2010-11-16 02:46:59 EST
I think this bug was mistakenly closed for #636216, since the problem is nothing to do with libhangul.  Reassigning back to un-core-fonts and reopening.
Comment 24 Daiki Ueno 2011-11-27 19:54:25 EST
The upstream bug was closed as "Will not fix".  So I'm closing this as well.