shithub: freetype+ttf2subf

Download patch

ref: a3e842f9c69a3ce3bcde0ab7b0cfbeead10ed80f
parent: 0a33b44e6eb31b7c5bfed32cf723a0eee1e4e169
author: Werner Lemberg <[email protected]>
date: Wed Aug 22 05:55:38 EDT 2018

Minor formatting and documentation fixes.

git/fs: mount .git/fs: mount/attach disallowed
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -407,11 +407,10 @@
    *   It also embeds a memory manager (see @FT_Memory), as well as a
    *   scan-line converter object (see @FT_Raster).
    *
-   *   In multi-threaded applications it is easiest to use one
-   *   `FT_Library' object per thread.  In case this is too cumbersome,
-   *   a single `FT_Library' object across threads is possible also
-   *   (since FreeType version 2.5.6), as long as a mutex lock is used
-   *   around @FT_New_Face and @FT_Done_Face.
+   *   [Since 2.5.6] In multi-threaded applications it is easiest to use one
+   *   `FT_Library' object per thread.  In case this is too cumbersome, a
+   *   single `FT_Library' object across threads is possible also, as long
+   *   as a mutex lock is used around @FT_New_Face and @FT_Done_Face.
    *
    * @note:
    *   Library objects are normally created by @FT_Init_FreeType, and
@@ -1775,8 +1774,8 @@
    *     using its `next' field.
    *
    *   glyph_index ::
-   *     The glyph index passed as an argument to @FT_Load_Glyph while
-   *     initializing the glyph slot (since FreeType version 2.10).
+   *     [Since 2.10] The glyph index passed as an argument to
+   *     @FT_Load_Glyph while initializing the glyph slot.
    *
    *   generic ::
    *     A typeless pointer unused by the FreeType
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -378,7 +378,7 @@
    *   FT_OUTLINE_XXX
    *
    * @description:
-   *   A list of bit-field constants use for the flags in an outline's
+   *   A list of bit-field constants used for the flags in an outline's
    *   `flags' field.
    *
    * @values:
@@ -468,20 +468,25 @@
 
   /* */
 
-#define FT_CURVE_TAG( flag )  ( flag & 3 )
+#define FT_CURVE_TAG( flag )  ( flag & 0x03 )
 
-#define FT_CURVE_TAG_ON            1
-#define FT_CURVE_TAG_CONIC         0
-#define FT_CURVE_TAG_CUBIC         2
+  /* see the `tags' field in `FT_Outline' for a description of the values */
+#define FT_CURVE_TAG_ON            0x01
+#define FT_CURVE_TAG_CONIC         0x00
+#define FT_CURVE_TAG_CUBIC         0x02
 
-#define FT_CURVE_TAG_HAS_SCANMODE  4
+#define FT_CURVE_TAG_HAS_SCANMODE  0x04
 
-#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */
-#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */
+#define FT_CURVE_TAG_TOUCH_X       0x08  /* reserved for TrueType hinter */
+#define FT_CURVE_TAG_TOUCH_Y       0x10  /* reserved for TrueType hinter */
 
 #define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \
                                      FT_CURVE_TAG_TOUCH_Y )
+  /* values 0x20, 0x40, and 0x80 are reserved */
 
+
+  /* these constants are deprecated; use the corresponding */
+  /* `FT_CURVE_TAG_XXX' values instead                     */
 #define FT_Curve_Tag_On       FT_CURVE_TAG_ON
 #define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC
 #define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -852,7 +852,7 @@
         /* only the new Adobe engine (for both CFF and Type 1) is `light'; */
         /* we use `strstr' to catch both `Type 1' and `CID Type 1'         */
         is_light_type1 =
-          ft_strstr( FT_Get_Font_Format( face ), "Type 1" ) != NULL   &&
+          ft_strstr( FT_Get_Font_Format( face ), "Type 1" ) != NULL &&
           ((PS_Driver)driver)->hinting_engine == FT_HINTING_ADOBE;
 
         /* the check for `num_locations' assures that we actually    */
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -264,13 +264,17 @@
       /* Render 3 separate monochrome bitmaps, shifting the outline.  */
       width /= 3;
 
-      FT_Outline_Translate( outline,           -sub[0].x,           -sub[0].y );
+      FT_Outline_Translate( outline,
+                            -sub[0].x,
+                            -sub[0].y );
       error = render->raster_render( render->raster, &params );
       if ( error )
         goto Exit;
 
       bitmap->buffer += width;
-      FT_Outline_Translate( outline, sub[0].x - sub[1].x, sub[0].y - sub[1].y );
+      FT_Outline_Translate( outline,
+                            sub[0].x - sub[1].x,
+                            sub[0].y - sub[1].y );
       error = render->raster_render( render->raster, &params );
       bitmap->buffer -= width;
       if ( error )
@@ -277,14 +281,16 @@
         goto Exit;
 
       bitmap->buffer += 2 * width;
-      FT_Outline_Translate( outline, sub[1].x - sub[2].x, sub[1].y - sub[2].y );
+      FT_Outline_Translate( outline,
+                            sub[1].x - sub[2].x,
+                            sub[1].y - sub[2].y );
       error = render->raster_render( render->raster, &params );
       bitmap->buffer -= 2 * width;
       if ( error )
         goto Exit;
 
-      x_shift        -= sub[2].x;
-      y_shift        -= sub[2].y;
+      x_shift -= sub[2].x;
+      y_shift -= sub[2].y;
 
       /* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD.    */
       /* XXX: It is more efficient to render every third byte above. */
@@ -319,13 +325,17 @@
       bitmap->pitch *= 3;
       bitmap->rows  /= 3;
 
-      FT_Outline_Translate( outline,           -sub[0].y, sub[0].x            );
+      FT_Outline_Translate( outline,
+                            -sub[0].y,
+                            sub[0].x );
       error = render->raster_render( render->raster, &params );
       if ( error )
         goto Exit;
 
       bitmap->buffer += pitch;
-      FT_Outline_Translate( outline, sub[0].y - sub[1].y, sub[1].x - sub[0].x );
+      FT_Outline_Translate( outline,
+                            sub[0].y - sub[1].y,
+                            sub[1].x - sub[0].x );
       error = render->raster_render( render->raster, &params );
       bitmap->buffer -= pitch;
       if ( error )
@@ -332,14 +342,16 @@
         goto Exit;
 
       bitmap->buffer += 2 * pitch;
-      FT_Outline_Translate( outline, sub[1].y - sub[2].y, sub[2].x - sub[1].x );
+      FT_Outline_Translate( outline,
+                            sub[1].y - sub[2].y,
+                            sub[2].x - sub[1].x );
       error = render->raster_render( render->raster, &params );
       bitmap->buffer -= 2 * pitch;
       if ( error )
         goto Exit;
 
-      x_shift        -= sub[2].y;
-      y_shift        += sub[2].x;
+      x_shift -= sub[2].y;
+      y_shift += sub[2].x;
 
       bitmap->pitch /= 3;
       bitmap->rows  *= 3;