summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2017-09-27 18:09:31 -0400
committerBehdad Esfahbod <behdad@behdad.org>2017-09-27 18:37:00 -0400
commit261464e0e2b0348187448fd86cde7d1e36124fc6 (patch)
treeeb2a74c0d40549338ee6944c46f2119937662a1e /src
parent55d04e25d613b0b63b2b2c33affb6fae34a0ca01 (diff)
Simplify name-table platform mathcing logic
There's no "all other platforms", there was just ISO left. Hardcode it in.
Diffstat (limited to 'src')
-rw-r--r--src/fcfreetype.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index e203c750..80210358 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1136,6 +1136,7 @@ static const FT_UShort platform_order[] = {
TT_PLATFORM_MICROSOFT,
TT_PLATFORM_APPLE_UNICODE,
TT_PLATFORM_MACINTOSH,
+ TT_PLATFORM_ISO,
};
#define NUM_PLATFORM_ORDER (sizeof (platform_order) / sizeof (platform_order[0]))
@@ -1369,12 +1370,9 @@ FcFreeTypeQueryFaceInternal (const FT_Face face,
* of them
*/
snamec = FT_Get_Sfnt_Name_Count (face);
- for (p = 0; p <= NUM_PLATFORM_ORDER; p++)
+ for (p = 0; p < NUM_PLATFORM_ORDER; p++)
{
- if (p < NUM_PLATFORM_ORDER)
- platform = platform_order[p];
- else
- platform = 0xffff;
+ platform = platform_order[p];
/*
* Order nameids so preferred names appear first
@@ -1410,25 +1408,8 @@ FcFreeTypeQueryFaceInternal (const FT_Face face,
if (sname.name_id != nameid)
continue;
- /*
- * Sort platforms in preference order, accepting
- * all other platforms last
- */
- if (p < NUM_PLATFORM_ORDER)
- {
- if (sname.platform_id != platform)
- continue;
- }
- else
- {
- unsigned int sp;
-
- for (sp = 0; sp < NUM_PLATFORM_ORDER; sp++)
- if (sname.platform_id == platform_order[sp])
- break;
- if (sp != NUM_PLATFORM_ORDER)
- continue;
- }
+ if (sname.platform_id != platform)
+ continue;
switch (sname.name_id) {
#ifdef TT_NAME_ID_WWS_FAMILY