summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/font-variants.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2018-06-14 11:32:20 +0000
committerTavmjong Bah <tavmjong@free.fr>2018-06-14 11:32:20 +0000
commitfd911059106bb025c621b9f84437dc3fe65d7067 (patch)
treedff07532d2fe410c1392ba89c3f3ace7115881ac /src/ui/widget/font-variants.cpp
parentLimit style alternatives label width. (diff)
downloadinkscape-fd911059106bb025c621b9f84437dc3fe65d7067.tar.gz
inkscape-fd911059106bb025c621b9f84437dc3fe65d7067.zip
Create at least two radio buttons for a table.
Calculation of number of radio buttons to create could be "wrong" due to script and language tags of tables.
Diffstat (limited to 'src/ui/widget/font-variants.cpp')
-rw-r--r--src/ui/widget/font-variants.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp
index 144df39c3..4b46c4bb9 100644
--- a/src/ui/widget/font-variants.cpp
+++ b/src/ui/widget/font-variants.cpp
@@ -1080,6 +1080,13 @@ namespace Widget {
// Our lame attempt at determining number of alternative glyphs for one glyph:
int number = table.second.output.length() / table.second.input.length();
+ if (number < 1) {
+ number = 1; // Must have at least on/off, see comment above about 'lang' attribute.
+ // std::cout << table.first << " "
+ // << table.second.output.length() << "/"
+ // << table.second.input.length() << "="
+ // << number << std::endl;
+ }
_features[table.first] = new Feature (table.first, table.second, number+1,
sp_font_description_get_family(res->descr),