summaryrefslogtreecommitdiff
path: root/Applications/FontEditor/FontEditor.cpp
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-09-04 23:50:40 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-09-05 16:37:39 +0200
commit22e6978c713cd9cb292fcb97b184d29980a33237 (patch)
tree154ca18a9ebaaa120170e88ad0bb2f1d8ad6e067 /Applications/FontEditor/FontEditor.cpp
parent84bc6a92a745fbaa6f54dbd54f0c0668f3f1a385 (diff)
downloadserenity-22e6978c713cd9cb292fcb97b184d29980a33237.zip
WindowServer+LibGUI+FontEditor: Encode special characters as UTF-8
Diffstat (limited to 'Applications/FontEditor/FontEditor.cpp')
-rw-r--r--Applications/FontEditor/FontEditor.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp
index 87113a4cae..0e22471127 100644
--- a/Applications/FontEditor/FontEditor.cpp
+++ b/Applications/FontEditor/FontEditor.cpp
@@ -2,6 +2,7 @@
#include "GlyphEditorWidget.h"
#include "GlyphMapWidget.h"
#include "UI_FontEditorBottom.h"
+#include <AK/StringBuilder.h>
#include <LibGUI/GButton.h>
#include <LibGUI/GCheckBox.h>
#include <LibGUI/GGroupBox.h>
@@ -77,7 +78,16 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_fon
m_glyph_map_widget->on_glyph_selected = [this](u8 glyph) {
m_glyph_editor_widget->set_glyph(glyph);
m_ui->width_spinbox->set_value(m_edited_font->glyph_width(m_glyph_map_widget->selected_glyph()));
- m_ui->info_label->set_text(String::format("0x%b (%c)", glyph, glyph));
+ StringBuilder builder;
+ builder.appendf("0x%b (", glyph);
+ if (glyph < 128) {
+ builder.append(glyph);
+ } else {
+ builder.append(128 | 64 | (glyph / 64));
+ builder.append(128 | (glyph % 64));
+ }
+ builder.append(')');
+ m_ui->info_label->set_text(builder.to_string());
};
m_ui->fixed_width_checkbox->on_checked = [this, update_demo](bool checked) {