Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
KeShih committed Oct 20, 2024
1 parent c02294d commit 8dd8bf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
28 changes: 8 additions & 20 deletions src/Plugins/Freetype/rubber_unicode_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ struct rubber_unicode_font_rep : font_rep {
array<font> subfn;
bool big_sums;

tt_face math_face;
translator virt;
tt_face math_face;

hashmap<string, int> mapper;
hashmap<string, string> rewriter;
Expand Down Expand Up @@ -130,8 +129,8 @@ rubber_unicode_font_rep::get_font (int nr) {
******************************************************************************/

int
parse_variant (string s, string& r, string& rg) {
cout << "parse_variant for " << s << LF;
parse_variant (string s, string& r) {
// cout << "parse_variant for " << s << LF;
int var = 0;
int n = N (s);
int start= search_forwards ("-", 0, s);
Expand All @@ -143,51 +142,40 @@ parse_variant (string s, string& r, string& rg) {
else {
var= max (0, as_int (s (end + 1, n)));
}
r = s (start + 1, end);
rg= s (0, start);
r= s (start + 1, end);
return var;
}

bool
rubber_unicode_font_rep::search_font_sub_bis (string s, string& rew, int& nr) {
// look up opentype math table
string r;
string rg;
int var= 0;
bool ver= true; // verizontal or vertical, default is vertical
rew = s;
nr = 0;

// large,big,wide
// left,right,mid?

if (starts (s, "<big-")) {
var= parse_variant (s, r, rg);
var= parse_variant (s, r);
var= max (0, var - 1);
ver= true;
}
else if (starts (s, "<mid-") || starts (s, "<right-") ||
starts (s, "<left-")) {
var= parse_variant (s, r, rg);
var= parse_variant (s, r);
ver= true;
}
else if (starts (s, "<wide-")) {
var= parse_variant (s, r, rg);
var= parse_variant (s, r);
ver= false;
}
else if (starts (s, "<large-")) {
var= parse_variant (s, r, rg);
ver= true;
}
else if (starts (s, "<long")) {
var= 1;
var= parse_variant (s, r);
ver= true;
r = s (5, N (s) - 1);
}

cout << "search_font_sub_bis for " << s << " -> " << r << ", " << rg << ", "
<< var << LF;

if (r == "") return false;

string uu= N (r) > 1 ? strict_cork_to_utf8 ("<" * r * ">") : r;
Expand Down
1 change: 0 additions & 1 deletion src/Plugins/Freetype/unicode_font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,6 @@ unicode_font_rep::metric_to_design_unit (SI m) {

font
unicode_font_rep::make_rubber_font (font base) {
cout << "Make unicode rubber font " << this->res_name << LF;
if (!is_nil (this->math_table)) {
return rubber_unicode_font (this, this->math_face);
}
Expand Down

0 comments on commit 8dd8bf1

Please sign in to comment.