From 56131e4216d1638766b7fe32bed14f217e7a2858 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Wed, 22 Jan 2025 20:47:56 -0500 Subject: [PATCH] [bdf] Postpone font default char handling. * src/bdf/bdflib.c (bdf_parse_start_, bdf_add_property_): Delay handling of the default char until... * src/bdf/bdfdrivr.c (BDF_Face_Init): ... handles all other properties. --- src/bdf/bdfdrivr.c | 6 ++++++ src/bdf/bdflib.c | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c index 22416e82a..1995c36ac 100644 --- a/src/bdf/bdfdrivr.c +++ b/src/bdf/bdfdrivr.c @@ -600,6 +600,12 @@ THE SOFTWARE. resolution_y ); else bsize->x_ppem = bsize->y_ppem; + + prop = bdf_get_font_property( font, "DEFAULT_CHAR" ); + if ( prop ) + font->default_char = prop->value.ul; + else + font->default_char = ~0UL; } /* encoding table */ diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c index 6d154da25..5c6841c35 100644 --- a/src/bdf/bdflib.c +++ b/src/bdf/bdflib.c @@ -856,14 +856,6 @@ font->props_used++; - /* Some special cases need to be handled here. The DEFAULT_CHAR */ - /* property needs to be located if it exists in the property list, the */ - /* FONT_ASCENT and FONT_DESCENT need to be assigned if they are */ - /* present, and the SPACING property should override the default */ - /* spacing. */ - if ( _bdf_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 ) - font->default_char = fp->value.ul; - Exit: return error; } @@ -1431,7 +1423,6 @@ error = ft_hash_str_init( p->font->internal, memory ); if ( error ) goto Exit; - p->font->default_char = ~0UL; goto Exit; }