[gnome-characters/wip/exalm/unistring: 1/15] Stop handling wide chars




commit 1519c77f7024362adf43f97c52f743950168bcf8
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Nov 26 12:13:59 2021 +0500

    Stop handling wide chars
    
    We already default to 2-character bounding box, no need to make it even
    wider.

 lib/gc.c              | 12 ------------
 lib/gc.h              |  1 -
 src/charactersView.js |  3 ---
 3 files changed, 16 deletions(-)
---
diff --git a/lib/gc.c b/lib/gc.c
index d4b4c75..3caba22 100644
--- a/lib/gc.c
+++ b/lib/gc.c
@@ -572,18 +572,6 @@ gc_character_is_invisible (gunichar uc)
     || uc_is_property_zero_width (uc);
 }
 
-/**
- * gc_character_width:
- * @uc: a UCS-4 character
- *
- * Returns: column width of @uc, or -1 if @uc is a control character.
- */
-gint
-gc_character_width (gunichar uc)
-{
-  return uc_width (uc, "UTF-8");
-}
-
 G_DEFINE_QUARK (gc-search-error-quark, gc_search_error)
 
 G_DEFINE_BOXED_TYPE (GcSearchResult, gc_search_result,
diff --git a/lib/gc.h b/lib/gc.h
index 18238f5..884b2cd 100644
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -109,7 +109,6 @@ GcSearchResult       *gc_filter_characters  (GcCategory            category,
 gchar                *gc_character_name     (gunichar              uc);
 gboolean              gc_character_is_invisible
                                             (gunichar              uc);
-gint                  gc_character_width    (gunichar              uc);
 
 /* Pango support.  PangoAttrFallback is not accessible from GI.  */
 void                  gc_pango_layout_disable_fallback
diff --git a/src/charactersView.js b/src/charactersView.js
index 4b0d528..ea9ece5 100644
--- a/src/charactersView.js
+++ b/src/charactersView.js
@@ -109,9 +109,6 @@ const CharacterListRow = GObject.registerClass({
                 width: this._baseGlyphRect.width,
                 height: this._baseGlyphRect.height,
             });
-            let characterWidth = Gc.character_width(uc);
-            if (characterWidth > 1)
-                shapeRect.width *= characterWidth;
         }
 
         shapeRect.x = cellRect.x - shapeRect.x / Pango.SCALE + (cellRect.width - shapeRect.width / 
Pango.SCALE) / 2;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]