mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[font-funcs-using] Treat empty string like nullptr
This commit is contained in:
parent
712a403bec
commit
5a12bf417b
1 changed files with 4 additions and 1 deletions
|
@ -2330,7 +2330,7 @@ static struct supported_font_funcs_t {
|
|||
* Sets the font-functions structure to use for a font, based on the
|
||||
* specified name.
|
||||
*
|
||||
* If @name is `NULL`, the first functioning font-functions are used.
|
||||
* If @name is `NULL` or empty string, the first functioning font-functions are used.
|
||||
*
|
||||
* Return value: `true` if the font-functions was found and set, `false` otherwise
|
||||
*
|
||||
|
@ -2340,6 +2340,8 @@ hb_bool_t
|
|||
hb_font_set_funcs_using (hb_font_t *font,
|
||||
const char *name)
|
||||
{
|
||||
if (name && !*name) name = nullptr;
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_LENGTH (supported_font_funcs); i++)
|
||||
if (!name || strcmp (supported_font_funcs[i].name, name) == 0)
|
||||
{
|
||||
|
@ -2347,6 +2349,7 @@ hb_font_set_funcs_using (hb_font_t *font,
|
|||
if (name || font->klass != hb_font_funcs_get_empty ())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue