16#include <glibmm/i18n.h>
17#include <glibmm/markup.h>
18#include <glibmm/regex.h>
19#include <gtkmm/flowbox.h>
20#include <gtkmm/scrolledwindow.h>
23#include <sigc++/functors/mem_fun.h>
39 Feature(Glib::ustring
const &name,
OTSubstitution const &glyphs,
int options, Glib::ustring family, Gtk::Grid& grid,
int &row, FontVariants*
parent)
42 auto const table_name = Gtk::make_managed<Gtk::Label>();
43 table_name->set_markup (
"\"" + name +
"\" ");
45 grid.attach (*table_name, 0, row, 1, 1);
47 Gtk::FlowBox* flow_box =
nullptr;
48 Gtk::ScrolledWindow* scrolled_window =
nullptr;
52 flow_box = Gtk::make_managed<Gtk::FlowBox>();
53 flow_box->set_selection_mode();
54 flow_box->set_homogeneous();
55 flow_box->set_max_children_per_line (100);
56 flow_box->set_min_children_per_line (10);
60 scrolled_window = Gtk::make_managed<Gtk::ScrolledWindow>();
62 scrolled_window->set_child(*flow_box);
65 Gtk::CheckButton *group =
nullptr;
66 for (
int i = 0; i < options; ++i) {
68 auto const button = Gtk::make_managed<Gtk::CheckButton>();
72 button->set_group(*group);
75 buttons.push_back (button);
78 auto const label = Gtk::make_managed<Gtk::Label>();
81 label->set_wrap(
true );
82 label->set_wrap_mode( Pango::WrapMode::WORD_CHAR );
83 label->set_ellipsize( Pango::EllipsizeMode::END );
88 markup +=
"<span font_family='";
90 markup +=
"' font_features='";
93 markup += std::to_string (i);
95 markup += Glib::Markup::escape_text (glyphs.
input);
97 label->set_markup (markup);
102 grid.attach (*button, 2*i+1, row, 1, 1);
103 grid.attach (*label, 2*i+2, row, 1, 1);
108 auto const box = Gtk::make_managed<Gtk::Box>();
109 box->append(*button);
112 flow_box->append(*box);
116 if (scrolled_window) {
117 grid.attach (*scrolled_window, 1, row, 4, 1);
125 for (
auto b: buttons) {
126 if (b->get_active()) {
132 return (
"\"" + _name +
"\", ");
135 return (
"\"" + _name +
"\" " + std::to_string (i) +
", ");
146 if (i < buttons.size()) {
147 buttons[i]->set_active();
153 std::vector<Gtk::CheckButton *> buttons;
157 Gtk::Box (
Gtk::Orientation::VERTICAL),
158 _ligatures_frame (
Glib::ustring(C_(
"Font feature",
"Ligatures" )) ),
159 _ligatures_common (
Glib::ustring(C_(
"Font feature",
"Common" )) ),
160 _ligatures_discretionary (
Glib::ustring(C_(
"Font feature",
"Discretionary")) ),
161 _ligatures_historical (
Glib::ustring(C_(
"Font feature",
"Historical" )) ),
162 _ligatures_contextual (
Glib::ustring(C_(
"Font feature",
"Contextual" )) ),
164 _position_frame (
Glib::ustring(C_(
"Font feature",
"Position" )) ),
165 _position_normal (
Glib::ustring(C_(
"Font feature",
"Normal" )) ),
166 _position_sub (
Glib::ustring(C_(
"Font feature",
"Subscript" )) ),
167 _position_super (
Glib::ustring(C_(
"Font feature",
"Superscript" )) ),
169 _caps_frame (
Glib::ustring(C_(
"Font feature",
"Capitals" )) ),
170 _caps_normal (
Glib::ustring(C_(
"Font feature",
"Normal" )) ),
171 _caps_small (
Glib::ustring(C_(
"Font feature",
"Small" )) ),
172 _caps_all_small (
Glib::ustring(C_(
"Font feature",
"All small" )) ),
173 _caps_petite (
Glib::ustring(C_(
"Font feature",
"Petite" )) ),
174 _caps_all_petite (
Glib::ustring(C_(
"Font feature",
"All petite" )) ),
175 _caps_unicase (
Glib::ustring(C_(
"Font feature",
"Unicase" )) ),
176 _caps_titling (
Glib::ustring(C_(
"Font feature",
"Titling" )) ),
178 _numeric_frame (
Glib::ustring(C_(
"Font feature",
"Numeric" )) ),
179 _numeric_lining (
Glib::ustring(C_(
"Font feature",
"Lining" )) ),
180 _numeric_old_style (
Glib::ustring(C_(
"Font feature",
"Old Style" )) ),
181 _numeric_default_style (
Glib::ustring(C_(
"Font feature",
"Default Style")) ),
182 _numeric_proportional (
Glib::ustring(C_(
"Font feature",
"Proportional" )) ),
183 _numeric_tabular (
Glib::ustring(C_(
"Font feature",
"Tabular" )) ),
184 _numeric_default_width (
Glib::ustring(C_(
"Font feature",
"Default Width")) ),
185 _numeric_diagonal (
Glib::ustring(C_(
"Font feature",
"Diagonal" )) ),
186 _numeric_stacked (
Glib::ustring(C_(
"Font feature",
"Stacked" )) ),
187 _numeric_default_fractions(
Glib::ustring(C_(
"Font feature",
"Default Fractions")) ),
188 _numeric_ordinal (
Glib::ustring(C_(
"Font feature",
"Ordinal" )) ),
189 _numeric_slashed_zero (
Glib::ustring(C_(
"Font feature",
"Slashed Zero" )) ),
191 _asian_frame (
Glib::ustring(C_(
"Font feature",
"East Asian" )) ),
192 _asian_default_variant (
Glib::ustring(C_(
"Font feature",
"Default" )) ),
193 _asian_jis78 (
Glib::ustring(C_(
"Font feature",
"JIS78" )) ),
194 _asian_jis83 (
Glib::ustring(C_(
"Font feature",
"JIS83" )) ),
195 _asian_jis90 (
Glib::ustring(C_(
"Font feature",
"JIS90" )) ),
196 _asian_jis04 (
Glib::ustring(C_(
"Font feature",
"JIS04" )) ),
197 _asian_simplified (
Glib::ustring(C_(
"Font feature",
"Simplified" )) ),
198 _asian_traditional (
Glib::ustring(C_(
"Font feature",
"Traditional" )) ),
199 _asian_default_width (
Glib::ustring(C_(
"Font feature",
"Default" )) ),
200 _asian_full_width (
Glib::ustring(C_(
"Font feature",
"Full Width" )) ),
201 _asian_proportional_width (
Glib::ustring(C_(
"Font feature",
"Proportional" )) ),
202 _asian_ruby (
Glib::ustring(C_(
"Font feature",
"Ruby" )) ),
204 _feature_frame (
Glib::ustring(C_(
"Font feature",
"Feature Settings")) ),
205 _feature_label (
Glib::ustring(C_(
"Font feature",
"Selection has different Feature Settings!")) ),
207 _ligatures_changed( false ),
208 _position_changed( false ),
209 _caps_changed( false ),
210 _numeric_changed( false ),
211 _asian_changed( false ),
212 _feature_vbox(
Gtk::Orientation::VERTICAL)
216 set_name (
"FontVariants" );
222 _(
"Common ligatures. On by default. OpenType tables: 'liga', 'clig'"));
224 _(
"Discretionary ligatures. Off by default. OpenType table: 'dlig'"));
226 _(
"Historical ligatures. Off by default. OpenType table: 'hlig'"));
228 _(
"Contextual forms. On by default. OpenType table: 'calt'"));
237 Gtk::Label* labels[] = {
243 for (
auto label : labels) {
245 label->set_max_width_chars(999);
247 label->set_ellipsize(Pango::EllipsizeMode::END);
253 label->set_wrap_mode(Pango::WrapMode::WORD_CHAR);
284 _position_sub.set_tooltip_text( _(
"Subscript. OpenType table: 'subs'") );
285 _position_super.set_tooltip_text( _(
"Superscript. OpenType table: 'sups'") );
313 _caps_normal.set_tooltip_text( _(
"Normal capitalization."));
314 _caps_small.set_tooltip_text( _(
"Small-caps (lowercase). OpenType table: 'smcp'"));
315 _caps_all_small.set_tooltip_text( _(
"All small-caps (uppercase and lowercase). OpenType tables: 'c2sc' and 'smcp'"));
316 _caps_petite.set_tooltip_text( _(
"Petite-caps (lowercase). OpenType table: 'pcap'"));
317 _caps_all_petite.set_tooltip_text( _(
"All petite-caps (uppercase and lowercase). OpenType tables: 'c2sc' and 'pcap'"));
318 _caps_unicase.set_tooltip_text( _(
"Unicase (small caps for uppercase, normal for lowercase). OpenType table: 'unic'"));
319 _caps_titling.set_tooltip_text( _(
"Titling caps (lighter-weight uppercase for use in titles). OpenType table: 'titl'"));
360 _numeric_lining.set_tooltip_text( _(
"Lining numerals. OpenType table: 'lnum'"));
361 _numeric_old_style.set_tooltip_text( _(
"Old style numerals. OpenType table: 'onum'"));
364 _numeric_tabular.set_tooltip_text( _(
"Same width numerals. OpenType table: 'tnum'"));
366 _numeric_diagonal.set_tooltip_text( _(
"Diagonal fractions. OpenType table: 'frac'"));
367 _numeric_stacked.set_tooltip_text( _(
"Stacked fractions. OpenType table: 'afrc'"));
368 _numeric_ordinal.set_tooltip_text( _(
"Ordinals (raised 'th', etc.). OpenType table: 'ordn'"));
432 _asian_jis78.set_tooltip_text( _(
"JIS78 forms. OpenType table: 'jp78'."));
433 _asian_jis83.set_tooltip_text( _(
"JIS83 forms. OpenType table: 'jp83'."));
434 _asian_jis90.set_tooltip_text( _(
"JIS90 forms. OpenType table: 'jp90'."));
435 _asian_jis04.set_tooltip_text( _(
"JIS2004 forms. OpenType table: 'jp04'."));
436 _asian_simplified.set_tooltip_text( _(
"Simplified forms. OpenType table: 'smpl'."));
437 _asian_traditional.set_tooltip_text( _(
"Traditional forms. OpenType table: 'trad'."));
439 _asian_full_width.set_tooltip_text( _(
"Full width variants. OpenType table: 'fwid'."));
441 _asian_ruby.set_tooltip_text( _(
"Ruby variants. OpenType table: 'ruby'."));
491 _feature_entry.set_tooltip_text( _(
"Feature settings in CSS form (e.g. \"wxyz\" or \"wxyz\" 3)."));
720 Glib::MatchInfo matchInfo;
725 for (
auto const &token: Glib::Regex::split_simple(
"\\s*,\\s*", val)) {
726 regex->match(token, matchInfo);
727 if (matchInfo.matches()) {
728 Glib::ustring table = matchInfo.fetch(1);
731 Glib::ustring value = matchInfo.fetch(2);
734 if (value ==
"0" || value ==
"off")
v = 0;
735 else if (value ==
"1" || value ==
"on" || value.empty() )
v = 1;
736 else v = std::stoi(value);
740 setting += token +
", ";
747 if (setting.length() > 1) {
755 if( different_features ) {
770 auto const &tab = res->get_opentype_tables();
771 std::remove_reference<
decltype(tab)>::type::const_iterator it;
773 if((it = tab.find(
"liga"))!= tab.end() ||
774 (it = tab.find(
"clig"))!= tab.end()) {
780 if((it = tab.find(
"dlig"))!= tab.end()) {
786 if((it = tab.find(
"hlig"))!= tab.end()) {
792 if((it = tab.find(
"calt"))!= tab.end()) {
798 if((it = tab.find(
"subs"))!= tab.end()) {
804 if((it = tab.find(
"sups"))!= tab.end()) {
810 if((it = tab.find(
"smcp"))!= tab.end()) {
816 if((it = tab.find(
"c2sc"))!= tab.end() &&
817 (it = tab.find(
"smcp"))!= tab.end()) {
823 if((it = tab.find(
"pcap"))!= tab.end()) {
829 if((it = tab.find(
"c2sc"))!= tab.end() &&
830 (it = tab.find(
"pcap"))!= tab.end()) {
836 if((it = tab.find(
"unic"))!= tab.end()) {
842 if((it = tab.find(
"titl"))!= tab.end()) {
848 if((it = tab.find(
"lnum"))!= tab.end()) {
854 if((it = tab.find(
"onum"))!= tab.end()) {
860 if((it = tab.find(
"pnum"))!= tab.end()) {
866 if((it = tab.find(
"tnum"))!= tab.end()) {
872 if((it = tab.find(
"frac"))!= tab.end()) {
878 if((it = tab.find(
"afrac"))!= tab.end()) {
884 if((it = tab.find(
"ordn"))!= tab.end()) {
890 if((it = tab.find(
"zero"))!= tab.end()) {
897 if((it = tab.find(
"jp78"))!= tab.end()) {
903 if((it = tab.find(
"jp83"))!= tab.end()) {
909 if((it = tab.find(
"jp90"))!= tab.end()) {
915 if((it = tab.find(
"jp04"))!= tab.end()) {
921 if((it = tab.find(
"smpl"))!= tab.end()) {
927 if((it = tab.find(
"trad"))!= tab.end()) {
933 if((it = tab.find(
"fwid"))!= tab.end()) {
939 if((it = tab.find(
"pwid"))!= tab.end()) {
945 if((it = tab.find(
"ruby"))!= tab.end()) {
952 Glib::ustring markup_liga;
953 Glib::ustring markup_dlig;
954 Glib::ustring markup_hlig;
955 Glib::ustring markup_calt;
957 for (
auto &table : tab) {
958 if (table.first ==
"liga" ||
959 table.first ==
"clig" ||
960 table.first ==
"dlig" ||
961 table.first ==
"hgli" ||
962 table.first ==
"calt") {
964 Glib::ustring markup;
965 markup +=
"<span font_family='";
968 markup += Glib::Markup::escape_text(table.second.output);
971 if (table.first ==
"liga") markup_liga += markup;
972 if (table.first ==
"clig") markup_liga += markup;
973 if (table.first ==
"dlig") markup_dlig += markup;
974 if (table.first ==
"hlig") markup_hlig += markup;
975 if (table.first ==
"calt") markup_calt += markup;
985 Glib::ustring markup_lnum;
986 Glib::ustring markup_onum;
987 Glib::ustring markup_pnum;
988 Glib::ustring markup_tnum;
989 Glib::ustring markup_frac;
990 Glib::ustring markup_afrc;
991 Glib::ustring markup_ordn;
992 Glib::ustring markup_zero;
994 for (
auto &table : res->get_opentype_tables()) {
995 Glib::ustring markup;
996 markup +=
"<span font_family='";
998 markup +=
"' font_features='";
999 markup += table.first;
1001 if (table.first ==
"lnum" ||
1002 table.first ==
"onum" ||
1003 table.first ==
"pnum" ||
1004 table.first ==
"tnum") markup +=
"0123456789";
1005 if (table.first ==
"zero") markup +=
"0";
1006 if (table.first ==
"ordn") markup +=
"[" + table.second.before +
"]" + table.second.output;
1007 if (table.first ==
"frac" ||
1008 table.first ==
"afrc" ) markup +=
"1/2 2/3 3/4 4/5 5/6";
1009 markup +=
"</span>";
1011 if (table.first ==
"lnum") markup_lnum += markup;
1012 if (table.first ==
"onum") markup_onum += markup;
1013 if (table.first ==
"pnum") markup_pnum += markup;
1014 if (table.first ==
"tnum") markup_tnum += markup;
1015 if (table.first ==
"frac") markup_frac += markup;
1016 if (table.first ==
"afrc") markup_afrc += markup;
1017 if (table.first ==
"ordn") markup_ordn += markup;
1018 if (table.first ==
"zero") markup_zero += markup;
1031 auto table_copy = res->get_opentype_tables();
1032 if( (it = table_copy.find(
"liga")) != table_copy.end() ) table_copy.erase( it );
1033 if( (it = table_copy.find(
"clig")) != table_copy.end() ) table_copy.erase( it );
1034 if( (it = table_copy.find(
"dlig")) != table_copy.end() ) table_copy.erase( it );
1035 if( (it = table_copy.find(
"hlig")) != table_copy.end() ) table_copy.erase( it );
1036 if( (it = table_copy.find(
"calt")) != table_copy.end() ) table_copy.erase( it );
1038 if( (it = table_copy.find(
"subs")) != table_copy.end() ) table_copy.erase( it );
1039 if( (it = table_copy.find(
"sups")) != table_copy.end() ) table_copy.erase( it );
1041 if( (it = table_copy.find(
"smcp")) != table_copy.end() ) table_copy.erase( it );
1042 if( (it = table_copy.find(
"c2sc")) != table_copy.end() ) table_copy.erase( it );
1043 if( (it = table_copy.find(
"pcap")) != table_copy.end() ) table_copy.erase( it );
1044 if( (it = table_copy.find(
"c2pc")) != table_copy.end() ) table_copy.erase( it );
1045 if( (it = table_copy.find(
"unic")) != table_copy.end() ) table_copy.erase( it );
1046 if( (it = table_copy.find(
"titl")) != table_copy.end() ) table_copy.erase( it );
1048 if( (it = table_copy.find(
"lnum")) != table_copy.end() ) table_copy.erase( it );
1049 if( (it = table_copy.find(
"onum")) != table_copy.end() ) table_copy.erase( it );
1050 if( (it = table_copy.find(
"pnum")) != table_copy.end() ) table_copy.erase( it );
1051 if( (it = table_copy.find(
"tnum")) != table_copy.end() ) table_copy.erase( it );
1052 if( (it = table_copy.find(
"frac")) != table_copy.end() ) table_copy.erase( it );
1053 if( (it = table_copy.find(
"afrc")) != table_copy.end() ) table_copy.erase( it );
1054 if( (it = table_copy.find(
"ordn")) != table_copy.end() ) table_copy.erase( it );
1055 if( (it = table_copy.find(
"zero")) != table_copy.end() ) table_copy.erase( it );
1057 if( (it = table_copy.find(
"jp78")) != table_copy.end() ) table_copy.erase( it );
1058 if( (it = table_copy.find(
"jp83")) != table_copy.end() ) table_copy.erase( it );
1059 if( (it = table_copy.find(
"jp90")) != table_copy.end() ) table_copy.erase( it );
1060 if( (it = table_copy.find(
"jp04")) != table_copy.end() ) table_copy.erase( it );
1061 if( (it = table_copy.find(
"smpl")) != table_copy.end() ) table_copy.erase( it );
1062 if( (it = table_copy.find(
"trad")) != table_copy.end() ) table_copy.erase( it );
1063 if( (it = table_copy.find(
"fwid")) != table_copy.end() ) table_copy.erase( it );
1064 if( (it = table_copy.find(
"pwid")) != table_copy.end() ) table_copy.erase( it );
1065 if( (it = table_copy.find(
"ruby")) != table_copy.end() ) table_copy.erase( it );
1068 if( (it = table_copy.find(
"abvf")) != table_copy.end() ) table_copy.erase( it );
1069 if( (it = table_copy.find(
"abvs")) != table_copy.end() ) table_copy.erase( it );
1070 if( (it = table_copy.find(
"akhn")) != table_copy.end() ) table_copy.erase( it );
1071 if( (it = table_copy.find(
"blwf")) != table_copy.end() ) table_copy.erase( it );
1072 if( (it = table_copy.find(
"blws")) != table_copy.end() ) table_copy.erase( it );
1073 if( (it = table_copy.find(
"ccmp")) != table_copy.end() ) table_copy.erase( it );
1074 if( (it = table_copy.find(
"cjct")) != table_copy.end() ) table_copy.erase( it );
1075 if( (it = table_copy.find(
"dnom")) != table_copy.end() ) table_copy.erase( it );
1076 if( (it = table_copy.find(
"dtls")) != table_copy.end() ) table_copy.erase( it );
1077 if( (it = table_copy.find(
"fina")) != table_copy.end() ) table_copy.erase( it );
1078 if( (it = table_copy.find(
"half")) != table_copy.end() ) table_copy.erase( it );
1079 if( (it = table_copy.find(
"haln")) != table_copy.end() ) table_copy.erase( it );
1080 if( (it = table_copy.find(
"init")) != table_copy.end() ) table_copy.erase( it );
1081 if( (it = table_copy.find(
"isol")) != table_copy.end() ) table_copy.erase( it );
1082 if( (it = table_copy.find(
"locl")) != table_copy.end() ) table_copy.erase( it );
1083 if( (it = table_copy.find(
"medi")) != table_copy.end() ) table_copy.erase( it );
1084 if( (it = table_copy.find(
"nukt")) != table_copy.end() ) table_copy.erase( it );
1085 if( (it = table_copy.find(
"numr")) != table_copy.end() ) table_copy.erase( it );
1086 if( (it = table_copy.find(
"pref")) != table_copy.end() ) table_copy.erase( it );
1087 if( (it = table_copy.find(
"pres")) != table_copy.end() ) table_copy.erase( it );
1088 if( (it = table_copy.find(
"pstf")) != table_copy.end() ) table_copy.erase( it );
1089 if( (it = table_copy.find(
"psts")) != table_copy.end() ) table_copy.erase( it );
1090 if( (it = table_copy.find(
"rlig")) != table_copy.end() ) table_copy.erase( it );
1091 if( (it = table_copy.find(
"rkrf")) != table_copy.end() ) table_copy.erase( it );
1092 if( (it = table_copy.find(
"rphf")) != table_copy.end() ) table_copy.erase( it );
1093 if( (it = table_copy.find(
"rtlm")) != table_copy.end() ) table_copy.erase( it );
1094 if( (it = table_copy.find(
"ssty")) != table_copy.end() ) table_copy.erase( it );
1095 if( (it = table_copy.find(
"vatu")) != table_copy.end() ) table_copy.erase( it );
1105 for (
auto &table: res->get_opentype_tables()) {
1106 if (table.first ==
"case" ||
1107 table.first ==
"hist" ||
1108 (table.first[0] ==
's' && table.first[1] ==
's' && !(table.first[2] ==
't'))) {
1110 if( (it = table_copy.find(table.first)) != table_copy.end() ) table_copy.erase( it );
1112 _features[table.first] =
new Feature (table.first, table.second, 2,
1120 for (
auto &table : res->get_opentype_tables()) {
1121 if (table.first ==
"salt" ||
1122 table.first ==
"swsh" ||
1123 table.first ==
"cwsh" ||
1124 table.first ==
"ornm" ||
1125 table.first ==
"nalt" ||
1126 (table.first[0] ==
'c' && table.first[1] ==
'v')) {
1128 if (table.second.input.length() == 0) {
1136 if( (it = table_copy.find(table.first)) != table_copy.end() ) table_copy.erase( it );
1139 int number = table.second.output.length() / table.second.input.length();
1148 _features[table.first] =
new Feature (table.first, table.second, number+1,
1157 std::string ott_list =
"OpenType tables not included above: ";
1158 for(it = table_copy.begin(); it != table_copy.end(); ++it) {
1159 ott_list += it->first;
1163 if (table_copy.size() > 0) {
1164 ott_list.pop_back();
1165 ott_list.pop_back();
1172 std::cerr <<
"FontVariants::update(): Couldn't find FontInstance for: "
1173 << font_spec.raw() << std::endl;
1192 if( !common && !discretionary && !historical && !contextual ) {
1194 }
else if ( common && !discretionary && !historical && contextual ) {
1197 Glib::ustring css_string;
1199 css_string +=
"no-common-ligatures ";
1200 if ( discretionary )
1201 css_string +=
"discretionary-ligatures ";
1203 css_string +=
"historical-ligatures ";
1205 css_string +=
"no-contextual ";
1212 Glib::ustring css_string;
1214 css_string =
"normal";
1219 css_string =
"super";
1232 Glib::ustring css_string;
1234 css_string =
"normal";
1237 css_string =
"small-caps";
1240 css_string =
"all-small-caps";
1243 css_string =
"petite";
1246 css_string =
"all-petite";
1249 css_string =
"unicase";
1252 css_string =
"titling";
1280 if (default_style & default_width & default_fractions & !ordinal & !slashed_zero) {
1283 Glib::ustring css_string;
1285 css_string +=
"lining-nums ";
1287 css_string +=
"oldstyle-nums ";
1289 css_string +=
"proportional-nums ";
1291 css_string +=
"tabular-nums ";
1293 css_string +=
"diagonal-fractions ";
1295 css_string +=
"stacked-fractions ";
1297 css_string +=
"ordinal ";
1299 css_string +=
"slashed-zero ";
1315 if (default_style & asian_width & !ruby) {
1318 Glib::ustring css_string;
1319 if (jis78) css_string +=
"jis78 ";
1320 if (jis83) css_string +=
"jis83 ";
1321 if (jis90) css_string +=
"jis90 ";
1322 if (jis04) css_string +=
"jis04 ";
1323 if (simplified) css_string +=
"simplfied ";
1324 if (traditional) css_string +=
"traditional ";
1326 if (fwid) css_string +=
"fwid ";
1327 if (pwid) css_string +=
"pwid ";
1329 if (ruby) css_string +=
"ruby ";
1335 Glib::ustring feature_string;
1337 feature_string += i.second->get_css();
1343 if (!feature_string.empty()) {
1353 Glib::ustring markup;
1361 if (!common) markup +=
"liga=0,clig=0,";
1362 if (discretionary) markup +=
"dlig=1,";
1363 if (historical) markup +=
"hlig=1,";
1364 if (contextual) markup +=
"calt=1,";
1371 if (
_caps_small.get_active() ) markup +=
"smcp=1,";
1373 else if (
_caps_petite.get_active() ) markup +=
"pcap=1,";
1391 if (lining) markup +=
"lnum=1,";
1392 if (old_style) markup +=
"onum=1,";
1393 if (proportional) markup +=
"pnum=1,";
1394 if (tabular) markup +=
"tnum=1,";
1395 if (diagonal) markup +=
"frac=1,";
1396 if (stacked) markup +=
"afrc=1,";
1397 if (ordinal) markup +=
"ordn=1,";
1398 if (slashed_zero) markup +=
"zero=1,";
1412 if (jis78 ) markup +=
"jp78=1,";
1413 if (jis83 ) markup +=
"jp83=1,";
1414 if (jis90 ) markup +=
"jp90=1,";
1415 if (jis04 ) markup +=
"jp04=1,";
1416 if (simplified ) markup +=
"smpl=1,";
1417 if (traditional ) markup +=
"trad=1,";
1419 if (fwid ) markup +=
"fwid=1,";
1420 if (pwid ) markup +=
"pwid=1,";
1422 if (ruby ) markup +=
"ruby=1,";
1425 Glib::ustring feature_string;
1427 feature_string += i.second->get_css();
1431 if (!feature_string.empty()) {
1432 markup += feature_string;
static FontFactory & get()
Returns the static instance.
std::shared_ptr< FontInstance > FaceFromFontSpecification(char const *fontSpecification)
T< SPAttr::FONT_VARIANT_EAST_ASIAN, SPIEastAsian > font_variant_east_asian
Font variant East Asian.
T< SPAttr::FONT_FEATURE_SETTINGS, SPIString > font_feature_settings
Font feature settings (Low level access to TrueType tables)
T< SPAttr::FONT_VARIANT_NUMERIC, SPINumeric > font_variant_numeric
Font variant numeric (numerical formatting)
T< SPAttr::FONT_VARIANT_CAPS, SPIEnum< SPCSSFontVariantCaps > > font_variant_caps
Font variant caps (small caps)
T< SPAttr::FONT_VARIANT_POSITION, SPIEnum< SPCSSFontVariantPosition > > font_variant_position
Font variant position (subscript/superscript)
T< SPAttr::FONT_VARIANT_LIGATURES, SPILigatures > font_variant_ligatures
Font variant ligatures.
std::shared_ptr< Css const > css
Editable view implementation.
char const * sp_font_description_get_family(PangoFontDescription const *fontDescr)
TODO: insert short description here.
The data describing a single loaded font.
void remove_all_children(Widget &widget)
For each child in get_children(widget), call widget.remove(*child). May not cause delete child!
void pack_start(Gtk::Box &box, Gtk::Widget &child, bool const expand, bool const fill, unsigned const padding)
Adds child to box, packed with reference to the start of box.
Helpers for using Gtk::Boxes, encapsulating large changes between GTK3 & GTK4.
void sp_repr_css_unset_property(SPCSSAttr *css, gchar const *name)
Set a style property to "inkscape:unset".
void sp_repr_css_set_property(SPCSSAttr *css, gchar const *name, gchar const *value)
Set a style property to a new value (e.g.
@ SP_CSS_FONT_VARIANT_LIGATURES_CONTEXTUAL
@ SP_CSS_FONT_VARIANT_LIGATURES_DISCRETIONARY
@ SP_CSS_FONT_VARIANT_LIGATURES_HISTORICAL
@ SP_CSS_FONT_VARIANT_LIGATURES_COMMON
@ SP_CSS_FONT_VARIANT_NUMERIC_TABULAR_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_STACKED_FRACTIONS
@ SP_CSS_FONT_VARIANT_NUMERIC_OLDSTYLE_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_SLASHED_ZERO
@ SP_CSS_FONT_VARIANT_NUMERIC_DIAGONAL_FRACTIONS
@ SP_CSS_FONT_VARIANT_NUMERIC_PROPORTIONAL_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_ORDINAL
@ SP_CSS_FONT_VARIANT_NUMERIC_LINING_NUMS
@ SP_CSS_FONT_VARIANT_CAPS_ALL_SMALL
@ SP_CSS_FONT_VARIANT_CAPS_SMALL
@ SP_CSS_FONT_VARIANT_CAPS_ALL_PETITE
@ SP_CSS_FONT_VARIANT_CAPS_NORMAL
@ SP_CSS_FONT_VARIANT_CAPS_UNICASE
@ SP_CSS_FONT_VARIANT_CAPS_TITLING
@ SP_CSS_FONT_VARIANT_CAPS_PETITE
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_RUBY
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS04
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_PROPORTIONAL_WIDTH
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS78
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS90
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS83
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED
@ SP_CSS_FONT_VARIANT_POSITION_SUB
@ SP_CSS_FONT_VARIANT_POSITION_SUPER
@ SP_CSS_FONT_VARIANT_POSITION_NORMAL