13#include <glibmm/i18n.h>
14#include <glibmm/markup.h>
15#include <glibmm/regex.h>
16#include <gtkmm/flowbox.h>
17#include <gtkmm/scrolledwindow.h>
35 Feature(Glib::ustring
const &
name,
OTSubstitution const &glyphs,
int options, Glib::ustring family, Gtk::Grid& grid,
int &row, FontVariants*
parent)
38 auto const table_name = Gtk::make_managed<Gtk::Label>();
39 table_name->set_markup (
"\"" +
name +
"\" ");
41 grid.attach (*table_name, 0, row, 1, 1);
43 Gtk::FlowBox* flow_box =
nullptr;
44 Gtk::ScrolledWindow* scrolled_window =
nullptr;
48 flow_box = Gtk::make_managed<Gtk::FlowBox>();
49 flow_box->set_selection_mode();
50 flow_box->set_homogeneous();
51 flow_box->set_max_children_per_line (100);
52 flow_box->set_min_children_per_line (10);
56 scrolled_window = Gtk::make_managed<Gtk::ScrolledWindow>();
57 scrolled_window->set_policy (Gtk::PolicyType::NEVER, Gtk::PolicyType::AUTOMATIC);
58 scrolled_window->set_child(*flow_box);
61 Gtk::CheckButton *group =
nullptr;
62 for (
int i = 0; i < options; ++i) {
64 auto const button = Gtk::make_managed<Gtk::CheckButton>();
68 button->set_group(*group);
71 buttons.push_back (button);
74 auto const label = Gtk::make_managed<Gtk::Label>();
77 label->set_wrap(
true );
78 label->set_wrap_mode( Pango::WrapMode::WORD_CHAR );
79 label->set_ellipsize( Pango::EllipsizeMode::END );
84 markup +=
"<span font_family='";
86 markup +=
"' font_features='";
89 markup += std::to_string (i);
91 markup += Glib::Markup::escape_text (glyphs.
input);
93 label->set_markup (markup);
98 grid.attach (*button, 2*i+1, row, 1, 1);
99 grid.attach (*
label, 2*i+2, row, 1, 1);
104 auto const box = Gtk::make_managed<Gtk::Box>();
105 box->append(*button);
108 flow_box->append(*box);
112 if (scrolled_window) {
113 grid.attach (*scrolled_window, 1, row, 4, 1);
121 for (
auto b: buttons) {
122 if (b->get_active()) {
128 return (
"\"" + _name +
"\", ");
131 return (
"\"" + _name +
"\" " + std::to_string (i) +
", ");
142 if (i < buttons.size()) {
143 buttons[i]->set_active();
149 std::vector<Gtk::CheckButton *> buttons;
154 _ligatures_frame (
Glib::ustring(C_(
"Font feature",
"Ligatures" )) ),
155 _ligatures_common (
Glib::ustring(C_(
"Font feature",
"Common" )) ),
156 _ligatures_discretionary (
Glib::ustring(C_(
"Font feature",
"Discretionary")) ),
157 _ligatures_historical (
Glib::ustring(C_(
"Font feature",
"Historical" )) ),
158 _ligatures_contextual (
Glib::ustring(C_(
"Font feature",
"Contextual" )) ),
160 _position_frame (
Glib::ustring(C_(
"Font feature",
"Position" )) ),
161 _position_normal (
Glib::ustring(C_(
"Font feature",
"Normal" )) ),
162 _position_sub (
Glib::ustring(C_(
"Font feature",
"Subscript" )) ),
163 _position_super (
Glib::ustring(C_(
"Font feature",
"Superscript" )) ),
165 _caps_frame (
Glib::ustring(C_(
"Font feature",
"Capitals" )) ),
166 _caps_normal (
Glib::ustring(C_(
"Font feature",
"Normal" )) ),
167 _caps_small (
Glib::ustring(C_(
"Font feature",
"Small" )) ),
168 _caps_all_small (
Glib::ustring(C_(
"Font feature",
"All small" )) ),
169 _caps_petite (
Glib::ustring(C_(
"Font feature",
"Petite" )) ),
170 _caps_all_petite (
Glib::ustring(C_(
"Font feature",
"All petite" )) ),
171 _caps_unicase (
Glib::ustring(C_(
"Font feature",
"Unicase" )) ),
172 _caps_titling (
Glib::ustring(C_(
"Font feature",
"Titling" )) ),
174 _numeric_frame (
Glib::ustring(C_(
"Font feature",
"Numeric" )) ),
175 _numeric_lining (
Glib::ustring(C_(
"Font feature",
"Lining" )) ),
176 _numeric_old_style (
Glib::ustring(C_(
"Font feature",
"Old Style" )) ),
177 _numeric_default_style (
Glib::ustring(C_(
"Font feature",
"Default Style")) ),
178 _numeric_proportional (
Glib::ustring(C_(
"Font feature",
"Proportional" )) ),
179 _numeric_tabular (
Glib::ustring(C_(
"Font feature",
"Tabular" )) ),
180 _numeric_default_width (
Glib::ustring(C_(
"Font feature",
"Default Width")) ),
181 _numeric_diagonal (
Glib::ustring(C_(
"Font feature",
"Diagonal" )) ),
182 _numeric_stacked (
Glib::ustring(C_(
"Font feature",
"Stacked" )) ),
183 _numeric_default_fractions(
Glib::ustring(C_(
"Font feature",
"Default Fractions")) ),
184 _numeric_ordinal (
Glib::ustring(C_(
"Font feature",
"Ordinal" )) ),
185 _numeric_slashed_zero (
Glib::ustring(C_(
"Font feature",
"Slashed Zero" )) ),
187 _asian_frame (
Glib::ustring(C_(
"Font feature",
"East Asian" )) ),
188 _asian_default_variant (
Glib::ustring(C_(
"Font feature",
"Default" )) ),
189 _asian_jis78 (
Glib::ustring(C_(
"Font feature",
"JIS78" )) ),
190 _asian_jis83 (
Glib::ustring(C_(
"Font feature",
"JIS83" )) ),
191 _asian_jis90 (
Glib::ustring(C_(
"Font feature",
"JIS90" )) ),
192 _asian_jis04 (
Glib::ustring(C_(
"Font feature",
"JIS04" )) ),
193 _asian_simplified (
Glib::ustring(C_(
"Font feature",
"Simplified" )) ),
194 _asian_traditional (
Glib::ustring(C_(
"Font feature",
"Traditional" )) ),
195 _asian_default_width (
Glib::ustring(C_(
"Font feature",
"Default" )) ),
196 _asian_full_width (
Glib::ustring(C_(
"Font feature",
"Full Width" )) ),
197 _asian_proportional_width (
Glib::ustring(C_(
"Font feature",
"Proportional" )) ),
198 _asian_ruby (
Glib::ustring(C_(
"Font feature",
"Ruby" )) ),
200 _feature_frame (
Glib::ustring(C_(
"Font feature",
"Feature Settings")) ),
201 _feature_label (
Glib::ustring(C_(
"Font feature",
"Selection has different Feature Settings!")) ),
203 _ligatures_changed( false ),
204 _position_changed( false ),
205 _caps_changed( false ),
206 _numeric_changed( false ),
207 _asian_changed( false ),
212 set_name (
"FontVariants" );
218 _(
"Common ligatures. On by default. OpenType tables: 'liga', 'clig'"));
220 _(
"Discretionary ligatures. Off by default. OpenType table: 'dlig'"));
222 _(
"Historical ligatures. Off by default. OpenType table: 'hlig'"));
224 _(
"Contextual forms. On by default. OpenType table: 'calt'"));
233 Gtk::Label* labels[] = {
239 for (
auto label : labels) {
241 label->set_max_width_chars(999);
243 label->set_ellipsize(Pango::EllipsizeMode::END);
249 label->set_wrap_mode(Pango::WrapMode::WORD_CHAR);
280 _position_sub.set_tooltip_text( _(
"Subscript. OpenType table: 'subs'") );
281 _position_super.set_tooltip_text( _(
"Superscript. OpenType table: 'sups'") );
309 _caps_normal.set_tooltip_text( _(
"Normal capitalization."));
310 _caps_small.set_tooltip_text( _(
"Small-caps (lowercase). OpenType table: 'smcp'"));
311 _caps_all_small.set_tooltip_text( _(
"All small-caps (uppercase and lowercase). OpenType tables: 'c2sc' and 'smcp'"));
312 _caps_petite.set_tooltip_text( _(
"Petite-caps (lowercase). OpenType table: 'pcap'"));
313 _caps_all_petite.set_tooltip_text( _(
"All petite-caps (uppercase and lowercase). OpenType tables: 'c2sc' and 'pcap'"));
314 _caps_unicase.set_tooltip_text( _(
"Unicase (small caps for uppercase, normal for lowercase). OpenType table: 'unic'"));
315 _caps_titling.set_tooltip_text( _(
"Titling caps (lighter-weight uppercase for use in titles). OpenType table: 'titl'"));
356 _numeric_lining.set_tooltip_text( _(
"Lining numerals. OpenType table: 'lnum'"));
357 _numeric_old_style.set_tooltip_text( _(
"Old style numerals. OpenType table: 'onum'"));
360 _numeric_tabular.set_tooltip_text( _(
"Same width numerals. OpenType table: 'tnum'"));
362 _numeric_diagonal.set_tooltip_text( _(
"Diagonal fractions. OpenType table: 'frac'"));
363 _numeric_stacked.set_tooltip_text( _(
"Stacked fractions. OpenType table: 'afrc'"));
364 _numeric_ordinal.set_tooltip_text( _(
"Ordinals (raised 'th', etc.). OpenType table: 'ordn'"));
428 _asian_jis78.set_tooltip_text( _(
"JIS78 forms. OpenType table: 'jp78'."));
429 _asian_jis83.set_tooltip_text( _(
"JIS83 forms. OpenType table: 'jp83'."));
430 _asian_jis90.set_tooltip_text( _(
"JIS90 forms. OpenType table: 'jp90'."));
431 _asian_jis04.set_tooltip_text( _(
"JIS2004 forms. OpenType table: 'jp04'."));
432 _asian_simplified.set_tooltip_text( _(
"Simplified forms. OpenType table: 'smpl'."));
433 _asian_traditional.set_tooltip_text( _(
"Traditional forms. OpenType table: 'trad'."));
435 _asian_full_width.set_tooltip_text( _(
"Full width variants. OpenType table: 'fwid'."));
437 _asian_ruby.set_tooltip_text( _(
"Ruby variants. OpenType table: 'ruby'."));
487 _feature_entry.set_tooltip_text( _(
"Feature settings in CSS form (e.g. \"wxyz\" or \"wxyz\" 3)."));
715 Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(
"\"(\\w{4})\"\\s*([0-9]+|on|off|)");
716 Glib::MatchInfo matchInfo;
721 for (
auto const &token: Glib::Regex::split_simple(
"\\s*,\\s*", val)) {
722 regex->match(token, matchInfo);
723 if (matchInfo.matches()) {
724 Glib::ustring table = matchInfo.fetch(1);
727 Glib::ustring value = matchInfo.fetch(2);
730 if (value ==
"0" || value ==
"off") v = 0;
731 else if (value ==
"1" || value ==
"on" || value.empty() ) v = 1;
732 else v = std::stoi(value);
736 setting += token +
", ";
743 if (setting.length() > 1) {
751 if( different_features ) {
766 auto const &tab = res->get_opentype_tables();
767 std::remove_reference<
decltype(tab)>::type::const_iterator it;
769 if((it = tab.find(
"liga"))!= tab.end() ||
770 (it = tab.find(
"clig"))!= tab.end()) {
776 if((it = tab.find(
"dlig"))!= tab.end()) {
782 if((it = tab.find(
"hlig"))!= tab.end()) {
788 if((it = tab.find(
"calt"))!= tab.end()) {
794 if((it = tab.find(
"subs"))!= tab.end()) {
800 if((it = tab.find(
"sups"))!= tab.end()) {
806 if((it = tab.find(
"smcp"))!= tab.end()) {
812 if((it = tab.find(
"c2sc"))!= tab.end() &&
813 (it = tab.find(
"smcp"))!= tab.end()) {
819 if((it = tab.find(
"pcap"))!= tab.end()) {
825 if((it = tab.find(
"c2sc"))!= tab.end() &&
826 (it = tab.find(
"pcap"))!= tab.end()) {
832 if((it = tab.find(
"unic"))!= tab.end()) {
838 if((it = tab.find(
"titl"))!= tab.end()) {
844 if((it = tab.find(
"lnum"))!= tab.end()) {
850 if((it = tab.find(
"onum"))!= tab.end()) {
856 if((it = tab.find(
"pnum"))!= tab.end()) {
862 if((it = tab.find(
"tnum"))!= tab.end()) {
868 if((it = tab.find(
"frac"))!= tab.end()) {
874 if((it = tab.find(
"afrac"))!= tab.end()) {
880 if((it = tab.find(
"ordn"))!= tab.end()) {
886 if((it = tab.find(
"zero"))!= tab.end()) {
893 if((it = tab.find(
"jp78"))!= tab.end()) {
899 if((it = tab.find(
"jp83"))!= tab.end()) {
905 if((it = tab.find(
"jp90"))!= tab.end()) {
911 if((it = tab.find(
"jp04"))!= tab.end()) {
917 if((it = tab.find(
"smpl"))!= tab.end()) {
923 if((it = tab.find(
"trad"))!= tab.end()) {
929 if((it = tab.find(
"fwid"))!= tab.end()) {
935 if((it = tab.find(
"pwid"))!= tab.end()) {
941 if((it = tab.find(
"ruby"))!= tab.end()) {
948 Glib::ustring markup_liga;
949 Glib::ustring markup_dlig;
950 Glib::ustring markup_hlig;
951 Glib::ustring markup_calt;
953 for (
auto &table : tab) {
954 if (table.first ==
"liga" ||
955 table.first ==
"clig" ||
956 table.first ==
"dlig" ||
957 table.first ==
"hgli" ||
958 table.first ==
"calt") {
960 Glib::ustring markup;
961 markup +=
"<span font_family='";
964 markup += Glib::Markup::escape_text(table.second.output);
967 if (table.first ==
"liga") markup_liga += markup;
968 if (table.first ==
"clig") markup_liga += markup;
969 if (table.first ==
"dlig") markup_dlig += markup;
970 if (table.first ==
"hlig") markup_hlig += markup;
971 if (table.first ==
"calt") markup_calt += markup;
981 Glib::ustring markup_lnum;
982 Glib::ustring markup_onum;
983 Glib::ustring markup_pnum;
984 Glib::ustring markup_tnum;
985 Glib::ustring markup_frac;
986 Glib::ustring markup_afrc;
987 Glib::ustring markup_ordn;
988 Glib::ustring markup_zero;
990 for (
auto &table : res->get_opentype_tables()) {
991 Glib::ustring markup;
992 markup +=
"<span font_family='";
994 markup +=
"' font_features='";
995 markup += table.first;
997 if (table.first ==
"lnum" ||
998 table.first ==
"onum" ||
999 table.first ==
"pnum" ||
1000 table.first ==
"tnum") markup +=
"0123456789";
1001 if (table.first ==
"zero") markup +=
"0";
1002 if (table.first ==
"ordn") markup +=
"[" + table.second.before +
"]" + table.second.output;
1003 if (table.first ==
"frac" ||
1004 table.first ==
"afrc" ) markup +=
"1/2 2/3 3/4 4/5 5/6";
1005 markup +=
"</span>";
1007 if (table.first ==
"lnum") markup_lnum += markup;
1008 if (table.first ==
"onum") markup_onum += markup;
1009 if (table.first ==
"pnum") markup_pnum += markup;
1010 if (table.first ==
"tnum") markup_tnum += markup;
1011 if (table.first ==
"frac") markup_frac += markup;
1012 if (table.first ==
"afrc") markup_afrc += markup;
1013 if (table.first ==
"ordn") markup_ordn += markup;
1014 if (table.first ==
"zero") markup_zero += markup;
1027 auto table_copy = res->get_opentype_tables();
1028 if( (it = table_copy.find(
"liga")) != table_copy.end() ) table_copy.erase( it );
1029 if( (it = table_copy.find(
"clig")) != table_copy.end() ) table_copy.erase( it );
1030 if( (it = table_copy.find(
"dlig")) != table_copy.end() ) table_copy.erase( it );
1031 if( (it = table_copy.find(
"hlig")) != table_copy.end() ) table_copy.erase( it );
1032 if( (it = table_copy.find(
"calt")) != table_copy.end() ) table_copy.erase( it );
1034 if( (it = table_copy.find(
"subs")) != table_copy.end() ) table_copy.erase( it );
1035 if( (it = table_copy.find(
"sups")) != table_copy.end() ) table_copy.erase( it );
1037 if( (it = table_copy.find(
"smcp")) != table_copy.end() ) table_copy.erase( it );
1038 if( (it = table_copy.find(
"c2sc")) != table_copy.end() ) table_copy.erase( it );
1039 if( (it = table_copy.find(
"pcap")) != table_copy.end() ) table_copy.erase( it );
1040 if( (it = table_copy.find(
"c2pc")) != table_copy.end() ) table_copy.erase( it );
1041 if( (it = table_copy.find(
"unic")) != table_copy.end() ) table_copy.erase( it );
1042 if( (it = table_copy.find(
"titl")) != table_copy.end() ) table_copy.erase( it );
1044 if( (it = table_copy.find(
"lnum")) != table_copy.end() ) table_copy.erase( it );
1045 if( (it = table_copy.find(
"onum")) != table_copy.end() ) table_copy.erase( it );
1046 if( (it = table_copy.find(
"pnum")) != table_copy.end() ) table_copy.erase( it );
1047 if( (it = table_copy.find(
"tnum")) != table_copy.end() ) table_copy.erase( it );
1048 if( (it = table_copy.find(
"frac")) != table_copy.end() ) table_copy.erase( it );
1049 if( (it = table_copy.find(
"afrc")) != table_copy.end() ) table_copy.erase( it );
1050 if( (it = table_copy.find(
"ordn")) != table_copy.end() ) table_copy.erase( it );
1051 if( (it = table_copy.find(
"zero")) != table_copy.end() ) table_copy.erase( it );
1053 if( (it = table_copy.find(
"jp78")) != table_copy.end() ) table_copy.erase( it );
1054 if( (it = table_copy.find(
"jp83")) != table_copy.end() ) table_copy.erase( it );
1055 if( (it = table_copy.find(
"jp90")) != table_copy.end() ) table_copy.erase( it );
1056 if( (it = table_copy.find(
"jp04")) != table_copy.end() ) table_copy.erase( it );
1057 if( (it = table_copy.find(
"smpl")) != table_copy.end() ) table_copy.erase( it );
1058 if( (it = table_copy.find(
"trad")) != table_copy.end() ) table_copy.erase( it );
1059 if( (it = table_copy.find(
"fwid")) != table_copy.end() ) table_copy.erase( it );
1060 if( (it = table_copy.find(
"pwid")) != table_copy.end() ) table_copy.erase( it );
1061 if( (it = table_copy.find(
"ruby")) != table_copy.end() ) table_copy.erase( it );
1064 if( (it = table_copy.find(
"abvf")) != table_copy.end() ) table_copy.erase( it );
1065 if( (it = table_copy.find(
"abvs")) != table_copy.end() ) table_copy.erase( it );
1066 if( (it = table_copy.find(
"akhn")) != table_copy.end() ) table_copy.erase( it );
1067 if( (it = table_copy.find(
"blwf")) != table_copy.end() ) table_copy.erase( it );
1068 if( (it = table_copy.find(
"blws")) != table_copy.end() ) table_copy.erase( it );
1069 if( (it = table_copy.find(
"ccmp")) != table_copy.end() ) table_copy.erase( it );
1070 if( (it = table_copy.find(
"cjct")) != table_copy.end() ) table_copy.erase( it );
1071 if( (it = table_copy.find(
"dnom")) != table_copy.end() ) table_copy.erase( it );
1072 if( (it = table_copy.find(
"dtls")) != table_copy.end() ) table_copy.erase( it );
1073 if( (it = table_copy.find(
"fina")) != table_copy.end() ) table_copy.erase( it );
1074 if( (it = table_copy.find(
"half")) != table_copy.end() ) table_copy.erase( it );
1075 if( (it = table_copy.find(
"haln")) != table_copy.end() ) table_copy.erase( it );
1076 if( (it = table_copy.find(
"init")) != table_copy.end() ) table_copy.erase( it );
1077 if( (it = table_copy.find(
"isol")) != table_copy.end() ) table_copy.erase( it );
1078 if( (it = table_copy.find(
"locl")) != table_copy.end() ) table_copy.erase( it );
1079 if( (it = table_copy.find(
"medi")) != table_copy.end() ) table_copy.erase( it );
1080 if( (it = table_copy.find(
"nukt")) != table_copy.end() ) table_copy.erase( it );
1081 if( (it = table_copy.find(
"numr")) != table_copy.end() ) table_copy.erase( it );
1082 if( (it = table_copy.find(
"pref")) != table_copy.end() ) table_copy.erase( it );
1083 if( (it = table_copy.find(
"pres")) != table_copy.end() ) table_copy.erase( it );
1084 if( (it = table_copy.find(
"pstf")) != table_copy.end() ) table_copy.erase( it );
1085 if( (it = table_copy.find(
"psts")) != table_copy.end() ) table_copy.erase( it );
1086 if( (it = table_copy.find(
"rlig")) != table_copy.end() ) table_copy.erase( it );
1087 if( (it = table_copy.find(
"rkrf")) != table_copy.end() ) table_copy.erase( it );
1088 if( (it = table_copy.find(
"rphf")) != table_copy.end() ) table_copy.erase( it );
1089 if( (it = table_copy.find(
"rtlm")) != table_copy.end() ) table_copy.erase( it );
1090 if( (it = table_copy.find(
"ssty")) != table_copy.end() ) table_copy.erase( it );
1091 if( (it = table_copy.find(
"vatu")) != table_copy.end() ) table_copy.erase( it );
1101 for (
auto &table: res->get_opentype_tables()) {
1102 if (table.first ==
"case" ||
1103 table.first ==
"hist" ||
1104 (table.first[0] ==
's' && table.first[1] ==
's' && !(table.first[2] ==
't'))) {
1106 if( (it = table_copy.find(table.first)) != table_copy.end() ) table_copy.erase( it );
1108 _features[table.first] =
new Feature (table.first, table.second, 2,
1116 for (
auto &table : res->get_opentype_tables()) {
1117 if (table.first ==
"salt" ||
1118 table.first ==
"swsh" ||
1119 table.first ==
"cwsh" ||
1120 table.first ==
"ornm" ||
1121 table.first ==
"nalt" ||
1122 (table.first[0] ==
'c' && table.first[1] ==
'v')) {
1124 if (table.second.input.length() == 0) {
1132 if( (it = table_copy.find(table.first)) != table_copy.end() ) table_copy.erase( it );
1135 int number = table.second.output.length() / table.second.input.length();
1144 _features[table.first] =
new Feature (table.first, table.second, number+1,
1153 std::string ott_list =
"OpenType tables not included above: ";
1154 for(it = table_copy.begin(); it != table_copy.end(); ++it) {
1155 ott_list += it->first;
1159 if (table_copy.size() > 0) {
1160 ott_list.pop_back();
1161 ott_list.pop_back();
1168 std::cerr <<
"FontVariants::update(): Couldn't find FontInstance for: "
1169 << font_spec.raw() << std::endl;
1188 if( !common && !discretionary && !historical && !contextual ) {
1190 }
else if ( common && !discretionary && !historical && contextual ) {
1193 Glib::ustring css_string;
1195 css_string +=
"no-common-ligatures ";
1196 if ( discretionary )
1197 css_string +=
"discretionary-ligatures ";
1199 css_string +=
"historical-ligatures ";
1201 css_string +=
"no-contextual ";
1208 Glib::ustring css_string;
1210 css_string =
"normal";
1215 css_string =
"super";
1228 Glib::ustring css_string;
1230 css_string =
"normal";
1233 css_string =
"small-caps";
1236 css_string =
"all-small-caps";
1239 css_string =
"petite";
1242 css_string =
"all-petite";
1245 css_string =
"unicase";
1248 css_string =
"titling";
1276 if (default_style & default_width & default_fractions & !ordinal & !slashed_zero) {
1279 Glib::ustring css_string;
1281 css_string +=
"lining-nums ";
1283 css_string +=
"oldstyle-nums ";
1285 css_string +=
"proportional-nums ";
1287 css_string +=
"tabular-nums ";
1289 css_string +=
"diagonal-fractions ";
1291 css_string +=
"stacked-fractions ";
1293 css_string +=
"ordinal ";
1295 css_string +=
"slashed-zero ";
1311 if (default_style & asian_width & !ruby) {
1314 Glib::ustring css_string;
1315 if (jis78) css_string +=
"jis78 ";
1316 if (jis83) css_string +=
"jis83 ";
1317 if (jis90) css_string +=
"jis90 ";
1318 if (jis04) css_string +=
"jis04 ";
1319 if (simplified) css_string +=
"simplfied ";
1320 if (traditional) css_string +=
"traditional ";
1322 if (fwid) css_string +=
"fwid ";
1323 if (pwid) css_string +=
"pwid ";
1325 if (ruby) css_string +=
"ruby ";
1331 Glib::ustring feature_string;
1333 feature_string += i.second->get_css();
1339 if (!feature_string.empty()) {
1349 Glib::ustring markup;
1357 if (!common) markup +=
"liga=0,clig=0,";
1358 if (discretionary) markup +=
"dlig=1,";
1359 if (historical) markup +=
"hlig=1,";
1360 if (contextual) markup +=
"calt=1,";
1367 if (
_caps_small.get_active() ) markup +=
"smcp=1,";
1369 else if (
_caps_petite.get_active() ) markup +=
"pcap=1,";
1387 if (lining) markup +=
"lnum=1,";
1388 if (old_style) markup +=
"onum=1,";
1389 if (proportional) markup +=
"pnum=1,";
1390 if (tabular) markup +=
"tnum=1,";
1391 if (diagonal) markup +=
"frac=1,";
1392 if (stacked) markup +=
"afrc=1,";
1393 if (ordinal) markup +=
"ordn=1,";
1394 if (slashed_zero) markup +=
"zero=1,";
1408 if (jis78 ) markup +=
"jp78=1,";
1409 if (jis83 ) markup +=
"jp83=1,";
1410 if (jis90 ) markup +=
"jp90=1,";
1411 if (jis04 ) markup +=
"jp04=1,";
1412 if (simplified ) markup +=
"smpl=1,";
1413 if (traditional ) markup +=
"trad=1,";
1415 if (fwid ) markup +=
"fwid=1,";
1416 if (pwid ) markup +=
"pwid=1,";
1418 if (ruby ) markup +=
"ruby=1,";
1421 Glib::ustring feature_string;
1423 feature_string += i.second->get_css();
1427 if (!feature_string.empty()) {
1428 markup += feature_string;
std::shared_ptr< FontInstance > FaceFromFontSpecification(char const *fontSpecification)
static FontFactory & get(Args &&... args)
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.
static char const *const parent
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