[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.
This commit is contained in:
Werner Lemberg 2017-01-25 15:08:41 +01:00
parent d66c3645fc
commit f4e5696643
6 changed files with 68 additions and 43 deletions

View File

@ -1,3 +1,27 @@
2017-01-25 Werner Lemberg <wl@gnu.org>
[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 <wl@gnu.org>
[sfnt] Fix Postscript name service for symbol fonts.

View File

@ -243,7 +243,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
/* TT_NameEntryRec */
/* TT_NameRec */
/* */
/* <Description> */
/* 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;

View File

@ -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 */

View File

@ -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 );

View File

@ -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 )

View File

@ -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;