mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 19:27:35 +00:00
SharedGraphics: Removed some unused stuff from Font.
This commit is contained in:
parent
53c69dbade
commit
10d6f9ce31
4 changed files with 3 additions and 26 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include <LibGUI/GScrollBar.h>
|
#include <LibGUI/GScrollBar.h>
|
||||||
#include <LibGUI/GStyle.h>
|
#include <LibGUI/GStyle.h>
|
||||||
|
#include <SharedGraphics/CharacterBitmap.h>
|
||||||
#include <SharedGraphics/GraphicsBitmap.h>
|
#include <SharedGraphics/GraphicsBitmap.h>
|
||||||
#include <SharedGraphics/Painter.h>
|
#include <SharedGraphics/Painter.h>
|
||||||
|
|
||||||
|
|
|
@ -9,21 +9,6 @@
|
||||||
#include <LibC/errno.h>
|
#include <LibC/errno.h>
|
||||||
#include <LibC/mman.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_font;
|
||||||
static Font* s_default_bold_font;
|
static Font* s_default_bold_font;
|
||||||
|
|
||||||
|
@ -36,11 +21,6 @@ struct [[gnu::packed]] FontFileHeader {
|
||||||
char name[64];
|
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()
|
Font& Font::default_font()
|
||||||
{
|
{
|
||||||
static const char* default_font_path = "/res/fonts/LizaRegular8x10.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_width(glyph_width)
|
||||||
, m_glyph_height(glyph_height)
|
, 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()
|
Font::~Font()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CharacterBitmap.h"
|
#include <SharedGraphics/Rect.h>
|
||||||
#include <AK/Retainable.h>
|
#include <AK/Retainable.h>
|
||||||
#include <AK/RetainPtr.h>
|
#include <AK/RetainPtr.h>
|
||||||
#include <AK/AKString.h>
|
#include <AK/AKString.h>
|
||||||
|
@ -69,8 +69,6 @@ private:
|
||||||
unsigned* m_rows { nullptr };
|
unsigned* m_rows { nullptr };
|
||||||
void* m_mmap_ptr { nullptr };
|
void* m_mmap_ptr { nullptr };
|
||||||
|
|
||||||
RetainPtr<CharacterBitmap> m_error_bitmap;
|
|
||||||
|
|
||||||
byte m_glyph_width { 0 };
|
byte m_glyph_width { 0 };
|
||||||
byte m_glyph_height { 0 };
|
byte m_glyph_height { 0 };
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "Painter.h"
|
#include "Painter.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "GraphicsBitmap.h"
|
#include "GraphicsBitmap.h"
|
||||||
|
#include <SharedGraphics/CharacterBitmap.h>
|
||||||
#include <AK/Assertions.h>
|
#include <AK/Assertions.h>
|
||||||
#include <AK/StdLibExtras.h>
|
#include <AK/StdLibExtras.h>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue