freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Re: [FT2] maxp for CFF/.otf (OpenType with PS outlines)


From: Werner LEMBERG
Subject: [Devel] Re: [FT2] maxp for CFF/.otf (OpenType with PS outlines)
Date: Fri, 13 Jul 2001 09:50:21 +0200 (CEST)

From: Antoine Leca <address@hidden>
Subject: [FT2] maxp for CFF/.otf (OpenType with PS outlines)
Date: Fri, 03 Mar 2000 11:25:53 +0100
           ^^^^^^^^^^^ :-)

> A recent discussion on the OpenType list showed me that the `maxp' table
> has a different format (version 0.5 ...)
>
> A quick look to sfnt/ttload.c showed me that this does not appear to be
> handled in the present sources.

Here a patch (using the -uwbB flag to make it more readable) to do
that.  Please comment.


    Werner


======================================================================

--- ttload.c.old        Wed Jul 11 11:31:55 2001
+++ ttload.c    Wed Jul 11 11:56:15 2001
@@ -566,9 +566,15 @@
 #undef  FT_STRUCTURE
 #define FT_STRUCTURE  TT_MaxProfile
 
-      FT_FRAME_START( 32 ),
-        FT_FRAME_ULONG ( version ),
+      FT_FRAME_START( 6 ),
+        FT_FRAME_LONG  ( version ),
         FT_FRAME_USHORT( numGlyphs ),
+      FT_FRAME_END
+    };
+
+    const FT_Frame_Field  maxp_fields_extra[] =
+    {
+      FT_FRAME_START( 26 ),
         FT_FRAME_USHORT( maxPoints ),
         FT_FRAME_USHORT( maxContours ),
         FT_FRAME_USHORT( maxCompositePoints ),
@@ -582,7 +588,8 @@
         FT_FRAME_USHORT( maxSizeOfInstructions ),
         FT_FRAME_USHORT( maxComponentElements ),
         FT_FRAME_USHORT( maxComponentDepth ),
-      FT_FRAME_END };
+      FT_FRAME_END
+    };
 
 
     FT_TRACE2(( "Load_TT_MaxProfile: %08p\n", face ));
@@ -594,6 +601,25 @@
     if ( READ_Fields( maxp_fields, maxProfile ) )
       goto Exit;
 
+    maxProfile->maxPoints             = 0;
+    maxProfile->maxContours           = 0;
+    maxProfile->maxCompositePoints    = 0;
+    maxProfile->maxCompositeContours  = 0;
+    maxProfile->maxZones              = 0;
+    maxProfile->maxTwilightPoints     = 0;
+    maxProfile->maxStorage            = 0;
+    maxProfile->maxFunctionDefs       = 0;
+    maxProfile->maxInstructionDefs    = 0;
+    maxProfile->maxStackElements      = 0;
+    maxProfile->maxSizeOfInstructions = 0;
+    maxProfile->maxComponentElements  = 0;
+    maxProfile->maxComponentDepth     = 0;
+
+    if ( maxProfile->version >= 0x10000L )
+    {
+      if ( READ_Fields( maxp_fields_extra, maxProfile ) )
+        goto Exit;
+
     /* XXX: an adjustment that is necessary to load certain */
     /*      broken fonts like `Keystrokes MT' :-(           */
     /*                                                      */
@@ -625,6 +651,7 @@
     /* some broken fonts.                                             */
     face->root.internal->max_points   += 8;
     face->root.internal->max_contours += 4;
+    }
 
     FT_TRACE2(( "MAXP loaded.\n" ));
 
@@ -1304,6 +1331,11 @@
 
     os2->ulCodePageRange1 = 0;
     os2->ulCodePageRange2 = 0;
+    os2->sxHeight         = 0;
+    os2->sCapHeight       = 0;
+    os2->usDefaultChar    = 0;
+    os2->usBreakChar      = 0;
+    os2->usMaxContext     = 0;
 
     if ( os2->version >= 0x0001 )
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]