* include/freetype/internal/psaux.h (PS_Table): Use FT_Offset for `cursor' and `capacity'. * src/psaux/psobjc.c (reallocate_t1_table): Use FT_Long for second parameter. (PS_Table_Add): Use FT_Offset for `new_size'. * src/base/ftsynth.c: Include ftcalc.h unconditionally.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
diff --git a/ChangeLog b/ChangeLog
index 769445c..8043121 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2001-07-17 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/internal/psaux.h (PS_Table): Use FT_Offset for
+ `cursor' and `capacity'.
+ * src/psaux/psobjc.c (reallocate_t1_table): Use FT_Long for second
+ parameter.
+ (PS_Table_Add): Use FT_Offset for `new_size'.
+
+2001-07-13 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftsynth.c: Include ftcalc.h unconditionally.
+
2001-07-07 David Turner <david@freetype.org>
* src/truetype/ttgload.c, src/truetype/ttinterp.c, src/pcf/pcfread:
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index cfc0888..1911829 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -115,8 +115,8 @@ FT_BEGIN_HEADER
struct PS_Table_
{
FT_Byte* block; /* current memory block */
- FT_Int cursor; /* current cursor in memory block */
- FT_Int capacity; /* current size of memory block */
+ FT_Offset cursor; /* current cursor in memory block */
+ FT_Offset capacity; /* current size of memory block */
FT_Long init;
FT_Int max_elems;
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index ac9057d..e38c104 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -101,7 +101,7 @@
static FT_Error
reallocate_t1_table( PS_Table* table,
- FT_Int new_size )
+ FT_Long new_size )
{
FT_Memory memory = table->memory;
FT_Byte* old_base = table->block;
@@ -163,8 +163,8 @@
/* grow the base block if needed */
if ( table->cursor + length > table->capacity )
{
- FT_Error error;
- FT_Int new_size = table->capacity;
+ FT_Error error;
+ FT_Offset new_size = table->capacity;
while ( new_size < table->cursor + length )
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index ae72f37..ab55342 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -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,37 +601,57 @@
if ( READ_Fields( maxp_fields, maxProfile ) )
goto Exit;
- /* XXX: an adjustment that is necessary to load certain */
- /* broken fonts like `Keystrokes MT' :-( */
- /* */
- /* We allocate 64 function entries by default when */
- /* the maxFunctionDefs field is null. */
+ 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;
- if ( maxProfile->maxFunctionDefs == 0 )
- maxProfile->maxFunctionDefs = 64;
+ /* XXX: an adjustment that is necessary to load certain */
+ /* broken fonts like `Keystrokes MT' :-( */
+ /* */
+ /* We allocate 64 function entries by default when */
+ /* the maxFunctionDefs field is null. */
- face->root.num_glyphs = maxProfile->numGlyphs;
+ if ( maxProfile->maxFunctionDefs == 0 )
+ maxProfile->maxFunctionDefs = 64;
- face->root.internal->max_points =
- (FT_UShort)MAX( maxProfile->maxCompositePoints,
- maxProfile->maxPoints );
+ face->root.num_glyphs = maxProfile->numGlyphs;
- face->root.internal->max_contours =
- (FT_Short)MAX( maxProfile->maxCompositeContours,
- maxProfile->maxContours );
+ face->root.internal->max_points =
+ (FT_UShort)MAX( maxProfile->maxCompositePoints,
+ maxProfile->maxPoints );
- face->max_components = (FT_ULong)maxProfile->maxComponentElements +
- maxProfile->maxComponentDepth;
+ face->root.internal->max_contours =
+ (FT_Short)MAX( maxProfile->maxCompositeContours,
+ maxProfile->maxContours );
- /* XXX: some fonts have maxComponents set to 0; we will */
- /* then use 16 of them by default. */
- if ( face->max_components == 0 )
- face->max_components = 16;
+ face->max_components = (FT_ULong)maxProfile->maxComponentElements +
+ maxProfile->maxComponentDepth;
- /* We also increase maxPoints and maxContours in order to support */
- /* some broken fonts. */
- face->root.internal->max_points += 8;
- face->root.internal->max_contours += 4;
+ /* XXX: some fonts have maxComponents set to 0; we will */
+ /* then use 16 of them by default. */
+ if ( face->max_components == 0 )
+ face->max_components = 16;
+
+ /* We also increase maxPoints and maxContours in order to support */
+ /* some broken fonts. */
+ face->root.internal->max_points += 8;
+ face->root.internal->max_contours += 4;
+ }
FT_TRACE2(( "MAXP loaded.\n" ));
@@ -1211,11 +1238,11 @@
FT_Error error;
TT_OS2* os2;
+ const FT_Frame_Field os2_fields[] =
+ {
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_OS2
- const FT_Frame_Field os2_fields[] =
- {
FT_FRAME_START( 78 ),
FT_FRAME_USHORT( version ),
FT_FRAME_SHORT ( xAvgCharWidth ),
@@ -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 )
{