mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:32:06 +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:
parent
e53cef02d5
commit
66a5ddd94a
12 changed files with 125 additions and 30 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue