From 6a012ad79f95673a36531c27c81e0efa6c6ec664 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 20 May 2021 18:40:48 +0200 Subject: 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. :^) --- Userland/Games/Chess/ChessWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Userland/Games/Chess') diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index 92921bb6be..db1e05fb56 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -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) { -- cgit v1.2.3