summaryrefslogtreecommitdiff
path: root/lib/gui
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-04-30 20:07:36 +0200
committerGitHub <noreply@github.com>2024-04-30 20:07:36 +0200
commit4c7533d8c3d361820faddcd83ce614276b3a82d9 (patch)
tree96e8a48e092cef672ceec00429f560c4d675188c /lib/gui
parent7f8cfca5fea4f729922376e95dc5c500dc5dd6d3 (diff)
add outdated glyphlist warning (#2862)
Diffstat (limited to 'lib/gui')
-rw-r--r--lib/gui/lettering_font_sample.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/gui/lettering_font_sample.py b/lib/gui/lettering_font_sample.py
index cb0df222..c9cc4ddd 100644
--- a/lib/gui/lettering_font_sample.py
+++ b/lib/gui/lettering_font_sample.py
@@ -5,6 +5,7 @@
import wx
import wx.adv
+from inkex import errormsg
from ..i18n import _
from ..lettering import get_font_list
@@ -147,8 +148,23 @@ class FontSampleFrame(wx.Frame):
text = ''
width = 0
last_glyph = None
+ printed_warning = False
+ update_glyphlist_warning = _(
+ "The glyphlist for this font seems to be outdated.\n\n"
+ "Please update the glyph list for %s:\n"
+ "Extensions > Ink/Stitch > Font Management > Update Glyphlist"
+ % font.marked_custom_font_name
+ )
+ if len(font.available_glyphs) != len(font_variant.glyphs):
+ errormsg(update_glyphlist_warning)
+ printed_warning = True
for glyph in font.available_glyphs:
glyph_obj = font_variant[glyph]
+ if glyph_obj is None:
+ if not printed_warning:
+ errormsg(update_glyphlist_warning)
+ printed_warning = True
+ continue
if last_glyph is not None:
width_to_add = (glyph_obj.min_x - font.kerning_pairs.get(last_glyph + glyph, 0)) * scale
width += width_to_add