mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
More work on the variable-width font support.
Katica is now the default system font, and it looks quite nice. :^) I'm gonna need to refine the GTextBox movement stuff eventually, but it works well-enough for basic editing now.
This commit is contained in:
@@ -9,9 +9,6 @@
|
||||
#include <LibC/errno.h>
|
||||
#include <LibC/mman.h>
|
||||
|
||||
static Font* s_default_font;
|
||||
static Font* s_default_bold_font;
|
||||
|
||||
struct [[gnu::packed]] FontFileHeader {
|
||||
char magic[4];
|
||||
byte glyph_width;
|
||||
@@ -24,7 +21,8 @@ struct [[gnu::packed]] FontFileHeader {
|
||||
|
||||
Font& Font::default_font()
|
||||
{
|
||||
static const char* default_font_path = "/res/fonts/CsillaThin7x10.font";
|
||||
static Font* s_default_font;
|
||||
static const char* default_font_path = "/res/fonts/Katica10.font";
|
||||
if (!s_default_font) {
|
||||
s_default_font = Font::load_from_file(default_font_path).leak_ref();
|
||||
ASSERT(s_default_font);
|
||||
@@ -32,8 +30,20 @@ Font& Font::default_font()
|
||||
return *s_default_font;
|
||||
}
|
||||
|
||||
Font& Font::default_fixed_width_font()
|
||||
{
|
||||
static Font* s_default_fixed_width_font;
|
||||
static const char* default_fixed_width_font_path = "/res/fonts/CsillaThin7x10.font";
|
||||
if (!s_default_fixed_width_font) {
|
||||
s_default_fixed_width_font = Font::load_from_file(default_fixed_width_font_path).leak_ref();
|
||||
ASSERT(s_default_fixed_width_font);
|
||||
}
|
||||
return *s_default_fixed_width_font;
|
||||
}
|
||||
|
||||
Font& Font::default_bold_font()
|
||||
{
|
||||
static Font* s_default_bold_font;
|
||||
static const char* default_bold_font_path = "/res/fonts/CsillaBold7x10.font";
|
||||
if (!s_default_bold_font) {
|
||||
s_default_bold_font = Font::load_from_file(default_bold_font_path).leak_ref();
|
||||
|
||||
Reference in New Issue
Block a user