分页: 1 / 5

(升级到2005.12.10 简单实现)手工升级freetype&ibXft在Ubuntu 5.10 下实现粗体

发表于 : 2005-10-05 9:27
xufan106
升级到2005.12.10 教程for 菜菜菜鸟
详细的方法见 45楼
viewtopic.php?p=40191#40191

升级到2005.11.8 实现粗体/斜体
详细的情形看

13 楼
viewtopic.php?p=32931#32931


利用第三方源+手工升级freetype&ibXft在Ubuntu 5.10 下实现粗体

最早贴于linuxsir

http://www.linuxsir.org/bbs/showthread. ... ost1281139

下载freetype:

http://prdownloads.sourceforge.net/free ... 10.tar.bz2
解开源代码后

代码: 全选

$cd freetype-2.1.10
打上下面的patch:


来自 http://www.linuxsir.org/bbs/showthread. ... ge=1&pp=15
bold.patch

代码: 全选

--- freetype-2.1.10.orig/include/freetype/config/ftoption.h	2005-05-30 03:53:43.000000000 +0800
+++ freetype-2.1.10/include/freetype/config/ftoption.h	2005-05-30 07:40:03.000000000 +0800
@@ -436,7 +436,7 @@ FT_BEGIN_HEADER
   /*   Do not #undef this macro here, since the build system might         */
   /*   define it for certain configurations only.                          */
   /*                                                                       */
-/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
 
 
   /*************************************************************************/

代码: 全选

$patch -pl < ./bold.patch
打来自freetype2-2.1.10-3mdk.src.rpm
的patch:
freetype-2.1.10-cvsfixes.patch

代码: 全选

--- freetype2/include/freetype/internal/ftobjs.h	27 May 2005 06:01:28 -0000	1.90
+++ freetype2/include/freetype/internal/ftobjs.h	20 Jun 2005 09:04:49 -0000	1.91
@@ -452,6 +452,13 @@ FT_BEGIN_HEADER
  /* */
 
  /*
+  * grid-fit slot->metrics
+  */
+  FT_BASE( void )
+  ft_glyphslot_grid_fit_metrics( FT_GlyphSlot  slot );
+
+
+ /*
   * Free the bitmap of a given glyphslot when needed
   * (i.e., only when it was allocated with ft_glyphslot_alloc_bitmap).
   */
Index: src/base/ftobjs.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/base/ftobjs.c,v
retrieving revision 1.215
retrieving revision 1.217
diff -u -p -r1.215 -r1.217
--- freetype2/src/base/ftobjs.c	6 Jun 2005 07:01:47 -0000	1.215
+++ freetype2/src/base/ftobjs.c	23 Jun 2005 20:31:48 -0000	1.217
@@ -251,6 +251,29 @@
 
 
   FT_BASE_DEF( void )
+  ft_glyphslot_grid_fit_metrics( FT_GlyphSlot  slot )
+  {
+    FT_Pos  tmp;
+
+
+    tmp = FT_PIX_CEIL( slot->metrics.horiBearingX + slot->metrics.width );
+    slot->metrics.horiBearingX = FT_PIX_FLOOR( slot->metrics.horiBearingX );
+    slot->metrics.width        = tmp - slot->metrics.horiBearingX;
+
+    tmp = FT_PIX_FLOOR( slot->metrics.horiBearingY - slot->metrics.height );
+    slot->metrics.horiBearingY = FT_PIX_CEIL( slot->metrics.horiBearingY );
+    slot->metrics.height       = slot->metrics.horiBearingY - tmp;
+
+    slot->metrics.horiAdvance  = FT_PIX_ROUND( slot->metrics.horiAdvance );
+
+    slot->metrics.vertBearingX = FT_PIX_FLOOR( slot->metrics.vertBearingX );
+    /* note that vertBearingY should be floor'ed */
+    slot->metrics.vertBearingY = FT_PIX_FLOOR( slot->metrics.vertBearingY );
+    slot->metrics.vertAdvance  = FT_PIX_ROUND( slot->metrics.vertAdvance );
+  }
+
+
+  FT_BASE_DEF( void )
   ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,
                            FT_Byte*      buffer )
   {
Index: src/base/ftoutln.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/base/ftoutln.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -p -r1.62 -r1.63
--- freetype2/src/base/ftoutln.c	25 May 2005 05:51:01 -0000	1.62
+++ freetype2/src/base/ftoutln.c	16 Jun 2005 19:07:08 -0000	1.63
@@ -683,6 +683,7 @@
     if ( !outline )
       return FT_Err_Invalid_Argument;
 
+    strength /= 2;
     if ( strength == 0 )
       return FT_Err_Ok;
 
Index: src/base/ftsynth.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/base/ftsynth.c,v
retrieving revision 1.27
retrieving revision 1.30
diff -u -p -r1.27 -r1.30
--- freetype2/src/base/ftsynth.c	30 May 2005 07:54:20 -0000	1.27
+++ freetype2/src/base/ftsynth.c	23 Jun 2005 20:31:48 -0000	1.30
@@ -81,13 +81,16 @@
 
     /* some reasonable strength */
     xstr = FT_MulFix( face->units_per_EM,
-                      face->size->metrics.y_scale ) / 42;
+                      face->size->metrics.y_scale ) / 24;
     ystr = xstr;
 
     if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
     {
       error = FT_Outline_Embolden( &slot->outline, xstr );
-      xstr = xstr * 4;  /* according to the documentation */
+
+      /* this is more than enough for most glyphs;                         */
+      /* if you need accurate values, you have to call FT_Outline_Get_CBox */
+      xstr = xstr * 2;
       ystr = xstr;
     }
     else if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
@@ -122,8 +125,8 @@
     /* modify the metrics accordingly */
     if ( !error )
     {
+      /* assume the layout is horizontal */
       slot->advance.x += xstr;
-      slot->advance.y += ystr;
 
       slot->metrics.width        += xstr;
       slot->metrics.height       += ystr;
Index: src/cff/cffgload.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/cff/cffgload.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -p -r1.66 -r1.67
--- freetype2/src/cff/cffgload.c	18 Apr 2005 07:13:07 -0000	1.66
+++ freetype2/src/cff/cffgload.c	20 Jun 2005 09:04:50 -0000	1.67
@@ -2510,11 +2510,8 @@
         glyph->root.linearHoriAdvance           = decoder.glyph_width;
         glyph->root.internal->glyph_transformed = 0;
 
-        /* make up vertical metrics */
-        metrics->vertBearingX = 0;
-        metrics->vertBearingY = 0;
+        /* make up vertical ones */
         metrics->vertAdvance  = 0;
-
         glyph->root.linearVertAdvance = 0;
 
         glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
@@ -2559,42 +2556,26 @@
               vec->y = FT_MulFix( vec->y, y_scale );
             }
 
-          FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
-
           /* Then scale the metrics */
           metrics->horiAdvance  = FT_MulFix( metrics->horiAdvance,  x_scale );
           metrics->vertAdvance  = FT_MulFix( metrics->vertAdvance,  y_scale );
-
-          metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale );
-          metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale );
-
-          if ( hinting )
-          {
-            metrics->horiAdvance  = FT_PIX_ROUND( metrics->horiAdvance );
-            metrics->vertAdvance  = FT_PIX_ROUND( metrics->vertAdvance );
-
-            metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
-            metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
-          }
         }
 
         /* compute the other metrics */
         FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
 
-        /* grid fit the bounding box if necessary */
-        if ( hinting )
-        {
-          cbox.xMin &= -64;
-          cbox.yMin &= -64;
-          cbox.xMax  = ( cbox.xMax + 63 ) & -64;
-          cbox.yMax  = ( cbox.yMax + 63 ) & -64;
-        }
-
         metrics->width  = cbox.xMax - cbox.xMin;
         metrics->height = cbox.yMax - cbox.yMin;
 
         metrics->horiBearingX = cbox.xMin;
         metrics->horiBearingY = cbox.yMax;
+
+        /* make up vertical ones */
+        metrics->vertBearingX = 0;
+        metrics->vertBearingY = 0;
+
+        if ( hinting )
+          ft_glyphslot_grid_fit_metrics( &glyph->root );
       }
     }
 
Index: src/cid/cidgload.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/cid/cidgload.c,v
retrieving revision 1.70
retrieving revision 1.72
diff -u -p -r1.70 -r1.72
--- freetype2/src/cid/cidgload.c	6 May 2004 11:48:35 -0000	1.70
+++ freetype2/src/cid/cidgload.c	23 Jun 2005 20:31:48 -0000	1.72
@@ -358,12 +358,10 @@
         cidglyph->linearHoriAdvance           = decoder.builder.advance.x;
         cidglyph->internal->glyph_transformed = 0;
 
-        /* make up vertical metrics */
-        metrics->vertBearingX = 0;
-        metrics->vertBearingY = 0;
+        /* make up vertical ones */
         metrics->vertAdvance  = 0;
-
         cidglyph->linearVertAdvance = 0;
+
         cidglyph->format            = FT_GLYPH_FORMAT_OUTLINE;
 
         if ( size && cidsize->metrics.y_ppem < 24 )
@@ -403,42 +401,26 @@
               vec->y = FT_MulFix( vec->y, y_scale );
             }
 
-          FT_Outline_Get_CBox( &cidglyph->outline, &cbox );
-
           /* Then scale the metrics */
           metrics->horiAdvance  = FT_MulFix( metrics->horiAdvance,  x_scale );
           metrics->vertAdvance  = FT_MulFix( metrics->vertAdvance,  y_scale );
-
-          metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale );
-          metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale );
-
-          if ( hinting )
-          {
-            metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
-            metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
-
-            metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
-            metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
-          }
         }
 
         /* compute the other metrics */
         FT_Outline_Get_CBox( &cidglyph->outline, &cbox );
 
-        /* grid fit the bounding box if necessary */
-        if ( hinting )
-        {
-          cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
-          cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
-          cbox.xMax = FT_PIX_CEIL( cbox.xMax );
-          cbox.yMax = FT_PIX_CEIL( cbox.yMax );
-        }
-
         metrics->width  = cbox.xMax - cbox.xMin;
         metrics->height = cbox.yMax - cbox.yMin;
 
         metrics->horiBearingX = cbox.xMin;
         metrics->horiBearingY = cbox.yMax;
+
+        /* make up vertical ones */
+        metrics->vertBearingX = 0;
+        metrics->vertBearingY = 0;
+
+        if ( hinting )
+          ft_glyphslot_grid_fit_metrics( cidglyph );
       }
     }
 
Index: src/sfnt/ttsbit.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/sfnt/ttsbit.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -p -r1.63 -r1.64
--- freetype2/src/sfnt/ttsbit.c	1 Mar 2005 02:13:50 -0000	1.63
+++ freetype2/src/sfnt/ttsbit.c	16 Jun 2005 19:07:08 -0000	1.64
@@ -1501,7 +1501,7 @@
       /* some heuristic values */
 
       metrics->vertBearingX = (FT_Char)(-metrics->width / 2 );
-      metrics->vertBearingY = (FT_Char)( advance / 10 );
+      metrics->vertBearingY = (FT_Char)( ( advance - metrics->height ) / 2 );
       metrics->vertAdvance  = (FT_Char)( advance * 12 / 10 );
     }
 
Index: src/truetype/ttdriver.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/truetype/ttdriver.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -p -r1.78 -r1.79
--- freetype2/src/truetype/ttdriver.c	1 Mar 2005 02:13:50 -0000	1.78
+++ freetype2/src/truetype/ttdriver.c	26 Jul 2005 08:14:03 -0000	1.79
@@ -167,40 +167,33 @@
                   FT_UInt     horz_resolution,
                   FT_UInt     vert_resolution )
   {
-    TT_Size           size     = (TT_Size)ttsize;
-    FT_Size_Metrics*  metrics  = &size->root.metrics;
-    FT_Size_Metrics*  metrics2 = &size->metrics;
-    TT_Face           face     = (TT_Face)size->root.face;
-    FT_Long           dim_x, dim_y;
+    TT_Size           size    = (TT_Size)ttsize;
+    FT_Size_Metrics*  metrics = &size->metrics;
+    TT_Face           face    = (TT_Face)size->root.face;
 
 
-    *metrics2 = *metrics;
+    /* copy the result from base layer */
+    *metrics = size->root.metrics;
 
     /* This bit flag, when set, indicates that the pixel size must be */
-    /* truncated to an integer.  Nearly all TrueType fonts have this  */
-    /* bit set, as hinting won't work really well otherwise.          */
+    /* rounded to integer.  Nearly all TrueType fonts have this  bit  */
+    /* set, as hinting won't work really well otherwise.              */
     /*                                                                */
     if ( ( face->header.Flags & 8 ) != 0 )
     {
-     /* we need to use rounding in the following computations. Otherwise,
-      * the resulting hinted outlines will be very slightly distorted
-      */
-      dim_x = ( ( char_width  * horz_resolution + (36+32*72) ) / 72 ) & ~63;
-      dim_y = ( ( char_height * vert_resolution + (36+32*72) ) / 72 ) & ~63;
-    }
-    else
-    {
-      dim_x = ( ( char_width  * horz_resolution + 36 ) / 72 );
-      dim_y = ( ( char_height * vert_resolution + 36 ) / 72 );
-    }
+      FT_Long  dim_x, dim_y;
 
-    /* we only modify "metrics2", not "metrics", so these changes have */
-    /* no effect on the result of the auto-hinter when it is used      */
-    /*                                                                 */
-    metrics2->x_ppem  = (FT_UShort)( dim_x >> 6 );
-    metrics2->y_ppem  = (FT_UShort)( dim_y >> 6 );
-    metrics2->x_scale = FT_DivFix( dim_x, face->root.units_per_EM );
-    metrics2->y_scale = FT_DivFix( dim_y, face->root.units_per_EM );
+      dim_x = ( char_width  * horz_resolution + 36 ) / 72;
+      dim_y = ( char_height * vert_resolution + 36 ) / 72;
+
+      dim_x = FT_PIX_ROUND(dim_x);
+      dim_y = FT_PIX_ROUND(dim_y);
+
+      metrics->x_ppem  = (FT_UShort)( dim_x >> 6 );
+      metrics->y_ppem  = (FT_UShort)( dim_y >> 6 );
+      metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM );
+      metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM );
+    }
 
     size->ttmetrics.valid = FALSE;
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
Index: src/truetype/ttgload.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/truetype/ttgload.c,v
retrieving revision 1.138
retrieving revision 1.143
diff -u -p -r1.138 -r1.143
--- freetype2/src/truetype/ttgload.c	6 Apr 2005 14:48:55 -0000	1.138
+++ freetype2/src/truetype/ttgload.c	13 Jul 2005 06:58:13 -0000	1.143
@@ -1707,15 +1707,6 @@
       FT_Outline_Translate( &glyph->outline, -loader->pp1.x, 0 );
 
       FT_Outline_Get_CBox( &glyph->outline, &bbox );
-
-      if ( IS_HINTED( loader->load_flags ) )
-      {
-        /* grid-fit the bounding box */
-        bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
-        bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
-        bbox.xMax = FT_PIX_CEIL( bbox.xMax );
-        bbox.yMax = FT_PIX_CEIL( bbox.yMax );
-      }
     }
     else
       bbox = loader->bbox;
@@ -1744,10 +1735,6 @@
     glyph->metrics.horiBearingY = bbox.yMax;
     glyph->metrics.horiAdvance  = loader->pp2.x - loader->pp1.x;
 
-    /* don't forget to hint the advance when we need to */
-    if ( IS_HINTED( loader->load_flags ) )
-      glyph->metrics.horiAdvance = FT_PIX_ROUND( glyph->metrics.horiAdvance );
-
     /* Now take care of vertical metrics.  In the case where there is    */
     /* no vertical information within the font (relatively common), make */
     /* up some metrics by `hand'...                                      */
@@ -1765,41 +1752,45 @@
       if ( face->vertical_info &&
            face->vertical.number_Of_VMetrics > 0 )
       {
-        advance_height = (FT_UShort)( loader->pp4.y - loader->pp3.y );
-        top_bearing    = (FT_Short)( loader->pp3.y - bbox.yMax );
+        top_bearing = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax,
+                                           y_scale );
+
+        if ( loader->pp3.y <= loader->pp4.y )
+          advance_height = 0;
+        else
+          advance_height = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y,
+                                                 y_scale );
       }
       else
       {
-        /* Make up the distances from the horizontal header.   */
+        FT_Short  max_height, height;
+
+
+        /* XXX Compute top side bearing and advance height in  */
+        /*     Get_VMetrics instead of here.                   */
 
         /* NOTE: The OS/2 values are the only `portable' ones, */
         /*       which is why we use them, if there is an OS/2 */
         /*       table in the font.  Otherwise, we use the     */
         /*       values defined in the horizontal header.      */
-        /*                                                     */
-        /* NOTE2: The sTypoDescender is negative, which is why */
-        /*        we compute the baseline-to-baseline distance */
-        /*        here with:                                   */
-        /*             ascender - descender + linegap          */
-        /*                                                     */
-        /* NOTE3: This is different from what MS's rasterizer  */
-        /*        appears to do when getting default values    */
-        /*        for the vertical phantom points.  We leave   */
-        /*        the old code untouched, but relying on       */
-        /*        phantom points alone might be reasonable     */
-        /*        (i.e., removing the `if' above).             */
+
+        height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin, y_scale );
         if ( face->os2.version != 0xFFFFU )
         {
-          top_bearing    = (FT_Short)( face->os2.sTypoLineGap / 2 );
-          advance_height = (FT_UShort)( face->os2.sTypoAscender -
-                                        face->os2.sTypoDescender +
-                                        face->os2.sTypoLineGap );
+          /* sTypoDescender is negative */
+          max_height     = (FT_Short)(face->os2.sTypoAscender -
+                                      face->os2.sTypoDescender);
+
+          top_bearing    = (FT_Short)( ( max_height - height ) / 2 );
+          advance_height = (FT_UShort)( max_height + face->os2.sTypoLineGap );
         }
         else
         {
-          top_bearing    = (FT_Short)( face->horizontal.Line_Gap / 2 );
-          advance_height = (FT_UShort)( face->horizontal.Ascender  +
-                                        face->horizontal.Descender +
+          max_height = (FT_Short)(face->horizontal.Ascender +
+                                  face->horizontal.Descender);
+
+          top_bearing    = (FT_Short)( ( max_height - height ) / 2 );
+          advance_height = (FT_UShort)( max_height +
                                         face->horizontal.Line_Gap );
         }
       }
@@ -1817,7 +1808,7 @@
 
         metrics.bearing_x = 0;
         metrics.bearing_y = top_bearing;
-        metrics.advance = advance_height;
+        metrics.advance   = advance_height;
         error =
           face->root.internal->incremental_interface->funcs->get_glyph_metrics(
             face->root.internal->incremental_interface->object,
@@ -1834,20 +1825,15 @@
 
 #endif /* FT_CONFIG_OPTION_INCREMENTAL */
 
-      /* We must adjust the top_bearing value from the bounding box given */
-      /* in the glyph header to the bounding box calculated with          */
-      /* FT_Get_Outline_CBox().                                           */
-
       /* scale the metrics */
       if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )
       {
-        top     = FT_MulFix( top_bearing + loader->bbox.yMax, y_scale )
-                    - bbox.yMax;
+        top     = FT_MulFix( top_bearing, y_scale );
         advance = FT_MulFix( advance_height, y_scale );
       }
       else
       {
-        top     = top_bearing + loader->bbox.yMax - bbox.yMax;
+        top     = top_bearing;
         advance = advance_height;
       }
 
@@ -1860,14 +1846,6 @@
       /*                                                               */
       left = ( bbox.xMin - bbox.xMax ) / 2;
 
-      /* grid-fit them if necessary */
-      if ( IS_HINTED( loader->load_flags ) )
-      {
-        left    = FT_PIX_FLOOR( left );
-        top     = FT_PIX_CEIL( top );
-        advance = FT_PIX_ROUND( advance );
-      }
-
       glyph->metrics.vertBearingX = left;
       glyph->metrics.vertBearingY = top;
       glyph->metrics.vertAdvance  = advance;
@@ -1889,6 +1867,9 @@
     /* set glyph dimensions */
     glyph->metrics.width  = bbox.xMax - bbox.xMin;
     glyph->metrics.height = bbox.yMax - bbox.yMin;
+
+    if ( IS_HINTED( loader->load_flags ) )
+      ft_glyphslot_grid_fit_metrics( glyph );
 
     return 0;
   }
Index: src/truetype/ttobjs.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/truetype/ttobjs.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -p -r1.90 -r1.91
--- freetype2/src/truetype/ttobjs.c	1 Mar 2005 02:13:50 -0000	1.90
+++ freetype2/src/truetype/ttobjs.c	31 Jul 2005 11:41:54 -0000	1.91
@@ -121,19 +121,21 @@
     FT_Error  error;
 
 
-    if ( maxPoints > 0 )
-      maxPoints += 2;
-
     FT_MEM_ZERO( zone, sizeof ( *zone ) );
     zone->memory = memory;
 
-    if ( FT_NEW_ARRAY( zone->org,      maxPoints * 2 ) ||
-         FT_NEW_ARRAY( zone->cur,      maxPoints * 2 ) ||
-         FT_NEW_ARRAY( zone->tags,     maxPoints     ) ||
-         FT_NEW_ARRAY( zone->contours, maxContours   ) )
+    if ( FT_NEW_ARRAY( zone->org,      maxPoints   ) ||
+         FT_NEW_ARRAY( zone->cur,      maxPoints   ) ||
+         FT_NEW_ARRAY( zone->tags,     maxPoints   ) ||
+         FT_NEW_ARRAY( zone->contours, maxContours ) )
     {
       tt_glyphzone_done( zone );
     }
+    else
+    {
+      zone->max_points = maxPoints;
+      zone->max_contours = maxContours;
+    }
 
     return error;
   }
@@ -318,6 +320,162 @@
   /*                                                                       */
   /*************************************************************************/
 
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    tt_size_run_fpgm                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Run the font program                                               */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    size :: A handle to the size object.                               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  tt_size_run_fpgm( TT_Size  size )
+  {
+    TT_Face         face = (TT_Face)size->root.face;
+    TT_ExecContext  exec;
+    FT_Error        error;
+
+
+    /* debugging instances have their own context */
+    if ( size->debug )
+      exec = size->context;
+    else
+      exec = TT_New_Context( face );
+
+    if ( !exec )
+      return TT_Err_Could_Not_Find_Context;
+
+    TT_Load_Context( exec, face, size );
+
+    exec->callTop   = 0;
+    exec->top       = 0;
+
+    exec->period    = 64;
+    exec->phase     = 0;
+    exec->threshold = 0;
+
+    exec->instruction_trap = FALSE;
+    exec->F_dot_P = 0x10000L;
+
+    {
+      FT_Size_Metrics*  metrics    = &exec->metrics;
+      TT_Size_Metrics*  tt_metrics = &exec->tt_metrics;
+
+
+      metrics->x_ppem   = 0;
+      metrics->y_ppem   = 0;
+      metrics->x_scale  = 0;
+      metrics->y_scale  = 0;
+
+      tt_metrics->ppem  = 0;
+      tt_metrics->scale = 0;
+      tt_metrics->ratio = 0x10000L;
+    }
+
+    /* allow font program execution */
+    TT_Set_CodeRange( exec,
+                      tt_coderange_font,
+                      face->font_program,
+                      face->font_program_size );
+
+    /* disable CVT and glyph programs coderange */
+    TT_Clear_CodeRange( exec, tt_coderange_cvt );
+    TT_Clear_CodeRange( exec, tt_coderange_glyph );
+
+    if ( face->font_program_size > 0 )
+    {
+      error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
+
+      if ( !error )
+        error = face->interpreter( exec );
+    }
+    else
+      error = TT_Err_Ok;
+
+    if ( !error )
+      TT_Save_Context( exec, size );
+
+    if ( !size->debug )
+      TT_Done_Context( exec );
+
+    return error;
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
+  /*    tt_size_run_prep                                                   */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Run the control value program                                      */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    size :: A handle to the size object.                               */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_LOCAL_DEF( FT_Error )
+  tt_size_run_prep( TT_Size  size )
+  {
+    TT_Face         face = (TT_Face)size->root.face;
+    TT_ExecContext  exec;
+    FT_Error        error;
+
+
+    /* debugging instances have their own context */
+    if ( size->debug )
+      exec = size->context;
+    else
+      exec = TT_New_Context( face );
+
+    if ( !exec )
+      return TT_Err_Could_Not_Find_Context;
+
+    TT_Load_Context( exec, face, size );
+
+    exec->callTop = 0;
+    exec->top     = 0;
+
+    exec->instruction_trap = FALSE;
+
+    TT_Set_CodeRange( exec,
+                      tt_coderange_cvt,
+                      face->cvt_program,
+                      face->cvt_program_size );
+
+    TT_Clear_CodeRange( exec, tt_coderange_glyph );
+
+    if ( face->cvt_program_size > 0 )
+    {
+      error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
+
+      if ( !error && !size->debug )
+        error = face->interpreter( exec );
+    }
+    else
+      error = TT_Err_Ok;
+
+    /* save as default graphics state */
+    size->GS = exec->GS;
+
+    TT_Save_Context( exec, size );
+
+    if ( !size->debug )
+      TT_Done_Context( exec );
+
+    return error;
+  }
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+
 
   /*************************************************************************/
   /*                                                                       */
@@ -338,15 +496,11 @@
   {
     TT_Size   size  = (TT_Size)ttsize;
     FT_Error  error = TT_Err_Ok;
-
-
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
     TT_Face    face   = (TT_Face)size->root.face;
     FT_Memory  memory = face->root.memory;
     FT_Int     i;
 
-    TT_ExecContext  exec;
     FT_UShort       n_twilight;
     TT_MaxProfile*  maxp = &face->max_profile;
 
@@ -387,17 +541,30 @@
          FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) ||
          FT_NEW_ARRAY( size->cvt,              size->cvt_size             ) ||
          FT_NEW_ARRAY( size->storage,          size->storage_size         ) )
+    {
+      tt_size_done( ttsize );
 
-      goto Fail_Memory;
+      return error;
+    }
 
     /* reserve twilight zone */
     n_twilight = maxp->maxTwilightPoints;
+
+    /* there are 4 phantom points (do we need this?) */
+    n_twilight += 4;
+
     error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight );
     if ( error )
-      goto Fail_Memory;
+    {
+      tt_size_done( ttsize );
+
+      return error;
+    }
 
     size->twilight.n_points = n_twilight;
 
+    size->GS = tt_default_graphics_state;
+
     /* set `face->interpreter' according to the debug hook present */
     {
       FT_Library  library = face->root.driver->root.library;
@@ -409,95 +576,17 @@
         face->interpreter = (TT_Interpreter)TT_RunIns;
     }
 
-    /* Fine, now execute the font program! */
-    exec = size->context;
-    /* size objects used during debugging have their own context */
-    if ( !size->debug )
-      exec = TT_New_Context( face );
-
-    if ( !exec )
-    {
-      error = TT_Err_Could_Not_Find_Context;
-      goto Fail_Memory;
-    }
-
-    size->GS = tt_default_graphics_state;
-    TT_Load_Context( exec, face, size );
-
-    exec->callTop   = 0;
-    exec->top       = 0;
-
-    exec->period    = 64;
-    exec->phase     = 0;
-    exec->threshold = 0;
-
-    {
-      FT_Size_Metrics*  metrics    = &exec->metrics;
-      TT_Size_Metrics*  tt_metrics = &exec->tt_metrics;
-
-
-      metrics->x_ppem   = 0;
-      metrics->y_ppem   = 0;
-      metrics->x_scale  = 0;
-      metrics->y_scale  = 0;
-
-      tt_metrics->ppem  = 0;
-      tt_metrics->scale = 0;
-      tt_metrics->ratio = 0x10000L;
-    }
+    /* Fine, now run the font program! */
+    error = tt_size_run_fpgm( size );
 
-    exec->instruction_trap = FALSE;
-
-    exec->cvtSize = size->cvt_size;
-    exec->cvt     = size->cvt;
-
-    exec->F_dot_P = 0x10000L;
-
-    /* allow font program execution */
-    TT_Set_CodeRange( exec,
-                      tt_coderange_font,
-                      face->font_program,
-                      face->font_program_size );
-
-    /* disable CVT and glyph programs coderange */
-    TT_Clear_CodeRange( exec, tt_coderange_cvt );
-    TT_Clear_CodeRange( exec, tt_coderange_glyph );
-
-    if ( face->font_program_size > 0 )
-    {
-      error = TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
-      if ( !error )
-        error = face->interpreter( exec );
-
-      if ( error )
-        goto Fail_Exec;
-    }
-    else
-      error = TT_Err_Ok;
-
-    TT_Save_Context( exec, size );
-
-    if ( !size->debug )
-      TT_Done_Context( exec );
+    if ( error )
+      tt_size_done( ttsize );
 
 #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
 
     size->ttmetrics.valid = FALSE;
-    return error;
-
-#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-  Fail_Exec:
-    if ( !size->debug )
-      TT_Done_Context( exec );
-
-  Fail_Memory:
 
-    tt_size_done( ttsize );
     return error;
-
-#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
-
   }
 
 
@@ -516,9 +605,7 @@
   tt_size_done( FT_Size  ttsize )           /* TT_Size */
   {
     TT_Size    size = (TT_Size)ttsize;
-
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
     FT_Memory  memory = size->root.face->memory;
 
 
@@ -625,10 +712,8 @@
 #endif
 
 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
     {
-      TT_ExecContext  exec;
-      FT_UInt         i, j;
+      FT_UInt  i;
 
 
       /* Scale the cvt values to the new ppem.          */
@@ -637,12 +722,12 @@
         size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );
 
       /* All twilight points are originally zero */
-      for ( j = 0; j < (FT_UInt)size->twilight.n_points; j++ )
+      for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ )
       {
-        size->twilight.org[j].x = 0;
-        size->twilight.org[j].y = 0;
-        size->twilight.cur[j].x = 0;
-        size->twilight.cur[j].y = 0;
+        size->twilight.org[i].x = 0;
+        size->twilight.org[i].y = 0;
+        size->twilight.cur[i].x = 0;
+        size->twilight.cur[i].y = 0;
       }
 
       /* clear storage area */
@@ -651,53 +736,8 @@
 
       size->GS = tt_default_graphics_state;
 
-      /* get execution context and run prep program */
-      if ( size->debug )
-        exec = size->context;
-      else
-        exec = TT_New_Context( face );
-      /* debugging instances have their own context */
-
-      if ( !exec )
-        return TT_Err_Could_Not_Find_Context;
-
-      TT_Load_Context( exec, face, size );
-
-      TT_Set_CodeRange( exec,
-                        tt_coderange_cvt,
-                        face->cvt_program,
-                        face->cvt_program_size );
-
-      TT_Clear_CodeRange( exec, tt_coderange_glyph );
-
-      exec->instruction_trap = FALSE;
-
-      exec->top     = 0;
-      exec->callTop = 0;
-
-      if ( face->cvt_program_size > 0 )
-      {
-        error = TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
-        if ( error )
-          goto End;
-
-        if ( !size->debug )
-          error = face->interpreter( exec );
-      }
-      else
-        error = TT_Err_Ok;
-
-      size->GS = exec->GS;
-      /* save default graphics state */
-
-    End:
-      TT_Save_Context( exec, size );
-
-      if ( !size->debug )
-        TT_Done_Context( exec );
-      /* debugging instances keep their context */
+      error = tt_size_run_prep( size );
     }
-
 #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
 
     if ( !error )
Index: src/truetype/ttobjs.h
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/truetype/ttobjs.h,v
retrieving revision 1.36
retrieving revision 1.38
diff -u -p -r1.36 -r1.38
--- freetype2/src/truetype/ttobjs.h	4 May 2004 16:53:45 -0000	1.36
+++ freetype2/src/truetype/ttobjs.h	31 Jul 2005 11:41:54 -0000	1.38
@@ -316,7 +316,10 @@ FT_BEGIN_HEADER
   {
     FT_SizeRec         root;
 
-    FT_Size_Metrics    metrics; /* slightly different from the root metrics */
+    /* we have our own copy of metrics so that we can modify */
+    /* it without affecting auto-hinting (when used)         */
+    FT_Size_Metrics    metrics;
+
     TT_Size_Metrics    ttmetrics;
 
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
@@ -413,6 +416,14 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( void )
   tt_size_done( FT_Size  ttsize );          /* TT_Size */
+
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+  FT_LOCAL( FT_Error )
+  tt_size_run_fpgm( TT_Size  size );
+
+  FT_LOCAL( FT_Error )
+  tt_size_run_prep( TT_Size  size );
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
 
   FT_LOCAL( FT_Error )
   tt_size_reset( TT_Size  size );
Index: src/type1/t1gload.c
===================================================================
RCS file: /cvsroot/freetype/freetype2/src/type1/t1gload.c,v
retrieving revision 1.85
retrieving revision 1.87
diff -u -p -r1.85 -r1.87
--- freetype2/src/type1/t1gload.c	13 May 2004 12:59:59 -0000	1.85
+++ freetype2/src/type1/t1gload.c	23 Jun 2005 20:31:48 -0000	1.87
@@ -315,11 +315,7 @@
         glyph->root.linearHoriAdvance           = decoder.builder.advance.x;
         glyph->root.internal->glyph_transformed = 0;
 
-        /* make up vertical metrics */
-        metrics->vertBearingX = 0;
-        metrics->vertBearingY = 0;
-        metrics->vertAdvance  = 0;
-
+        metrics->vertAdvance          = 0;
         glyph->root.linearVertAdvance = 0;
 
         glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
@@ -363,42 +359,26 @@
               vec->y = FT_MulFix( vec->y, y_scale );
             }
 
-          FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
-
           /* Then scale the metrics */
           metrics->horiAdvance  = FT_MulFix( metrics->horiAdvance,  x_scale );
           metrics->vertAdvance  = FT_MulFix( metrics->vertAdvance,  y_scale );
-
-          metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale );
-          metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale );
-
-          if ( hinting )
-          {
-            metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );
-            metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );
-
-            metrics->vertBearingX = FT_PIX_ROUND( metrics->vertBearingX );
-            metrics->vertBearingY = FT_PIX_ROUND( metrics->vertBearingY );
-          }
         }
 
         /* compute the other metrics */
         FT_Outline_Get_CBox( &glyph->root.outline, &cbox );
 
-        /* grid fit the bounding box if necessary */
-        if ( hinting )
-        {
-          cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
-          cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
-          cbox.xMax = FT_PIX_CEIL( cbox.xMax );
-          cbox.yMax = FT_PIX_CEIL( cbox.yMax );
-        }
-
         metrics->width  = cbox.xMax - cbox.xMin;
         metrics->height = cbox.yMax - cbox.yMin;
 
         metrics->horiBearingX = cbox.xMin;
         metrics->horiBearingY = cbox.yMax;
+
+        /* make up vertical ones */
+        metrics->vertBearingX = 0;
+        metrics->vertBearingY = 0;
+
+        if ( hinting )
+          ft_glyphslot_grid_fit_metrics( &glyph->root );
       }
 
       /* Set control data to the glyph charstrings.  Note that this is */

代码: 全选

$patch -pl < ./freetype-2.1.10-cvsfixes.patch

freetype-2.1.10-xorgfix.patch

代码: 全选

--- freetype-2.1.10/src/sfnt/sfdriver.c.xorgfix	2005-08-03 19:10:58.867654076 +0200
+++ freetype-2.1.10/src/sfnt/sfdriver.c	2005-08-03 19:11:43.083188865 +0200
@@ -367,8 +367,13 @@
     /* see `ttsbit.h' and `sfnt.h' */
     tt_face_set_sbit_strike,
     tt_face_load_sbit_strikes,
+#ifdef FT_OPTIMIZE_MEMORY
     0 /* tt_find_sbit_image */,
     0 /* tt_load_sbit_metrics */,
+#else
+    tt_find_sbit_image,
+    tt_load_sbit_metrics,
+#endif
     tt_face_load_sbit_image,
     tt_face_free_sbit_strikes,
 

代码: 全选

$patch -pl < ./freetype-2.1.10-cvsfixes.patch

代码: 全选

$./configure --prefix=/usr
$make
$sudo make install
下载 libXft
http://xlibs.freedesktop.org/release/?C=N;O=D


解压libXft源代码

代码: 全选

$cd libXft-2.1.7
$./configure --prefix=/usr
$make
$sudo make install
下载 libcairo
http://archive.ubuntulinux.jp/ubuntu-ja ... 1_i386.deb

代码: 全选

$sudo dpkg -i libcairo2_1.0.0-1ubuntu1ja1_i386.deb
修改/etc/fonts/local.conf 为:(来自http://www.linuxsir.org/bbs/showthread. ... ge=1&pp=15

代码: 全选

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- conf.d/myfont.conf -->
<fontconfig>
 <dir>/usr/share/fonts</dir>
 <dir>/usr/share/fonts/local</dir>
 <dir>/usr/local/share/fonts</dir>
 <dir>~/.fonts</dir>
<!--加入点阵字体路径-->
<dir>/usr/X11R6/lib/X11/fonts</dir>

<!--  
配置粗体中文显示,要配合freetype-2.1.10,libxft-2.1.7,fontconfig-2.3.X
  -->

     <match target="font">
         <!-- check to see if the font is just regular -->
         <test name="weight" compare="less_eq">
             <int>100</int>
         </test>
         <!-- check to see if the pattern requests bold -->
         <test target="pattern" name="weight" compare="more_eq">
             <int>180</int>
         </test>
         <!-- set the embolden flag -->
         <edit name="embolden" mode="assign">
             <bool>true</bool>
         </edit>
     </match> 

<!--
	default settings for all fonts.
-->
<match target="font" >
<!-- 打开字体的反锯齿即AA,大号字用AA会更美观   -->
		<edit mode="assign" name="antialias" >
			<bool>t</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintslight</const>
		</edit>
<!-- 打开hint  -->
		<edit mode="assign" name="hint" >
			<bool>t</bool>
		</edit>
<!-- 关闭autohint  -->
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
</match>


<!-- 关闭 8到17号字体的AA -->
 <match target="font" >
                <!--
                <test compare="contains" name="lang" >
                        <string>zh-cn</string>
                        <string>zh-tw</string>
                        <string>ja</string>
                        <string>ko</string>
                </test>
                -->
                <test compare="more_eq" name="pixelsize" qual="any" >
                        <double>8</double>
                </test>
                <test compare="less_eq" name="pixelsize" qual="any" >
                        <double>17</double>
                </test>
                <edit mode="assign" name="antialias" >
                        <bool>false</bool>
                </edit>
</match>

<!-- 解决英文字体间距过宽 -->
<match target="font"> 

                <test target="pattern" name="lang" compare="contains"> 
                        <string>zh-tw</string> 
                        <string>zh-cn</string> 
                        <string>ja</string> 
                        <string>ko</string> 
                </test> 
                <edit name="spacing"> 
                        <const>proportional</const> 
                </edit> 
                <edit name="globaladvance"> 
                <bool>false</bool> 
                </edit> 
</match>

<!--
 设定中文最小字号,使得小字的中文美观
-->
  <match target="font" >
	<test name="family" qual="any" >
		<string>SimSun</string>
		<string>NSimSun</string>
		<string>SimHei</string>
		<string>AR PL ShanHeiSun Uni</string>
		<string>AR PL SenKai Uni</string>
		<string>AR PL New Sung</string>
		<string>FZSongTi</string>
	 	<string>FZMingTiB</string>
		<string>FangSong_GB2312</string>
		<string>KaiTi_GB2312</string>
	</test>
	<test compare="more_eq" name="pixelsize" >
		<int>8</int>
	</test>
	<test compare="less_eq" name="pixelsize" >
		<int>12</int>
	</test>
	<edit compare="eq" name="pixelsize" >
		<int>12</int>
	</edit>
 </match>
<!--
  把serif ,sans,monospace的family(字体族)重新排序,适应中文用户的用字习惯
-->
   <alias>
      <family>serif</family>
      <prefer>
         <family>Times New Roman</family>
         <family>Nimbus Roman No9 L</family>
         <family>Luxi Serif</family>
         <family>Times</family>
	 <family>Bitstream Vera Serif</family>
         <family>Simsun</family>
         <family>WenQuanYi Bitmap Song</family>
	 <family>AR PL ShanHeiSun Uni</family>
	 <family>AR PL SenKai Uni</family>
         <family>AR PL New Sung</family>
	 <family>FZSongTi</family>
	 <family>FZMingTiB</family>
         <family>Kochi Mincho</family>
         <family>AR PL SungtiL GB</family>
         <family>AR PL Mingti2L Big5</family>
         <family>Baekmuk Batang</family>
      </prefer>
   </alias>
   <alias>
      <family>sans-serif</family>
      <prefer>
	 <family>Helvetica</family>
	 <family>Verdana</family>
	 <family>Arial</family>
	 <family>Tahoma</family>
	 <family>Bitstream Vera Sans</family>
         <family>SimSun</family>
         <family>WenQuanYi Bitmap Song</family>
	 <family>AR PL ShanHeiSun Uni</family>
	 <family>AR PL SenKai Uni</family>
         <family>AR PL New Sung</family>
	 <family>FZSongTi</family>
	 <family>FZMingTiB</family>
         <family>Kochi Gothic</family>
         <family>AR PL KaitiM GB</family>
         <family>AR PL KaitiM Big5</family>
         <family>Baekmuk Dotum</family>

      </prefer>
   </alias>
   <alias>
      <family>monospace</family>
      <prefer>
	 <family>Courier</family>
	 <family>Courier New</family>
         <family>Andale Mono</family>
         <family>Luxi Mono</family>
         <family>Nimbus Mono L</family>
	 <family>Bitstream Vera Sans Mono</family>
	 <family>NSimSun</family> <!-- han (zh-cn,zh-tw) -->
         <family>WenQuanYi Bitmap Song</family>
	 <family>AR PL ShanHeiSun Uni</family>
	 <family>AR PL SenKai Uni</family>
         <family>AR PL New Sung</family>
	 <family>FZSongTi</family>
	 <family>FZMingTiB</family>
         <family>Kochi Gothic</family>
         <family>AR PL KaitiM GB</family>
         <family>Baekmuk Dotum</family>
      </prefer>
   </alias>

</fontconfig>
如果没什么意外就可以相当好的显示粗体了。

发表于 : 2005-10-05 11:00
eexpress
我觉得一个系统中的字体都这么麻烦,影响大家用lin的第一印象。kde的唯一有好感的地方,就是觉得字体这部分不要想什么。

发表于 : 2005-10-05 16:02
gxcooo
麻烦啊
还是用下面的办法吧
viewtopic.php?t=513

发表于 : 2005-10-09 13:18
Uranus
看的头晕晕的,等看正式版推出能不能解决粗体问题 :?

发表于 : 2005-11-04 17:20
laxi
楼主能不能直接放出打了patch的deb包啊?

发表于 : 2005-11-04 19:18
freecode
我是amd64位的,最后的deb文件有没有for64的

发表于 : 2005-11-05 18:53
wall_john
good!确实可以实现粗体,已测试过。
[quot]
下载 libcairo
http://archive.ubuntulinux.jp/ubuntu-ja ... 1_i386.deb
[/quot]
这个干脆也从新编译

mkdir cairo-ja
cd cairo-ja
wget http://archive.ubuntulinux.jp/ubuntu-ja ... rig.tar.gz
wget http://archive.ubuntulinux.jp/ubuntu-ja ... a2.diff.gz
wget http://archive.ubuntulinux.jp/ubuntu-ja ... tu1ja2.dsc
dpkg-source -x libcairo_1.0.2-0ubuntu1ja2.dsc
cd libcairo-1.0.2/
dpkg-buildpackage -rfakeroot -uc -b
cd ..
sudo dpkg -i libcairo2_1.0.2-0ubuntu1ja2_i386.deb
sudo dpkg -i libcairo2-dev_1.0.2-0ubuntu1ja2_i386.deb

发表于 : 2005-11-05 20:50
bluebell
我终于也搞出粗体了。

发表于 : 2005-11-07 22:36
xufan106
wall_john 写了:good!确实可以实现粗体,已测试过。
[quot]
下载 libcairo
http://archive.ubuntulinux.jp/ubuntu-ja ... 1_i386.deb
[/quot]
这个干脆也从新编译

mkdir cairo-ja
cd cairo-ja
wget http://archive.ubuntulinux.jp/ubuntu-ja ... rig.tar.gz
wget http://archive.ubuntulinux.jp/ubuntu-ja ... a2.diff.gz
wget http://archive.ubuntulinux.jp/ubuntu-ja ... tu1ja2.dsc
dpkg-source -x libcairo_1.0.2-0ubuntu1ja2.dsc
cd libcairo-1.0.2/
dpkg-buildpackage -rfakeroot -uc -b
cd ..
sudo dpkg -i libcairo2_1.0.2-0ubuntu1ja2_i386.deb
sudo dpkg -i libcairo2-dev_1.0.2-0ubuntu1ja2_i386.deb
嗯。重新编译是个好主意

发表于 : 2005-11-07 23:00
eexpress
没理解。我的breezy一直有啊。按照主页的简单几下就有。几乎没有设置。

发表于 : 2005-11-08 9:01
laxi
eexpress 写了:没理解。我的breezy一直有啊。按照主页的简单几下就有。几乎没有设置。
兄弟说说怎么设置的?简单几下是哪几下啊?用了哪些包或者源?

发表于 : 2005-11-08 13:09
xufan106
eexpress 写了:没理解。我的breezy一直有啊。按照主页的简单几下就有。几乎没有设置。
大概是用圆体代替的。。看看比较大的字体是不是粗体就知道了

发表于 : 2005-11-08 18:52
xufan106
今天花了一天的时间把freetype 打包了。。ubuntu5.10 可以安装附件的三个包就可以实现粗。斜体了

其中freetype是按照上面的方法打补丁后编译打包的。还加了最新的补丁
libcairo是从
http://archive.ubuntulinux.jp/ubuntu-ja/breezy-ja/
下载的
libxft是自己下载ubuntu5.10的source包编译打包的

libxft可以用回原来的。但在kde下可能不能显示粗体

发表于 : 2005-11-09 1:13
xufan106
今晚重新编译了所有的包。
放到一起一个附件里面

发表于 : 2005-11-10 0:29
yongyi
谢谢分享!