diff --git a/ChangeLog b/ChangeLog index 22a448454..bd45d755e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2017-01-25 Werner Lemberg + + [sfnt] s/TT_NameEntry/TT_Name/. + + * include/freetype/internal/tttypes.h (TT_NameEntryRec): Renamed + to... + (TT_NameRec): This. + (TT_NameTableRec): Updated. + + * src/base/ftsnames.c (FT_Get_Sfnt_Name): Updated. + + * src/sfnt/sfdriver.c (sfnt_get_ps_name): Updated. + + * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16, + tt_name_entry_ascii_from_other): Renamed to... + (tt_name_ascii_from_utf16, tt_name_entry_ascii_from_other): This, + respectively. + (TT_NameEntry_ConvertFunc): Renamed to... + (TT_Name_ConvertFunc): This. + (tt_face_get_name): Updated. + + * src/sfnt/ttload.c (tt_face_load_name, tt_face_free_names): + Updated. + 2017-01-24 Werner Lemberg [sfnt] Fix Postscript name service for symbol fonts. diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h index 79c2be24b..d6cf93424 100644 --- a/include/freetype/internal/tttypes.h +++ b/include/freetype/internal/tttypes.h @@ -243,7 +243,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* */ - /* TT_NameEntryRec */ + /* TT_NameRec */ /* */ /* */ /* A structure modeling TrueType name records. Name records are used */ @@ -267,7 +267,7 @@ FT_BEGIN_HEADER /* string :: A pointer to the string's bytes. Note that these */ /* are usually UTF-16 encoded characters. */ /* */ - typedef struct TT_NameEntryRec_ + typedef struct TT_NameRec_ { FT_UShort platformID; FT_UShort encodingID; @@ -281,7 +281,7 @@ FT_BEGIN_HEADER FT_Byte* string; - } TT_NameEntryRec, *TT_NameEntry; + } TT_NameRec, *TT_Name; /*************************************************************************/ @@ -306,11 +306,11 @@ FT_BEGIN_HEADER /* */ typedef struct TT_NameTableRec_ { - FT_UShort format; - FT_UInt numNameRecords; - FT_UInt storageOffset; - TT_NameEntryRec* names; - FT_Stream stream; + FT_UShort format; + FT_UInt numNameRecords; + FT_UInt storageOffset; + TT_NameRec* names; + FT_Stream stream; } TT_NameTableRec, *TT_NameTable; diff --git a/src/base/ftsnames.c b/src/base/ftsnames.c index a5b41eb88..76ab7b210 100644 --- a/src/base/ftsnames.c +++ b/src/base/ftsnames.c @@ -54,7 +54,7 @@ if ( idx < (FT_UInt)ttface->num_names ) { - TT_NameEntryRec* entry = ttface->name_table.names + idx; + TT_Name entry = ttface->name_table.names + idx; /* load name on demand */ diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index 8877ad354..a70f9a2c7 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -238,7 +238,7 @@ for ( n = 0; n < face->num_names; n++ ) { - TT_NameEntryRec* name = face->name_table.names + n; + TT_Name name = face->name_table.names + n; if ( name->nameID == 6 && name->stringLength > 0 ) @@ -258,10 +258,10 @@ if ( found_win != -1 ) { - FT_Memory memory = face->root.memory; - TT_NameEntryRec* name = face->name_table.names + found_win; - FT_UInt len = name->stringLength / 2; - FT_Error error = FT_Err_Ok; + FT_Memory memory = face->root.memory; + TT_Name name = face->name_table.names + found_win; + FT_UInt len = name->stringLength / 2; + FT_Error error = FT_Err_Ok; FT_UNUSED( error ); @@ -300,10 +300,10 @@ if ( found_apple != -1 ) { - FT_Memory memory = face->root.memory; - TT_NameEntryRec* name = face->name_table.names + found_apple; - FT_UInt len = name->stringLength; - FT_Error error = FT_Err_Ok; + FT_Memory memory = face->root.memory; + TT_Name name = face->name_table.names + found_apple; + FT_UInt len = name->stringLength; + FT_Error error = FT_Err_Ok; FT_UNUSED( error ); diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index ff0299a69..1ee7a4d61 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -54,8 +54,8 @@ /* convert a UTF-16 name entry to ASCII */ static FT_String* - tt_name_entry_ascii_from_utf16( TT_NameEntry entry, - FT_Memory memory ) + tt_name_ascii_from_utf16( TT_Name entry, + FT_Memory memory ) { FT_String* string = NULL; FT_UInt len, code, n; @@ -89,8 +89,8 @@ /* convert an Apple Roman or symbol name entry to ASCII */ static FT_String* - tt_name_entry_ascii_from_other( TT_NameEntry entry, - FT_Memory memory ) + tt_name_ascii_from_other( TT_Name entry, + FT_Memory memory ) { FT_String* string = NULL; FT_UInt len, code, n; @@ -122,8 +122,8 @@ } - typedef FT_String* (*TT_NameEntry_ConvertFunc)( TT_NameEntry entry, - FT_Memory memory ); + typedef FT_String* (*TT_Name_ConvertFunc)( TT_Name entry, + FT_Memory memory ); /* documentation is in sfnt.h */ @@ -133,20 +133,21 @@ FT_UShort nameid, FT_String** name ) { - FT_Memory memory = face->root.memory; - FT_Error error = FT_Err_Ok; - FT_String* result = NULL; - FT_UShort n; - TT_NameEntryRec* rec; - FT_Int found_apple = -1; - FT_Int found_apple_roman = -1; - FT_Int found_apple_english = -1; - FT_Int found_win = -1; - FT_Int found_unicode = -1; + FT_Memory memory = face->root.memory; + FT_Error error = FT_Err_Ok; + FT_String* result = NULL; + FT_UShort n; + TT_Name rec; - FT_Bool is_english = 0; + FT_Int found_apple = -1; + FT_Int found_apple_roman = -1; + FT_Int found_apple_english = -1; + FT_Int found_win = -1; + FT_Int found_unicode = -1; - TT_NameEntry_ConvertFunc convert; + FT_Bool is_english = 0; + + TT_Name_ConvertFunc convert; FT_ASSERT( name ); @@ -231,7 +232,7 @@ /* all Unicode strings are encoded using UTF-16BE */ case TT_MS_ID_UNICODE_CS: case TT_MS_ID_SYMBOL_CS: - convert = tt_name_entry_ascii_from_utf16; + convert = tt_name_ascii_from_utf16; break; case TT_MS_ID_UCS_4: @@ -240,7 +241,7 @@ /* MsGothic font shipped with Windows Vista shows that this really */ /* means UTF-16 encoded names (UCS-4 values are only used within */ /* charmaps). */ - convert = tt_name_entry_ascii_from_utf16; + convert = tt_name_ascii_from_utf16; break; default: @@ -250,12 +251,12 @@ else if ( found_apple >= 0 ) { rec = face->name_table.names + found_apple; - convert = tt_name_entry_ascii_from_other; + convert = tt_name_ascii_from_other; } else if ( found_unicode >= 0 ) { rec = face->name_table.names + found_unicode; - convert = tt_name_entry_ascii_from_utf16; + convert = tt_name_ascii_from_utf16; } if ( rec && convert ) diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index 53837c7c1..3ab211cd0 100644 --- a/src/sfnt/ttload.c +++ b/src/sfnt/ttload.c @@ -826,7 +826,7 @@ static const FT_Frame_Field name_record_fields[] = { #undef FT_STRUCTURE -#define FT_STRUCTURE TT_NameEntryRec +#define FT_STRUCTURE TT_NameRec /* no FT_FRAME_START */ FT_FRAME_USHORT( platformID ), @@ -880,7 +880,7 @@ /* Load the name records and determine how much storage is needed */ /* to hold the strings themselves. */ { - TT_NameEntryRec* entry = table->names; + TT_Name entry = table->names; for ( ; count > 0; count-- ) @@ -935,7 +935,7 @@ { FT_Memory memory = face->root.driver->root.memory; TT_NameTable table = &face->name_table; - TT_NameEntry entry = table->names; + TT_Name entry = table->names; FT_UInt count = table->numNameRecords;