From d51d5f95913e92ba2c1e55dfe5f0a26ddb776712 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 18 Jan 2022 08:32:39 -0500 Subject: [PATCH] FontEditor: Retrieve code point abbreviations from LibUnicode Rather than using a hard-coded list from AK::UnicodeUtils, LibUnicode contains the up-to-date official names and contains abbreviations for more control code points. --- Userland/Applications/FontEditor/FontEditor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index c7d32c161b..8f52892d71 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -8,7 +8,6 @@ #include "GlyphEditorWidget.h" #include "NewFontDialog.h" #include -#include #include #include #include @@ -679,8 +678,8 @@ void FontEditorWidget::update_statusbar() StringBuilder builder; builder.appendff("U+{:04X} (", glyph); - if (AK::UnicodeUtils::is_unicode_control_code_point(glyph)) { - builder.append(AK::UnicodeUtils::get_unicode_control_code_point_alias(glyph).value()); + if (auto abbreviation = Unicode::code_point_abbreviation(glyph); abbreviation.has_value()) { + builder.append(*abbreviation); } else if (Gfx::get_char_bidi_class(glyph) == Gfx::BidirectionalClass::STRONG_RTL) { // FIXME: This is a necessary hack, as RTL text will mess up the painting of the statusbar text. // For now, replace RTL glyphs with U+FFFD, the replacement character.