* src/bdf/bdflib.c (bdf_parse_start_): Reserve space for artificial properties.

This commit is contained in:
Alexei Podtelezhnikov 2025-01-16 03:47:14 +00:00
parent ae11e18cbd
commit 02953326d4

View file

@ -1085,8 +1085,7 @@
/* First, check whether the property already exists in the font. */
if ( font->props_used &&
( propid = ft_hash_str_lookup( name, font->internal ) ) != NULL )
if ( ( propid = ft_hash_str_lookup( name, font->internal ) ) != NULL )
{
/* The property already exists in the font, so simply replace */
/* the value of the property with the current value. */
@ -1993,6 +1992,15 @@
goto Exit;
}
/* Reserve space for artificial FONT_ASCENT or FONT_DESCENT. */
if ( font->props_size == 0 )
{
if ( FT_NEW_ARRAY( font->props, 2 ) )
goto Exit;
font->props_size = 2;
}
/* If the FONT_ASCENT or FONT_DESCENT properties have not been */
/* encountered yet, then make sure they are added as properties and */
/* make sure they are set from the font bounding box info. */