Re: A little polish of Thai shaper



Some more info..

I've retried the Windows font and it's now successful. It just need
additional settings for X. So, nothing to be done here for that case.
But the fix for iso10646 fonts is still needed.

With this, I've fixed a glyph map entry for Mai Taikhu in combination
with upshooting-tail consonant.

And the change in the last 'else' case is for WTT 2.0 separate cell
rendering for strings of non-cannonical order. The screenshot may
describe what I meaned :-

    http://linux.thai.net/~thep/2001_06_14_152904_shot.jpg

The attached patch has incorporated the previous patch. So, you could
use this one instead.

Regards,
-Theppitak.
-- 
Theppitak Karoonboonyanan
Information Research and Development Division, NECTEC
(Was: Software and Language Engineering Laboratory)
http://www.links.nectec.or.th/~thep/  mailto:theppitak nectec or th

On Wed, Jun 13, 2001 at 03:20:03PM +0700, Theppitak Karoonboonyanan wrote:
> Hello,
> 
> I've just tested pango-0.16 with an iso10646 font, and the upper& lower
> vowels for Thai appear to be shifted to the left, as shown in :-
> 
>   http://linux.thai.net/~thep/2001_06_12_223941_shot.jpg
> 
> (Note that in the screenshot, I use an adjusted version of clearyu
> font to correct Thai glyphs. And I have already sent the patch to
> the author.)
> 
> I found that the case of iso10646 fonts are distinguished from other
> kinds of Thai fonts, which is not necessary here. I've tried fixing it,
> as in the attached patch, and the result is :-
> 
>   http://linux.thai.net/~thep/2001_06_12_235512_shot.jpg
> 
> Moreover, I found that the Thai shaper doesn't work with Windows
> TrueType fonts, which are Unicode-based, due to the ucs2tis()
> conversion we did in the past. Therefore, I think what we have
> to do next is revise it to be 16-bit, and the codepage classification
> might need auto detection, just like what ttmkfdir does, rather than
> the XLFD determining as I once proposed. Because the convention is
> 8-bit based.
> 
> But first, please check if the patch is OK.
> 
> Regards,
> -Theppitak.
> -- 
> Theppitak Karoonboonyanan
> Information Research and Development Division, NECTEC, Thailand
> (Was: Software and Language Engineering Laboratory)
> http://www.links.nectec.or.th/~thep/  mailto:theppitak nectec or th
> 
> _______________________________________________
> gtk-i18n-list mailing list
> gtk-i18n-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

--- thai-x.c	Tue Jun 12 23:25:00 2001
+++ thai-x.c.new	Thu Jun 14 15:30:35 2001
@@ -298,7 +298,7 @@
  */
 static const ThaiShapeTable Mac_shape_table = {
   { 0xE7, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0xED, 0xEE },
-  { 0xE7, 0x83, 0x84, 0x85, 0x86, 0x87, 0x8F, 0xEE },
+  { 0x93, 0x83, 0x84, 0x85, 0x86, 0x87, 0x8F, 0xEE },
   { 0x93, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x8F, 0xEE },
   { 0x92, 0x00, 0x00, 0x94, 0x95, 0x96, 0x97 },
   { 0xD8, 0xD9, 0xDA },
@@ -309,7 +309,7 @@
  */
 static const ThaiShapeTable Win_shape_table = {
     { 0xE7, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0xED, 0xEE },
-    { 0xE7, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x99, 0xEE },
+    { 0x9A, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x99, 0xEE },
     { 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0x99, 0xEE },
     { 0x98, 0x00, 0x00, 0x81, 0x82, 0x83, 0x84 },
     { 0xFC, 0xFD, 0xFE },
@@ -412,30 +412,21 @@
 
   if (combining)
     {
-      if (font_info->type == THAI_FONT_TIS ||
-	  font_info->type == THAI_FONT_TIS_MAC ||
-	  font_info->type == THAI_FONT_TIS_WIN)
-	{
-          glyphs->glyphs[index].geometry.width =
-		logical_rect.width + glyphs->glyphs[index - 1].geometry.width;
-          if (logical_rect.width > 0)
-	      glyphs->glyphs[index].geometry.x_offset = glyphs->glyphs[index - 1].geometry.width;
-          else
-	      glyphs->glyphs[index].geometry.x_offset = glyphs->glyphs[index].geometry.width;
-	  glyphs->glyphs[index - 1].geometry.width = 0;
-	}
-      else
-        {
-	  glyphs->glyphs[index].geometry.width =
-		MAX (logical_rect.width, glyphs->glyphs[index - 1].geometry.width);
-	  glyphs->glyphs[index - 1].geometry.width = 0;
-	  glyphs->glyphs[index].geometry.x_offset = 0;
-        }
+      glyphs->glyphs[index].geometry.x_offset =
+          glyphs->glyphs[index - 1].geometry.width;
+      glyphs->glyphs[index].geometry.width =
+          logical_rect.width + glyphs->glyphs[index - 1].geometry.width;
+      glyphs->glyphs[index - 1].geometry.width = 0;
     }
   else
     {
-      glyphs->glyphs[index].geometry.x_offset = 0;
-      glyphs->glyphs[index].geometry.width = logical_rect.width;
+      if (logical_rect.width > 0) {
+        glyphs->glyphs[index].geometry.x_offset = 0;
+        glyphs->glyphs[index].geometry.width = logical_rect.width;
+      } else {
+        glyphs->glyphs[index].geometry.x_offset = ink_rect.width;
+        glyphs->glyphs[index].geometry.width = ink_rect.width;
+      }
     }
   
   glyphs->glyphs[index].geometry.y_offset = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]