1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

LibGUI+LibGfx+LibTTF: Make fontpicker handle TTF fonts

This commit is contained in:
Stephan Unverwerth 2021-01-02 18:21:29 +01:00 committed by Andreas Kling
parent 5a70ccecb3
commit 0f41f5d9ba
6 changed files with 46 additions and 21 deletions

View file

@ -159,6 +159,7 @@ RefPtr<Gfx::Font> FontDatabase::get_by_name(const StringView& name)
RefPtr<Gfx::Font> FontDatabase::get(const String& family, unsigned size, unsigned weight)
{
dbgln("FontDatabase: Request font {} {} {}", family, size, weight);
for (auto typeface : m_private->typefaces) {
if (typeface->family() == family && typeface->weight() == weight)
return typeface->get_font(size);