"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Freetype/rubber_unicode_font.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

rubber_unicode_font.cpp  (TeXmacs-1.99.4-src):rubber_unicode_font.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 31 skipping to change at line 31
struct rubber_unicode_font_rep: font_rep { struct rubber_unicode_font_rep: font_rep {
font base; font base;
array<bool> initialized; array<bool> initialized;
array<font> subfn; array<font> subfn;
bool big_sums; bool big_sums;
hashmap<string,int> mapper; hashmap<string,int> mapper;
hashmap<string,string> rewriter; hashmap<string,string> rewriter;
rubber_unicode_font_rep (string name, font base); rubber_unicode_font_rep (string name, font base);
font get_font (int nr); font get_font (int nr);
int search_font_sub (string s, string& rew); int search_font_sub (string s, string& rew);
int search_font_cached (string s, string& rew); int search_font_cached (string s, string& rew);
font search_font (string& s); font search_font (string& s);
bool supports (string c); bool supports (string c);
void get_extents (string s, metric& ex); void get_extents (string s, metric& ex);
void get_xpositions (string s, SI* xpos); void get_xpositions (string s, SI* xpos);
void get_xpositions (string s, SI* xpos, SI xk); void get_xpositions (string s, SI* xpos, SI xk);
void draw_fixed (renderer ren, string s, SI x, SI y); void draw_fixed (renderer ren, string s, SI x, SI y);
void draw_fixed (renderer ren, string s, SI x, SI y, SI xk); void draw_fixed (renderer ren, string s, SI x, SI y, SI xk);
font magnify (double zoom); font magnify (double zoomx, double zoomy);
glyph get_glyph (string s); glyph get_glyph (string s);
int index_glyph (string s, font_metric& fnm, font_glyphs& fng);
double get_left_slope (string s); double get_left_slope (string s);
double get_right_slope (string s); double get_right_slope (string s);
SI get_left_correction (string s); SI get_left_correction (string s);
SI get_right_correction (string s); SI get_right_correction (string s);
}; };
/****************************************************************************** /******************************************************************************
* Initialization of main font parameters * Initialization of main font parameters
******************************************************************************/ ******************************************************************************/
skipping to change at line 134 skipping to change at line 135
return 3; return 3;
} }
} }
if (starts (s, "<mid-")) s= "<left-" * s (5, N(s)); if (starts (s, "<mid-")) s= "<left-" * s (5, N(s));
if (starts (s, "<right-")) s= "<left-" * s (7, N(s)); if (starts (s, "<right-")) s= "<left-" * s (7, N(s));
if (starts (s, "<large-")) s= "<left-" * s (7, N(s)); if (starts (s, "<large-")) s= "<left-" * s (7, N(s));
if (starts (s, "<left-")) { if (starts (s, "<left-")) {
int pos= search_backwards ("-", N(s), s); int pos= search_backwards ("-", N(s), s);
if (pos > 6) { if (pos > 6) {
string r= s (6, pos); string r= s (6, pos);
if (r == ".") { rew= ""; return 0; }
if ((r == "(" && base->supports ("<#239C>")) || if ((r == "(" && base->supports ("<#239C>")) ||
(r == ")" && base->supports ("<#239F>")) || (r == ")" && base->supports ("<#239F>")) ||
(r == "[" && base->supports ("<#23A2>")) || (r == "[" && base->supports ("<#23A2>")) ||
(r == "]" && base->supports ("<#23A5>")) || (r == "]" && base->supports ("<#23A5>")) ||
((r == "{" || r == "}") && base->supports ("<#23AA>"))) { ((r == "{" || r == "}") && base->supports ("<#23AA>"))) {
rew= s; rew= s;
return 4; return 4;
} }
rew= r;
if (N(rew) > 1) rew= "<" * rew * ">";
if (ends (s, "-0>")) return 0;
return 0;
} }
} }
rew= s; rew= s;
return 0; return 0;
} }
int int
rubber_unicode_font_rep::search_font_cached (string s, string& rew) { rubber_unicode_font_rep::search_font_cached (string s, string& rew) {
if (mapper->contains (s)) { if (mapper->contains (s)) {
rew= rewriter[s]; rew= rewriter[s];
skipping to change at line 189 skipping to change at line 195
if (N(r) > 1) r= "<" * r * ">"; if (N(r) > 1) r= "<" * r * ">";
return base->supports (r); return base->supports (r);
} }
if (starts (s, "<mid-")) s= "<left-" * s (5, N(s)); if (starts (s, "<mid-")) s= "<left-" * s (5, N(s));
if (starts (s, "<right-")) s= "<left-" * s (7, N(s)); if (starts (s, "<right-")) s= "<left-" * s (7, N(s));
if (starts (s, "<large-")) s= "<left-" * s (7, N(s)); if (starts (s, "<large-")) s= "<left-" * s (7, N(s));
if (starts (s, "<left-")) { if (starts (s, "<left-")) {
int pos= search_backwards ("-", N(s), s); int pos= search_backwards ("-", N(s), s);
if (pos > 6) { if (pos > 6) {
string r= s (6, pos); string r= s (6, pos);
if (r == ".") return true;
if (N(r) > 1) r= "<" * r * ">"; if (N(r) > 1) r= "<" * r * ">";
return base->supports (r); if (!base->supports (r)) return false;
if (ends (s, "-0>")) return true;
if (r == "(") return base->supports ("<#239C>");
if (r == ")") return base->supports ("<#239F>");
if (r == "[") return base->supports ("<#23A2>");
if (r == "]") return base->supports ("<#23A5>");
if (r == "{" || r == "}") return base->supports ("<#23AA>");
return true;
} }
} }
return base->supports (s); return base->supports (s);
} }
void void
rubber_unicode_font_rep::get_extents (string s, metric& ex) { rubber_unicode_font_rep::get_extents (string s, metric& ex) {
font fn= search_font (s); font fn= search_font (s);
fn->get_extents (s, ex); fn->get_extents (s, ex);
} }
skipping to change at line 243 skipping to change at line 257
fn->draw_fixed (ren, s, x, y); fn->draw_fixed (ren, s, x, y);
} }
void void
rubber_unicode_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) { rubber_unicode_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) {
font fn= search_font (s); font fn= search_font (s);
fn->draw_fixed (ren, s, x, y, xk); fn->draw_fixed (ren, s, x, y, xk);
} }
font font
rubber_unicode_font_rep::magnify (double zoom) { rubber_unicode_font_rep::magnify (double zoomx, double zoomy) {
return rubber_unicode_font (base->magnify (zoom)); return rubber_unicode_font (base->magnify (zoomx, zoomy));
} }
glyph glyph
rubber_unicode_font_rep::get_glyph (string s) { rubber_unicode_font_rep::get_glyph (string s) {
font fn= search_font (s); font fn= search_font (s);
return fn->get_glyph (s); return fn->get_glyph (s);
} }
int
rubber_unicode_font_rep::index_glyph (string s, font_metric& fnm,
font_glyphs& fng) {
font fn= search_font (s);
return fn->index_glyph (s, fnm, fng);
}
/****************************************************************************** /******************************************************************************
* Metric properties * Metric properties
******************************************************************************/ ******************************************************************************/
double double
rubber_unicode_font_rep::get_left_slope (string s) { rubber_unicode_font_rep::get_left_slope (string s) {
font fn= search_font (s); font fn= search_font (s);
return fn->get_left_slope (s); return fn->get_left_slope (s);
} }
 End of changes. 7 change blocks. 
16 lines changed or deleted 37 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS