[autofit] Remove no longer used functions and structures.

This is the clean-up from the previous commit.

* src/autofit/afadjust.c (af_reverse_character_map_entry_compare,
  af_reverse_character_map_lookup, af_reverse_character_map_expand):
  Removed.
* src/autofit/afadjust.h: Updated.
* src/autofit/aftypes.h (AF_ReverseMapEntry, AF_ReverseCharacterMap):
  Removed.
This commit is contained in:
Werner Lemberg 2025-05-16 07:46:43 +02:00
parent 2492b5477b
commit 94e93c7c75
3 changed files with 0 additions and 112 deletions

View file

@ -1161,94 +1161,6 @@
}
/* `qsort` compare function for reverse character map. */
FT_COMPARE_DEF( FT_Int )
af_reverse_character_map_entry_compare( const void *a,
const void *b )
{
const AF_ReverseMapEntry entry_a = *((const AF_ReverseMapEntry *)a);
const AF_ReverseMapEntry entry_b = *((const AF_ReverseMapEntry *)b);
return entry_a.glyph_index < entry_b.glyph_index
? -1
: entry_a.glyph_index > entry_b.glyph_index
? 1
: entry_a.codepoint < entry_b.codepoint
? -1
: entry_a.codepoint > entry_b.codepoint
? 1
: 0;
}
FT_LOCAL_DEF( const AF_ReverseMapEntry* )
af_reverse_character_map_lookup( AF_ReverseCharacterMap map,
FT_Int glyph_index )
{
FT_Int low, high;
FT_Long length;
if ( !map )
return NULL;
length = map->length;
/* Binary search for reverse character map entry. */
low = 0;
high = length - 1;
while ( high >= low )
{
FT_Int mid = ( high + low ) / 2;
FT_Int mid_glyph_index = map->entries[mid].glyph_index;
if ( glyph_index < mid_glyph_index )
high = mid - 1;
else if ( glyph_index > mid_glyph_index )
low = mid + 1;
else if (low != mid)
/* We want the first occurrence of `glyph_index` */
/* (i.e., the one with the lowest array index). */
high = mid;
else
return &map->entries[mid];
}
return NULL;
}
/* Prepare to add one more entry to the reverse character map. */
/* This is a helper function for `af_reverse_character_map_new`. */
static FT_Error
af_reverse_character_map_expand( AF_ReverseCharacterMap map,
FT_Long *capacity,
FT_Memory memory )
{
FT_Error error;
if ( map->length < *capacity )
return FT_Err_Ok;
if ( map->length == *capacity )
{
FT_Long new_capacity = *capacity + *capacity / 2;
if ( FT_RENEW_ARRAY( map->entries, map->length, new_capacity ) )
return error;
*capacity = new_capacity;
}
return FT_Err_Ok;
}
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
/*

View file

@ -118,10 +118,6 @@ FT_BEGIN_HEADER
FT_LOCAL( const AF_AdjustmentDatabaseEntry* )
af_adjustment_database_lookup( FT_UInt32 codepoint );
FT_LOCAL( const AF_ReverseMapEntry* )
af_reverse_character_map_lookup( AF_ReverseCharacterMap map,
FT_Int glyph_index );
/* Allocate and populate the reverse character map, */
/* using the character map within the face. */
FT_LOCAL( FT_Error )

View file

@ -408,26 +408,6 @@ extern void* af_debug_hints_;
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
/* Store a mapping from glyphs to unicode codepoints. */
/* See `afadjust.c` for details. */
typedef struct AF_ReverseMapEntry_
{
FT_Int glyph_index;
FT_UInt32 codepoint;
} AF_ReverseMapEntry;
typedef struct AF_ReverseCharacterMapRec_
{
FT_Long length;
AF_ReverseMapEntry *entries;
} AF_ReverseCharacterMapRec;
typedef struct AF_ReverseCharacterMapRec_* AF_ReverseCharacterMap;
/* This is the main structure that combines everything. Autofit modules */
/* specific to writing systems derive their structures from it, for */
/* example `AF_LatinMetrics'. */