mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:17:44 +00:00
LibGfx: Pass font width to FontDatabase::get()
Width need to be passed to `FontDatabase::get()` to resolve font name unambiguously.
This commit is contained in:
parent
79006c03b4
commit
1f4106842d
21 changed files with 71 additions and 21 deletions
|
@ -815,25 +815,25 @@ void Widget::set_font(Gfx::Font const* font)
|
|||
|
||||
void Widget::set_font_family(DeprecatedString const& family)
|
||||
{
|
||||
set_font(Gfx::FontDatabase::the().get(family, m_font->presentation_size(), m_font->weight(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(family, m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
void Widget::set_font_size(unsigned size)
|
||||
{
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family(), size, m_font->weight(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family(), size, m_font->weight(), m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
void Widget::set_font_weight(unsigned weight)
|
||||
{
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family(), m_font->presentation_size(), weight, m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(m_font->family(), m_font->presentation_size(), weight, m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
void Widget::set_font_fixed_width(bool fixed_width)
|
||||
{
|
||||
if (fixed_width)
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_fixed_width_font().family(), m_font->presentation_size(), m_font->weight(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_fixed_width_font().family(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
else
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family(), m_font->presentation_size(), m_font->weight(), m_font->slope()));
|
||||
set_font(Gfx::FontDatabase::the().get(Gfx::FontDatabase::the().default_font().family(), m_font->presentation_size(), m_font->weight(), m_font->width(), m_font->slope()));
|
||||
}
|
||||
|
||||
void Widget::set_min_size(UISize const& size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue