From 997fc723dee196fded53b1dcee62be4b8e997e0b Mon Sep 17 00:00:00 2001 From: Dmitry Sapozhnikov <11535558+o-sdn-o@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:50:46 +0500 Subject: [PATCH] #571 WIP: Refactoring --- src/netxs/desktopio/gui.hpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/netxs/desktopio/gui.hpp b/src/netxs/desktopio/gui.hpp index 2051ce14f..50b7f3e49 100644 --- a/src/netxs/desktopio/gui.hpp +++ b/src/netxs/desktopio/gui.hpp @@ -733,13 +733,6 @@ namespace netxs::gui log("%%No fonts found in the system.", prompt::gui); return fallback.emplace_back(); // Should never happen. } - auto& take_font(utfx codepoint, si32 format, bool& isok) - { - auto& f = take_font(codepoint); - fontshaper.faceinst = f.fontface[format].faceinst; - if (fontshaper.faceinst) isok = true; - return f; - } fonts(std::list& family_names, si32 cell_height) : oslocale(LOCALE_NAME_MAX_LENGTH, '\0') @@ -874,7 +867,7 @@ namespace netxs::gui shaper fontshaper{ *this }; fonts(std::list& /*family_names*/, si32 /*cell_height*/) { } - auto& take_font(utfx /*base_char*/, si32 /*format*/, bool& /*isok*/) + auto& take_font(utfx /*base_char*/) { return fallback.front(); } @@ -1029,9 +1022,9 @@ namespace netxs::gui if (c.itc()) format |= fonts::style::italic; if (c.bld()) format |= fonts::style::bold; auto base_char = codepoints.front().cdpoint; - auto isok = faux; - auto& f = fcache.take_font(base_char, format, isok); - if (!isok) return; + auto& f = fcache.take_font(base_char); + fcache.fontshaper.faceinst = f.fontface[format].faceinst; + if (!fcache.fontshaper.faceinst) return; auto is_box_drawing = base_char >= 0x2320 && (base_char <= 0x23D0 // ⌠ ⌡ ... ⎛ ⎜ ⎝ ⎞ ⎟ ⎠ ⎡ ⎢ ⎣ ⎤ ⎥ ⎦ ⎧ ⎨ ⎩ ⎪ ⎫ ⎬ ⎭ ⎮ ⎯ ⎰ ⎱ ⎲ ⎳ ⎴ ⎵ ⎶ ⎷ ⎸ ⎹ ... ⏐ || (base_char >= 0x2500 && (base_char < 0x259F // Box Elements