GNOME Bugzilla – Bug 95800
misc. improvement of hangul_shaper for X11 core fonts
Last modified: 2004-12-22 21:47:04 UTC
a spin-off from bug 95569. there are a few small glitches to fix in hangul shaper module for X11 core fonts. Fix will follow soon.
Created attachment 11552 [details] [review] a patch
What this patch does : - name change : ksx1005 -> ksx1001johab ( KS X 1005 has nothing to do with JOHAB encoding defined in KS X 1001:1998 Annex 3. KS X 1005 is the Korean equivalent of ISO 10646) - Fix Hangul Modern Jamo mapping in ksx1001johab(). Hangul modern Jamo codepoints in JOHAB encoding cannot be obtained the way code points for other symbols are obtained from KS X 1001 code points. (ref. KS X 1001 Annex 3 table 3 row 4) - Fix the mapping function from KS X 1001 symbol code points to symbol code points in JOHAB. There's a gap which was overlooked in the original code. - Using 0x11A7 as TFILL (even internally) is a bit dangerous because that code point can be assigned a vowel in the future. Tried to prevent a potential problem by a couple of changes in table and macro definition.
Youh reminded me of the variable n_code, which I had forget to use! :) The below is a cleaned TFILL fix. IS_T_I() and IS_T_S_I are no more needed beause U+116F will never be passed to render_syllable_with_*() Index: hangul-x.c =================================================================== RCS file: /cvs/gnome/pango/modules/hangul/hangul-x.c,v retrieving revision 1.22 diff -u -r1.22 hangul-x.c --- hangul-x.c 15 Oct 2002 08:48:34 -0000 1.22 +++ hangul-x.c 15 Oct 2002 18:16:56 -0000 @@ -714,10 +714,10 @@ gint16 sindex; sindex = wc4 - SBASE; - wcs[0] = LBASE + (sindex / NCOUNT); - wcs[1] = VBASE + ((sindex % NCOUNT) / TCOUNT); - wcs[2] = TBASE + (sindex % TCOUNT); - n_code = 3; + wcs[n_code++] = LBASE + (sindex / NCOUNT); + wcs[n_code++] = VBASE + ((sindex % NCOUNT) / TCOUNT); + if (sindex % TCOUNT) + wcs[n_code++] = TBASE + (sindex % TCOUNT); if (n_jamos > 0) { @@ -728,7 +728,7 @@ } /* Draw a syllable. */ - (*render_func) (font, subfont, wcs, 3, + (*render_func) (font, subfont, wcs, n_code, glyphs, &n_glyphs, cluster_offset); cluster_offset = next - text; /* Clear. */
Created attachment 11579 [details] [review] a new patch with n_code
Created attachment 11798 [details] [review] a new patch
I've checked the latest patch with 'baekmuk batang' with the encoding file syncronized with that of CMap file for ksc5601.1992-3 shipped with Solaris 8(which in turn came from Adobe). It worked as intended.(to test this, I had to switch iso10646-1 and ksc5601.1992-3 in fallback_charset list). That means, it should also work under Solaris. There are a couple of problems, though. The root cause of the problem is that NO ksc5601.1992-3 font is complete. Virtually all of them don't have glyphs at code points for trailing consonants if they're also leading consonants. This problem can be solved by fixing Cmap file for CID-keyed fonts (in case of Solaris) and fixing encoding file for freetype backend (in case of XFree86 4.x). Both files were made by me and that's my fault.... However, it'll take time fixed Cmap file and encoding file to propagate ... In the meantime, it has to be checked whether a glyph is present (with pango_x_has_glyph ()) and a fallback has to be invoked if not. I also found a similar problem with iso10646 (actual character coverage varis from font to font) and will file a new bug for that.
Moving bugs to new hangul component
Applied to HEAD and pango-1-0 2002-11-04 Changwoo Ryu <cwryu@debian.org> * modules/hangul/hangul-defs.h (IS_S): Fixed wrong syllable check. * modules/hangul/hangul-defs.h: * modules/hangul/hangul-x.c: No more use of TFILL, the internal trailing consonant filler. (render_syllable_with_*): Appended empty syllable (ex. LFILL+VFILL) rendering case (#96175). (render_syllable_with_ksx1005): Fixed wrong fallback glyphs indices (from #95800 by Jungshik Shin). 2002-11-05 Changwoo Ryu <cwryu@debian.org> * modules/hangul/hangul-x.c: No more use of TFILL, the internal trailing consonant filler. (render_syllable_with_*): Appended empty syllable (ex. LFILL+VFILL) rendering case (#96175). (render_syllable_with_ksx1001johab): Renamed from render_syllable_with_ksx1005(). (#95800). (render_syllable_with_ksx1005): Fixed wrong fallback glyphs indices (#95800). (render_syllable_with_ksx1001johab): Checks whether a given L+V+T? jamos are modern ones before rendering as a precomposed syllable (#96179).
Sounds like this has been applied now, and can be closed.
Yes, all issues were solved except for 'Jamo' codepoint problem in JOHAB. However, there's a little problem applyting that part of the patch now because there is a bug in XF86 font encoding file and CMap file used by Solaris as I mentioned in my commnet on 2002-10-23. I've already submitted a patch for XFree86 font encoding file and hopefully it'll be applied before 4.3.0 release. As for CMap file, I'm gonna send a new CMap file for ksc5601.1992-3 to Ken Lunde of Adobe and then Sun will pick it up there. Either I'll revisit this bug later or open a new bug to deal with only that issue.