1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +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:
Aliaksandr Kalenik 2023-02-04 23:00:34 +03:00 committed by Sam Atkins
parent 79006c03b4
commit 1f4106842d
21 changed files with 71 additions and 21 deletions

View file

@ -638,7 +638,7 @@ void TextEditor::paint_event(PaintEvent& event)
}
auto font = unspanned_font;
if (span.attributes.bold) {
if (auto bold_font = Gfx::FontDatabase::the().get(font->family(), font->presentation_size(), 700, 0))
if (auto bold_font = Gfx::FontDatabase::the().get(font->family(), font->presentation_size(), 700, font->width(), 0))
font = bold_font;
}
draw_text_helper(span_start, span_end, font, span.attributes);