summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c b/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
index fff9c42a37d..b38f9d3b1cd 100644
--- a/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
+++ b/Build/source/libs/freetype2/freetype-src/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
*
* psnames module implementation (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -155,30 +155,31 @@
/* Look for a non-initial dot in the glyph name in order to */
/* find variants like `A.swash', `e.final', etc. */
{
- FT_UInt32 value = 0;
- const char* p = glyph_name;
-
+ const char* p = glyph_name;
+ const char* dot = NULL;
- for ( ; *p && *p != '.'; p++ )
- ;
- /* now look up the glyph in the Adobe Glyph List; */
- /* `.notdef', `.null' and the empty name are short cut */
- if ( p > glyph_name )
+ for ( ; *p; p++ )
{
- value = (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
-
- if ( *p == '.' )
- value |= (FT_UInt32)VARIANT_BIT;
+ if ( *p == '.' && p > glyph_name )
+ {
+ dot = p;
+ break;
+ }
}
- return value;
+ /* now look up the glyph in the Adobe Glyph List */
+ if ( !dot )
+ return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
+ else
+ return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
+ VARIANT_BIT );
}
}
/* ft_qsort callback to sort the unicode map */
- FT_COMPARE_DEF( int )
+ FT_CALLBACK_DEF( int )
compare_uni_maps( const void* a,
const void* b )
{
@@ -327,7 +328,7 @@
table->num_maps = 0;
table->maps = NULL;
- if ( !FT_QNEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )
+ if ( !FT_NEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )
{
FT_UInt n;
FT_UInt count;
@@ -342,7 +343,7 @@
const char* gname = get_glyph_name( glyph_data, n );
- if ( gname && *gname )
+ if ( gname )
{
ps_check_extra_glyph_name( gname, n,
extra_glyphs, extra_glyph_list_states );
@@ -390,9 +391,9 @@
/* Reallocate if the number of used entries is much smaller. */
if ( count < num_glyphs / 2 )
{
- (void)FT_QRENEW_ARRAY( table->maps,
- num_glyphs + EXTRA_GLYPH_LIST_SIZE,
- count );
+ (void)FT_RENEW_ARRAY( table->maps,
+ num_glyphs + EXTRA_GLYPH_LIST_SIZE,
+ count );
error = FT_Err_Ok;
}