summaryrefslogtreecommitdiff
path: root/SharedGraphics
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-17 00:36:55 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-17 00:36:55 +0100
commit10d6f9ce317945020ef9451b433450e2ed6a2b14 (patch)
treee88b8f9c62fab3a5aa2b0c57695c70f9b74e93e4 /SharedGraphics
parent53c69dbadee320b24d2ba1e44da5d987c252bb7a (diff)
downloadserenity-10d6f9ce317945020ef9451b433450e2ed6a2b14.zip
SharedGraphics: Removed some unused stuff from Font.
Diffstat (limited to 'SharedGraphics')
-rw-r--r--SharedGraphics/Font.cpp23
-rw-r--r--SharedGraphics/Font.h4
-rw-r--r--SharedGraphics/Painter.cpp1
3 files changed, 2 insertions, 26 deletions
diff --git a/SharedGraphics/Font.cpp b/SharedGraphics/Font.cpp
index 70e6a5d9dd..2dd0a1b2a8 100644
--- a/SharedGraphics/Font.cpp
+++ b/SharedGraphics/Font.cpp
@@ -9,21 +9,6 @@
#include <LibC/errno.h>
#include <LibC/mman.h>
-static const byte error_glyph_width = 8;
-static const byte error_glyph_height = 10;
-static constexpr const char* error_glyph {
- " #### "
- " # # "
- " # # "
- " # ## # "
- " # ## # "
- " #### "
- " ## "
- " ###### "
- " ## "
- " ## ",
-};
-
static Font* s_default_font;
static Font* s_default_bold_font;
@@ -36,11 +21,6 @@ struct [[gnu::packed]] FontFileHeader {
char name[64];
};
-static inline constexpr size_t font_file_size(unsigned glyph_height)
-{
- return sizeof(FontFileHeader) + 256 * sizeof(dword) * glyph_height;
-}
-
Font& Font::default_font()
{
static const char* default_font_path = "/res/fonts/LizaRegular8x10.font";
@@ -76,9 +56,6 @@ Font::Font(const String& name, unsigned* rows, byte glyph_width, byte glyph_heig
, m_glyph_width(glyph_width)
, m_glyph_height(glyph_height)
{
- ASSERT(m_glyph_width == error_glyph_width);
- ASSERT(m_glyph_height == error_glyph_height);
- m_error_bitmap = CharacterBitmap::create_from_ascii(error_glyph, error_glyph_width, error_glyph_height);
}
Font::~Font()
diff --git a/SharedGraphics/Font.h b/SharedGraphics/Font.h
index 05d89739fb..c72152dc60 100644
--- a/SharedGraphics/Font.h
+++ b/SharedGraphics/Font.h
@@ -1,6 +1,6 @@
#pragma once
-#include "CharacterBitmap.h"
+#include <SharedGraphics/Rect.h>
#include <AK/Retainable.h>
#include <AK/RetainPtr.h>
#include <AK/AKString.h>
@@ -69,8 +69,6 @@ private:
unsigned* m_rows { nullptr };
void* m_mmap_ptr { nullptr };
- RetainPtr<CharacterBitmap> m_error_bitmap;
-
byte m_glyph_width { 0 };
byte m_glyph_height { 0 };
};
diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp
index b811755d14..e8866b2f51 100644
--- a/SharedGraphics/Painter.cpp
+++ b/SharedGraphics/Painter.cpp
@@ -1,6 +1,7 @@
#include "Painter.h"
#include "Font.h"
#include "GraphicsBitmap.h"
+#include <SharedGraphics/CharacterBitmap.h>
#include <AK/Assertions.h>
#include <AK/StdLibExtras.h>