shithub: freetype+ttf2subf

Download patch

ref: 0270c36c38d885c1fbc93a9dc4086ea0a2e65b4f
parent: fd97d137e0eb0992ca8145edf21d852548573f92
author: Werner Lemberg <[email protected]>
date: Mon Jun 17 04:01:32 EDT 2002

Install freetype2.m4.

* builds/unix/install.mk (install, uninstall): Handle it.

Fix glyph indices for PFR driver.

* src/pfr/pfrcmap.c (pfr_cmap_char_index, pfr_cmap_char_next):
Increase return value by 1.
* src/pfr/pfrobjs.c (pfr_slot_load): Decrease index by 1.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,18 @@
-2002-06-14  Detlef W�rkner  <[email protected]>
+2002-06-16  Anthony Fok  <[email protected]>
+
+	Install freetype2.m4.
+
+	* builds/unix/install.mk (install, uninstall): Handle it.
+
+2002-06-16  Detlef W�rkner  <[email protected]>
+
+	Same fix for PFR driver.
+
+	* src/pfr/pfrcmap.c (pfr_cmap_char_index, pfr_cmap_char_next):
+	Increase return value by 1.
+	* src/pfr/pfrobjs.c (pfr_slot_load): Decrease index by 1.
+
+2002-06-15  Detlef W�rkner  <[email protected]>
 
 	Fix glyph indices to make index zero always the undefined glyph.
 
--- a/builds/unix/install.mk
+++ b/builds/unix/install.mk
@@ -3,7 +3,7 @@
 #
 
 
-# Copyright 1996-2000 by
+# Copyright 1996-2000, 2002 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -21,7 +21,8 @@
                          $(includedir)/freetype2/freetype/config   \
                          $(includedir)/freetype2/freetype/internal \
                          $(includedir)/freetype2/freetype/cache    \
-                         $(bindir)
+                         $(bindir)                                 \
+                         $(prefix)/share/aclocal
 	$(LIBTOOL) --mode=install $(INSTALL) $(PROJECT_LIBRARY) $(libdir)
 	-for P in $(PUBLIC_H) ; do                               \
           $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype ; \
@@ -38,6 +39,8 @@
 	$(INSTALL_DATA) $(BUILD)/ft2unix.h $(includedir)/ft2build.h
 	$(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \
           $(bindir)/freetype-config
+	$(INSTALL_SCRIPT) -m 644 $(BUILD)/freetype2.m4 \
+          $(prefix)/share/aclocal/freetype2.m4
 
 
 uninstall:
@@ -53,6 +56,7 @@
 	-$(DELDIR) $(includedir)/freetype2
 	-$(DELETE) $(includedir)/ft2build.h
 	-$(DELETE) $(bindir)/freetype-config
+	-$(DELETE) $(prefix)/share/aclocal/freetype2.m4
 
 
 check:
--- a/src/pfr/pfrcmap.c
+++ b/src/pfr/pfrcmap.c
@@ -71,7 +71,7 @@
       gchar = cmap->chars + mid;
 
       if ( gchar->char_code == char_code )
-        return mid;
+        return mid + 1;
 
       if ( gchar->char_code < char_code )
         min = mid + 1;
@@ -107,7 +107,10 @@
         {
           result = mid;
           if ( result != 0 )
+          {
+            result++;
             goto Exit;
+          }
 
           char_code++;
           goto Restart;
@@ -127,7 +130,10 @@
         gchar  = cmap->chars + min;
         result = min;
         if ( result != 0 )
+        {
+          result++;
           char_code = gchar->char_code;
+        }
       }
     }
 
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -217,14 +217,17 @@
   {
     FT_Error     error;
     PFR_Face     face    = (PFR_Face)slot->root.face;
-    PFR_Char     gchar   = face->phy_font.chars + gindex;
+    PFR_Char     gchar;
     FT_Outline*  outline = &slot->root.outline;
     FT_ULong     gps_offset;
 
+    if (gindex > 0)
+      gindex--;
 
     /* check that the glyph index is correct */
     FT_ASSERT( gindex < face->phy_font.num_chars );
 
+    gchar               = face->phy_font.chars + gindex;
     slot->root.format   = ft_glyph_format_outline;
     outline->n_points   = 0;
     outline->n_contours = 0;