mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +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
|
@ -19,9 +19,9 @@
|
|||
|
||||
Terminal::Terminal(int ptm_fd)
|
||||
: m_ptm_fd(ptm_fd)
|
||||
, m_font(Font::default_font())
|
||||
, m_notifier(ptm_fd, GNotifier::Read)
|
||||
{
|
||||
set_font(Font::default_fixed_width_font());
|
||||
m_notifier.on_ready_to_read = [this] (GNotifier& notifier) {
|
||||
byte buffer[BUFSIZ];
|
||||
ssize_t nread = read(notifier.fd(), buffer, sizeof(buffer));
|
||||
|
@ -798,7 +798,7 @@ void Terminal::force_repaint()
|
|||
|
||||
void Terminal::resize_event(GResizeEvent& event)
|
||||
{
|
||||
int new_columns = event.size().width() / m_font->glyph_width('x');
|
||||
int new_columns = event.size().width() / font().glyph_width('x');
|
||||
int new_rows = event.size().height() / m_line_height;
|
||||
set_size(new_columns, new_rows);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue