Skip to content

Commit

Permalink
Some further optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkakunze committed Jul 6, 2024
1 parent a7f4f43 commit e7e7bf2
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
7 changes: 6 additions & 1 deletion Driver/Font/TrueType/FreeType/freetype.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@
TT_UShort usWeightClass;
TT_UShort usWidthClass;
TT_Short fsType;

#ifdef TT_CONFIG_OPTION_SUPPORT_OPTIONAL_FIELDS
TT_FWord ySubscriptXSize;
TT_FWord ySubscriptYSize;
TT_FWord ySubscriptXOffset;
Expand All @@ -491,14 +493,17 @@
TT_FWord ySuperscriptYOffset;
TT_FWord yStrikeoutSize;
TT_FWord yStrikeoutPosition;
TT_Short sFamilyClass;
#endif

TT_Short sFamilyClass;
TT_Byte panose[10];

#ifdef TT_CONFIG_OPTION_SUPPORT_UNICODE_RANGES
TT_ULong ulUnicodeRange1; /* Bits 0-31 */
TT_ULong ulUnicodeRange2; /* Bits 32-63 */
TT_ULong ulUnicodeRange3; /* Bits 64-95 */
TT_ULong ulUnicodeRange4; /* Bits 96-127 */
#endif

#ifdef TT_CONFIG_OPTION_SUPPORT_OPTIONAL_FIELDS
TT_Char achVendID[4];
Expand Down
7 changes: 7 additions & 0 deletions Driver/Font/TrueType/FreeType/ft_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@
#undef TT_CONFIG_OPTION_SUPPORT_OPTIONAL_FIELDS


/*************************************************************************/
/* Define TT_CONFIG_OPTION_SUPPORT_UNICODE_RANGES if you want to hold */
/* unicode ranges in OS/2 table. */

#undef TT_CONFIG_OPTION_SUPPORT_UNICODE_RANGES


/**********************************************************************/
/* */
/* The following macros are used to define the debug level, as well */
Expand Down
8 changes: 4 additions & 4 deletions Driver/Font/TrueType/FreeType/ttextend.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

clazz->offset = exts->cur_offset;

exts->num_extensions++;
++exts->num_extensions;
exts->cur_offset += ( size + ALIGNMENT-1 ) & -ALIGNMENT;

return TT_Err_Ok;
Expand All @@ -125,7 +125,7 @@

registry = (PExtension_Registry)face->engine->extension_component;

for ( n = 0; n < face->n_extensions; n++ )
for ( n = 0; n < face->n_extensions; ++n )
{
clazz = registry->classes + n;
if ( clazz->id == extension_id )
Expand Down Expand Up @@ -154,7 +154,7 @@

registry = (PExtension_Registry)engine->extension_component;

for ( n = 0; n < face->n_extensions; n++ )
for ( n = 0; n < face->n_extensions; ++n )
{
clazz = registry->classes + n;
ext = (PByte)face->extension + clazz->offset;
Expand Down Expand Up @@ -196,7 +196,7 @@
if ( ALLOC( face->extension, registry->cur_offset ) )
return error;

for ( n = 0; n < face->n_extensions; n++ )
for ( n = 0; n < face->n_extensions; ++n )
{
clazz = registry->classes + n;
ext = (PByte)face->extension + clazz->offset;
Expand Down
12 changes: 11 additions & 1 deletion Driver/Font/TrueType/FreeType/ttload.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@

cmap->offset = FILE_Pos();

cmap++;
++cmap;
}

return TT_Err_Ok;
Expand Down Expand Up @@ -1006,6 +1006,8 @@
os2->usWeightClass = GET_UShort();
os2->usWidthClass = GET_UShort();
os2->fsType = GET_Short();

#ifdef TT_CONFIG_OPTION_SUPPORT_OPTIONAL_FIELDS
os2->ySubscriptXSize = GET_Short();
os2->ySubscriptYSize = GET_Short();
os2->ySubscriptXOffset = GET_Short();
Expand All @@ -1016,15 +1018,23 @@
os2->ySuperscriptYOffset = GET_Short();
os2->yStrikeoutSize = GET_Short();
os2->yStrikeoutPosition = GET_Short();
#else
SKIP( 20 );
#endif

os2->sFamilyClass = GET_Short();

for ( i = 0; i < 10; ++i )
os2->panose[i] = GET_Byte();

#ifdef TT_CONFIG_OPTION_SUPPORT_UNICODE_RANGES
os2->ulUnicodeRange1 = GET_ULong();
os2->ulUnicodeRange2 = GET_ULong();
os2->ulUnicodeRange3 = GET_ULong();
os2->ulUnicodeRange4 = GET_ULong();
#else
SKIP( 16 );
#endif

#ifdef TT_CONFIG_OPTION_SUPPORT_OPTIONAL_FIELDS
for ( i = 0; i < 4; ++i )
Expand Down
12 changes: 6 additions & 6 deletions Driver/Font/TrueType/FreeType/ttraster.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@
ras.cProfile->height = 0;
ras.cProfile->offset = ras.top;
oldProfile->next = ras.cProfile;
ras.num_Profs++;
++ras.num_Profs;
}

if ( ras.top >= ras.maxBuff )
Expand Down Expand Up @@ -2202,7 +2202,7 @@

if ( ras.numTurns > 0 &&
ras.sizeBuff[-ras.numTurns] == min_Y )
ras.numTurns--;
--ras.numTurns;

while ( ras.numTurns > 0 )
{
Expand Down Expand Up @@ -2273,7 +2273,7 @@

/* mark profile for drop-out processing */
P_Left->countL = 1;
dropouts++;
++dropouts;

goto Skip_To_Next;
}
Expand All @@ -2297,7 +2297,7 @@

ras.Proc_Sweep_Step( RAS_VARS y );

y++;
++y;

if ( y < y_change )
{
Expand Down Expand Up @@ -2421,13 +2421,13 @@ Scan_DropOuts :
ras.band_stack[ras.band_top+1].y_max = j;
ras.band_stack[ras.band_top].y_max = k - 1;

ras.band_top++;
++ras.band_top;
}
else
{
if ( ras.fProfile )
if ( Draw_Sweep( RAS_VAR ) ) return ras.error;
ras.band_top--;
--ras.band_top;
}
}

Expand Down

0 comments on commit e7e7bf2

Please sign in to comment.