Sugree

Main menu

  • About
    • Self
  • Project
    • Barcode Generator / Reader
    • GT200
    • GeoPin
    • Mitter
    • Red Mob
    • Thairath Breaking News
    • Twitter Android SDK
    • jibjib
    • microblog-purple
    • English
    • Thai

Patches to fix sara-um

Submitted by sugree on Thu, 09/18/2008 - 00:32
  • Hardy
  • OpenOffice.org
  • OpenSource
  • Ubuntu
  • Thai

เมื่อวานปลุกวิญญาณนักโหวตให้ช่วยกันหน่อย ได้ผลดีเกินคาด ใช้เวลาวันเดียว มีความคืบหน้าจนถึงขั้นได้เรื่องได้ราว เมื่อเช้า #89974 เปลี่ยนสถานะเป็น resolved ด้วยเหตุผลว่า worksforme ซึ่งพอจะเดาได้ไม่ยาก ทาง OO.o แนะนำให้ลองกับรุ่นล่าสุด ก็คือ 3.0.0 RC1 ผมลองก่อนหน้านั้นแล้ว ตอบได้ทันที ไม่มีปัญหาครับ แต่ประเด็นคือ Ubuntu จะออก 8.10 เดือนหน้า ไม่รู้ว่าจะใช้ 3.0.0 หรือเปล่า แนวโน้มคือไม่ ต้องรอไป 8.10.1 ถ้ามี นั่นแปลว่าเราจะต้องเจอปัญหาสระอำ #89974 ไปอีกประมาณ 6 เดือน ผู้ใช้หน้าใหม่ที่ใช้ Ubuntu คงกุมขมับแล้วกลับไปใช้อย่างอื่นแทนแน่

หลังจากอ้อนสั้นๆ อยากได้ patch มาทำ backport ทาง OO.o เค้าก็ใจดีนะ อุตส่าห์ไปหามาให้จนได้ และแล้ว #89974 ก็ปิดตัวลง ได้ไฟล์มา 3 ไฟล์ ขั้นถัดไปก็หาเครื่องมาคอมไพล์ทดสอบ

ใครว่างลองวิเคราะห์โค้ดข้างล่างแล้วอธิบายหน่อยครับ

--- vcl/source/glyphs/gcach_ftyp.cxx 2008-07-25 11:26:42+0000   1.150
+++ vcl/source/glyphs/gcach_ftyp.cxx  2008-08-27 12:11:49+0000   1.151
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: gcach_ftyp.cxx,v $
- * $Revision: 1.150 $
+ * $Revision: 1.151 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1174,9 +1174,11 @@
             // check if symbol aliasing helps
             if( (aChar <= 0x00FF) && mpFontInfo->IsSymbolFont() )
                 nGlyphIndex = FT_Get_Char_Index( maFaceFT, aChar | 0xF000 );
+#if 0 // disabled for now because it introduced ae bad side-effect (#i88376#)
             // Finally try the postscript name table
             if (!nGlyphIndex)
                 nGlyphIndex = psp::PrintFontManager::get().FreeTypeCharIndex( maFaceFT, aChar );
+#endif
         }
         mpFontInfo->CacheGlyphIndex( aChar, nGlyphIndex );
     }
--- vcl/unx/source/gdi/salgdi3.cxx   2008-04-11 09:55:12+0000    1.154
+++ vcl/unx/source/gdi/salgdi3.cxx    2008-07-25 11:03:15+0000    1.154.102.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: salgdi3.cxx,v $
- * $Revision: 1.154 $
+ * $Revision: 1.154.102.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -799,7 +799,14 @@
     OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" ));
     mpCairoLib = osl_loadModule( aLibName.pData, SAL_LOADMODULE_DEFAULT );
     if( !mpCairoLib )
- return;
+        return;
+
+#if 0
+    // check cairo version
+    int (*p_version)();
+    p_version = (int(*)()) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_version" );
+ const int nVersion = p_version ? (*p_version)() : 0;
+#endif
 
     mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int )) 
         osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_xlib_surface_create_with_xrender_format" );
@@ -916,7 +923,7 @@
     for( int nStart = 0; rLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); )
     {
         cairo_glyph_t aGlyph;
-        aGlyph.index = aGlyphId;
+        aGlyph.index = aGlyphId & GF_IDXMASK;
         aGlyph.x = aPos.X();
         aGlyph.y = aPos.Y();
         cairo_glyphs.push_back(aGlyph);
--- vcl/unx/source/gdi/salgdi3.cxx   2008-07-25 12:19:12+0000   1.154.102.2
+++ vcl/unx/source/gdi/salgdi3.cxx    2008-07-25 12:40:30+0000   1.154.102.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: salgdi3.cxx,v $
- * $Revision: 1.154.102.2 $
+ * $Revision: 1.154.102.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -915,8 +915,8 @@
 
 void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
 {
-    std::vector<cairo_glyph_t> cairo_glyphs_000, cairo_glyphs_090, cairo_glyphs_270;
-    cairo_glyphs_000.reserve( 256 );
+    std::vector<cairo_glyph_t> cairo_glyphs;
+    cairo_glyphs.reserve( 256 );
 
     Point aPos;
     sal_GlyphId aGlyphId;
@@ -926,14 +926,10 @@
         aGlyph.index = aGlyphId & GF_IDXMASK;
         aGlyph.x = aPos.X();
         aGlyph.y = aPos.Y();
-     switch( aGlyphId & GF_ROTMASK ) {
-            default:     cairo_glyphs_000.push_back(aGlyph); break;
-            case GF_ROTL:    cairo_glyphs_090.push_back(aGlyph); break;
-            case GF_ROTR:    cairo_glyphs_270.push_back(aGlyph); break;
-        }
+        cairo_glyphs.push_back(aGlyph);
     }
 
-    if( cairo_glyphs_000.empty() && cairo_glyphs_090.empty() && cairo_glyphs_270.empty() )
+    if (cairo_glyphs.empty())
         return;
 
     // find a XRenderPictFormat compatible with the Drawable
@@ -999,39 +995,20 @@
     rCairo.set_font_face(cr, font_face);
 
     cairo_matrix_t m;
+    const ImplFontSelectData& rFSD = rFont.GetFontSelData();
+    int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight;
+
     rCairo.matrix_init_identity(&m);
 
     if (rLayout.GetOrientation())
         rCairo.matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0);
 
-    const ImplFontSelectData& rFSD = rFont.GetFontSelData();
-    int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight;
     rCairo.matrix_scale(&m, nWidth, rFSD.mnHeight);
     if (rFont.NeedsArtificialItalic())
         m.xy = -m.xx * 0x6000L / 0x10000L;
 
-    // display straight glyphs
- if( !cairo_glyphs_000.empty() )
- {
-     rCairo.set_font_matrix( cr, &m );
-     rCairo.show_glyphs( cr, &cairo_glyphs_000[0], cairo_glyphs_000.size() );
- }
-
- // display rotated glyphs (typical for vertical writing mode)
- if( !cairo_glyphs_090.empty() )
-    {
-     rCairo.matrix_rotate( &m, +M_PI/2 );
-     rCairo.set_font_matrix( cr, &m );
-     rCairo.show_glyphs( cr, &cairo_glyphs_090[0], cairo_glyphs_090.size() );
- }
- if( !cairo_glyphs_270.empty() )
- {
-     const double fAngle = cairo_glyphs_090.empty() ? M_PI/2 : M_PI; // 90 or 180 degress
-     rCairo.matrix_rotate( &m, fAngle );
-     rCairo.set_font_matrix( cr, &m );
-     rCairo.show_glyphs( cr, &cairo_glyphs_270[0], cairo_glyphs_270.size() );
- }
-
+    rCairo.set_font_matrix(cr, &m);
+    rCairo.show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size());
     rCairo.destroy(cr);
 }
 
@@ -1412,8 +1389,9 @@
 {
     // draw complex text
     ServerFont& rFont = rLayout.GetServerFont();
+ const bool bVertical = rFont.GetFontSelData().mbVertical;
 
-    if (CairoWrapper::get().isCairoRenderable(rFont))
+    if( !bVertical && CairoWrapper::get().isCairoRenderable(rFont) )
         DrawCairoAAFontString( rLayout );
     else
     {
Roti (alpha) thinks you may like these:
  • New patches for Thai vowels
  • Login to post comments

Popular Tags

Android BarCamp BarCampBangkok Book Django Drupal Education Family Google Hardware Hardy Health Interview Intrepid Java jibjib Joke Life microblog-purple OpenOffice.org OpenSource Podcast Python Review SoC Social Network Trip Twitter Ubuntu Weekly Suki
more tags

Powered By

debian
apache
drupal
drupal.in.th
openfreehost
inox
feedburner

© 2007-2008 Sugree Phatanapherom. Creative Commons [Feed Content / Comment]
RoopleTheme