]> git.ipfire.org Git - thirdparty/plymouth.git/commit
label-freetype: Rework font loading
authorRay Strode <rstrode@redhat.com>
Wed, 3 Jan 2024 20:37:08 +0000 (15:37 -0500)
committerRay Strode <rstrode@redhat.com>
Wed, 3 Jan 2024 20:45:01 +0000 (15:45 -0500)
commit544e62ac41a490f04d8e6b4e85f8b9fa1171b0cc
tree3db77a7a81c696a9b6d86e9eccfd168751f92c66
parent68b6fd28f196078e6115fc5a46dfa32b263e9391
label-freetype: Rework font loading

There's currently this function, set_font_with_fallback, that
almost always gets called with a NULL first argument in the
initramfs, forcing the _with_fallback part of the function to
run.

It's a little strange to have a function with a chunk of code that
hardly ever runs. Furthermore there's a bug where the error variable
is left uninitialized in this case leading to the freetype plugin
sporadically failing to load the fallback font.

This commit reworks things to drop set_font_with_fallback, and just
call FT_New_Face directly in the caller. Fallbacks are handled
at the point where the font path is determined
(previously called query_fc_match, now called find_default_font_path.
src/plugins/controls/label-freetype/plugin.c