"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Freetype/rubber_assemble_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_assemble_font.cpp  (TeXmacs-1.99.4-src):rubber_assemble_font.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 32 skipping to change at line 32
struct rubber_assemble_font_rep: font_rep { struct rubber_assemble_font_rep: font_rep {
font base; font base;
array<bool> initialized; array<bool> initialized;
array<font> larger; array<font> larger;
translator virt; translator virt;
rubber_assemble_font_rep (string name, font base); rubber_assemble_font_rep (string name, font base);
font get_font (int nr); font get_font (int nr);
int search_font (string s, string& r); int search_font (string s, string& r);
bool supports (string c); bool supports (string c);
void get_extents (string s, metric& ex); void get_extents (string s, metric& ex);
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);
}; };
/****************************************************************************** /******************************************************************************
* Initialization of main font parameters * Initialization of main font parameters
******************************************************************************/ ******************************************************************************/
#define MAGNIFIED_NUMBER 4 #define MAGNIFIED_NUMBER 4
rubber_assemble_font_rep::rubber_assemble_font_rep (string name, font base2): rubber_assemble_font_rep::rubber_assemble_font_rep (string name, font base2):
font_rep (name, base2), base (base2) font_rep (name, base2), base (base2)
{ {
this->copy_math_pars (base); this->copy_math_pars (base);
initialized << true; initialized << true;
larger << base; larger << base;
for (int i=1; i<=MAGNIFIED_NUMBER; i++) { for (int i=1; i<=MAGNIFIED_NUMBER; i++) {
initialized << false; initialized << false;
larger << base; larger << base;
} }
int dpi= (72 * base->wpt + (PIXEL/2)) / PIXEL; int hdpi= (72 * base->wpt + (PIXEL/2)) / PIXEL;
int vdpi= (72 * base->hpt + (PIXEL/2)) / PIXEL;
initialized << true; initialized << true;
larger << virtual_font (base, "unilong", base->size, dpi); larger << virtual_font (base, "emu-alt-large", base->size, hdpi, vdpi, false);
virt= load_translator ("unilong"); virt= load_translator ("emu-alt-large");
} }
font font
rubber_assemble_font_rep::get_font (int nr) { rubber_assemble_font_rep::get_font (int nr) {
ASSERT (nr < N(larger), "wrong font number"); ASSERT (nr < N(larger), "wrong font number");
if (initialized[nr]) return larger[nr]; if (initialized[nr]) return larger[nr];
initialized[nr]= true; initialized[nr]= true;
larger[nr]= base->magnify (pow (2.0, ((double) nr) / 4.0)); larger[nr]= base->magnify (pow (2.0, ((double) nr) / 4.0));
return larger[nr]; return larger[nr];
} }
skipping to change at line 104 skipping to change at line 106
else if (r == "}") else if (r == "}")
code= virt->dict ["<rubber-rcurly-#>"]; code= virt->dict ["<rubber-rcurly-#>"];
else if (r == "lfloor") else if (r == "lfloor")
code= virt->dict ["<rubber-lfloor-#>"]; code= virt->dict ["<rubber-lfloor-#>"];
else if (r == "rfloor") else if (r == "rfloor")
code= virt->dict ["<rubber-rfloor-#>"]; code= virt->dict ["<rubber-rfloor-#>"];
else if (r == "lceil") else if (r == "lceil")
code= virt->dict ["<rubber-lceil-#>"]; code= virt->dict ["<rubber-lceil-#>"];
else if (r == "rceil") else if (r == "rceil")
code= virt->dict ["<rubber-rceil-#>"]; code= virt->dict ["<rubber-rceil-#>"];
else if (r == ".")
code= virt->dict ["<rubber-nosymbol-#>"];
else if (r == "nosymbol")
code= virt->dict ["<rubber-nosymbol-#>"];
else if (r == "|") else if (r == "|")
code= virt->dict ["<rubber-bar-#>"]; code= virt->dict ["<rubber-bar-#>"];
else if (r == "||") else if (r == "||")
code= virt->dict ["<rubber-parallel-#>"]; code= virt->dict ["<rubber-parallel-#>"];
else if (r == "interleave") else if (r == "interleave")
code= virt->dict ["<rubber-interleave-#>"]; code= virt->dict ["<rubber-interleave-#>"];
else else
code= virt->dict ["<rubber-lparenthesis-#>"]; code= virt->dict ["<rubber-lparenthesis-#>"];
r= string ((char) code) * as_string (nr) * ">"; r= string ((char) code) * as_string (nr) * ">";
return MAGNIFIED_NUMBER + 1; return MAGNIFIED_NUMBER + 1;
skipping to change at line 168 skipping to change at line 174
} }
void void
rubber_assemble_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) { rubber_assemble_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) {
string name; string name;
int num= search_font (s, name); int num= search_font (s, name);
get_font (num) -> draw (ren, name, x, y, xk); get_font (num) -> draw (ren, name, x, y, xk);
} }
font font
rubber_assemble_font_rep::magnify (double zoom) { rubber_assemble_font_rep::magnify (double zoomx, double zoomy) {
return rubber_assemble_font (base->magnify (zoom)); return rubber_assemble_font (base->magnify (zoomx, zoomy));
} }
glyph glyph
rubber_assemble_font_rep::get_glyph (string s) { rubber_assemble_font_rep::get_glyph (string s) {
string name; string name;
int num= search_font (s, name); int num= search_font (s, name);
return get_font (num) -> get_glyph (name); return get_font (num) -> get_glyph (name);
} }
int
rubber_assemble_font_rep::index_glyph (string s, font_metric& fnm,
font_glyphs& fng) {
string name;
int num= search_font (s, name);
return get_font (num) -> index_glyph (name, fnm, fng);
}
/****************************************************************************** /******************************************************************************
* Interface * Interface
******************************************************************************/ ******************************************************************************/
font font
rubber_assemble_font (font base) { rubber_assemble_font (font base) {
string name= "rubberassemble[" * base->res_name * "]"; string name= "rubberassemble[" * base->res_name * "]";
return make (font, name, tm_new<rubber_assemble_font_rep> (name, base)); return make (font, name, tm_new<rubber_assemble_font_rep> (name, base));
} }
 End of changes. 7 change blocks. 
10 lines changed or deleted 24 lines changed or added

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