瀏覽代碼

LibGfx: Make BitmapFont's line gap be Gfx::Painter::LINE_SPACING

This is the closest thing we have to the OpenType line gap metrics.
Using it here will allow us to unify more of the text painting logic.
Andreas Kling 2 年之前
父節點
當前提交
f5e18dda2b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Userland/Libraries/LibGfx/Font/BitmapFont.cpp

+ 2 - 1
Userland/Libraries/LibGfx/Font/BitmapFont.cpp

@@ -12,6 +12,7 @@
 #include <LibCore/FileStream.h>
 #include <LibCore/FileStream.h>
 #include <LibGfx/Font/FontDatabase.h>
 #include <LibGfx/Font/FontDatabase.h>
 #include <LibGfx/Font/FontStyleMapping.h>
 #include <LibGfx/Font/FontStyleMapping.h>
+#include <LibGfx/Painter.h>
 #include <string.h>
 #include <string.h>
 
 
 namespace Gfx {
 namespace Gfx {
@@ -402,7 +403,7 @@ FontPixelMetrics BitmapFont::pixel_metrics() const
         .glyph_spacing = (float)glyph_spacing(),
         .glyph_spacing = (float)glyph_spacing(),
         .ascent = (float)m_baseline,
         .ascent = (float)m_baseline,
         .descent = (float)(m_glyph_height - m_baseline),
         .descent = (float)(m_glyph_height - m_baseline),
-        .line_gap = (float)pixel_size() * 0.4f, // FIXME: Do something nicer here.
+        .line_gap = Gfx::Painter::LINE_SPACING,
     };
     };
 }
 }