1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibGfx: Remove Gfx::FontDatabase::default_bold_font()

Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
This commit is contained in:
Andreas Kling 2021-05-20 18:40:48 +02:00
parent 068ddf4513
commit 6a012ad79f
24 changed files with 33 additions and 46 deletions

View file

@ -41,6 +41,8 @@ void ChessWidget::paint_event(GUI::PaintEvent& event)
Chess::Board& active_board = (m_playback ? board_playback() : board());
auto& coordinate_font = Gfx::FontDatabase::default_font().bold_variant();
Chess::Square::for_each([&](Chess::Square sq) {
Gfx::IntRect tile_rect;
if (side() == Chess::Color::White) {
@ -62,10 +64,10 @@ void ChessWidget::paint_event(GUI::PaintEvent& event)
auto shrunken_rect = tile_rect;
shrunken_rect.shrink(4, 4);
if (sq.rank == coord_rank_file)
painter.draw_text(shrunken_rect, coord.substring_view(0, 1), Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::BottomRight, text_color);
painter.draw_text(shrunken_rect, coord.substring_view(0, 1), coordinate_font, Gfx::TextAlignment::BottomRight, text_color);
if (sq.file == coord_rank_file)
painter.draw_text(shrunken_rect, coord.substring_view(1, 1), Gfx::FontDatabase::default_bold_font(), Gfx::TextAlignment::TopLeft, text_color);
painter.draw_text(shrunken_rect, coord.substring_view(1, 1), coordinate_font, Gfx::TextAlignment::TopLeft, text_color);
}
for (auto& m : m_board_markings) {