Example #1
0
glyph
rubber_stix_font_rep::get_glyph (string s) {
  SI dy;
  string ltype;
  font fn= search_font (s, dy, ltype);
  return move (fn->get_glyph (s), 0, dy);
}
Example #2
0
int
poor_rubber_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);
}
Example #3
0
void
rubber_stix_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) {
  SI dy;
  string ltype;
  font fn= search_font (s, dy, ltype);
  fn->draw_fixed (ren, s, x, y + dy, xk);
}
Example #4
0
double
math_font_rep::get_right_slope (string s) {
  if (italic->dict->contains (s) || ((N(s) >= 2) && (s[0] != '<'))) {
    font fn;
    search_font (s, fn);
    return fn->get_right_slope (s);
  }
  else return 0;
}
Example #5
0
int
rubber_stix_font_rep::index_glyph (string s, font_metric& fnm,
                                             font_glyphs& fng) {
  SI dy;
  string ltype;
  font fn= search_font (s, dy, ltype);
  if (dy != 0) cout << "TeXmacs] warning: glyph offset ignored\n";
  return fn->index_glyph (s, fnm, fng);
}
Example #6
0
static int
get_ex (string family, string variant, string series, string shape,
	int attempt) {
  array<string> lfn= logical_font (family, variant, series, shape);
  array<string> pfn= search_font (lfn, attempt);
  array<string> chs= font_database_characteristics (pfn[0], pfn[1]);
  string ex= find_attribute_value (chs, "ex");
  if (ex == "") return 0;
  else return as_int (ex);
}
Example #7
0
void
rubber_stix_font_rep::get_xpositions (string s, SI* xpos, SI xk) {
  if (s == "") return;
  string r= s;
  font fn= search_font (r);
  if (r == s) fn->get_xpositions (s, xpos, xk);
  else if (N(r) != 1) font_rep::get_xpositions (s, xpos, xk);
  else {
    int i, n=N(s);
    for (i=0; i<n; i++) xpos[i]= 0;
    fn->get_xpositions (r, xpos+n-1, xk);
  }
}
Example #8
0
void
math_font_rep::get_xpositions (string s, SI* xpos) {
  if (s == "") return;
  font fn;
  string r= s;
  search_font (r, fn);
  if (r == s) fn->get_xpositions (s, xpos);
  else if (N(r) != 1) font_rep::get_xpositions (s, xpos);
  else {
    int i, n=N(s);
    for (i=1; i<n; i++) xpos[i]= 0;
    fn->get_xpositions (r, xpos+n-1);
  }
}
Example #9
0
int main(int argc,char**argv)
{
	int i;
	FILE*fp;
	char*file = "wqy10.bdf";
	
	//read_wqy_to_mem( "wqy.bdf");
	read_font_to_list(file);

	search_font( 65 );
	
	return 0;
		
}
Example #10
0
SI
math_font_rep::get_right_correction (string s) {
  font fn;
  search_font (s, fn);
  return fn->get_right_correction (s);
}
Example #11
0
glyph
poor_rubber_font_rep::get_glyph (string s) {
  string name;
  int num= search_font (s, name);
  return get_font (num) -> get_glyph (name);
}
Example #12
0
glyph
math_font_rep::get_glyph (string s) {
  font fn;
  search_font (s, fn);
  return fn->get_glyph (s);
}
Example #13
0
void
math_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) {
  font fn;
  search_font (s, fn);
  fn->draw_fixed (ren, s, x, y, xk);
}
Example #14
0
void
math_font_rep::get_extents (string s, metric& ex) {
  font fn;
  search_font (s, fn);
  fn->get_extents (s, ex);
}
Example #15
0
bool
math_font_rep::supports (string c) {
  font fn;
  search_font (c, fn);
  return fn.operator -> () != error_fn.operator -> ();
}
Example #16
0
void
math_font_rep::draw (renderer ren, string s, SI x, SI y) {
  font fn;
  search_font (s, fn);
  fn->draw (ren, s, x, y);
}
Example #17
0
SI
rubber_stix_font_rep::get_right_correction (string s) {
  font fn= search_font (s);
  return fn->get_right_correction (s);
}
Example #18
0
void
poor_rubber_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) {
  string name;
  int num= search_font (s, name);
  get_font (num) -> draw (ren, name, x, y, xk);
}
Example #19
0
font
rubber_stix_font_rep::search_font (string& s) {
  SI dy;
  string ltype;
  return search_font (s, dy, ltype);
}
Example #20
0
bool
rubber_stix_font_rep::supports (string c) {
  font fn= search_font (c);
  return fn->supports (c);
}
Example #21
0
void
rubber_stix_font_rep::get_extents (string s, metric& ex) {
  SI dy;
  string ltype;
  string orig= s;
  font fn= search_font (s, dy, ltype);
  fn->get_extents (s, ex);
  ex->y1 += dy; ex->y2 += dy;
  ex->y3 += dy; ex->y4 += dy;
  if (ltype != "") {
    int nr= large_size (orig);
    if (ltype[0] == '|' || ltype == "interleave") {
      if (ex->y2 - ex->y1 >= 9 * base->yx)
        adjust_hspace (ex, base->wfn / 10);
      else if (ex->y2 - ex->y1 >= 6 * base->yx)
        adjust_hspace (ex, base->wfn / 15);
      else if (ex->y2 - ex->y1 >= 3 * base->yx)
        adjust_hspace (ex, base->wfn / 20);
    }
    else if (ltype[0] == '(') {
      if (nr == 2)
        ex->x1 += base->wfn / 24;
      else if (nr == 3)
        ex->x1 += base->wfn / 10;
      else if (nr == 4)
        ex->x1 += base->wfn / 18;
      else if (nr > 4) {
        ex->x1 -= base->wfn / 8;
        ex->x2 += base->wfn / 16;
      }
    }
    else if (ltype[0] == ')') {
      if (nr == 2)
        ex->x2 -= base->wfn / 24;
      else if (nr == 3)
        ex->x2 -= base->wfn / 10;
      else if (nr == 4)
        ex->x2 -= base->wfn / 18;
      else if (nr > 4) {
        ex->x2 += base->wfn / 8;
        ex->x1 -= base->wfn / 16;
      }
    }
    else if (ltype[0] == '{') {
      if (nr == 2)
        adjust_hspace (ex, -base->wfn / 15);
      else if (nr == 3)
        adjust_hspace (ex, -base->wfn / 10);
      else if (nr == 4) {
        ex->x2 -= base->wfn / 5;
        ex->x1 += base->wfn / 10;
      }
    }
    else if (ltype[0] == '}') {
      if (nr == 2)
        adjust_hspace (ex, -base->wfn / 15);
      else if (nr == 3)
        adjust_hspace (ex, -base->wfn / 10);
      else if (nr == 4) {
        ex->x1 += base->wfn / 5;
        ex->x2 -= base->wfn / 10;
      }
    }
    else if (ltype[0] == '[' || ltype == "llbracket" ||
             ltype == "lfloor" || ltype == "lceil") {
      if (nr == 2)
        ex->x1 += base->wfn / 30;
      else if (nr == 3)
        ex->x1 += base->wfn / 20;
      else if (nr == 4)
        ex->x1 += base->wfn / 10;
      else if (nr > 4 && ltype != "llbracket") {
        ex->x1 -= base->wfn / 8;
        ex->x2 += base->wfn / 32;
      }
    }
    else if (ltype[0] == ']' || ltype == "rrbracket" ||
             ltype == "rfloor" || ltype == "rceil") {
      if (nr == 2)
        ex->x2 -= base->wfn / 30;
      else if (nr == 3)
        ex->x2 -= base->wfn / 20;
      else if (nr == 4)
        ex->x2 -= base->wfn / 10;
      else if (nr > 4 && ltype != "rrbracket") {
        ex->x2 += base->wfn / 8;
        ex->x1 -= base->wfn / 32;
      }
    }
    else if (ltype == "langle" || ltype == "rangle") {
      if (nr == 2)
        adjust_hspace (ex, -base->wfn / 36);
      else if (nr == 3)
        adjust_hspace (ex, -base->wfn / 24);
      else if (nr >= 4)
        adjust_hspace (ex, -base->wfn / 12);
    }
  }
}
Example #22
0
double
rubber_stix_font_rep::get_right_slope (string s) {
  font fn= search_font (s);
  return fn->get_right_slope (s);
}
Example #23
0
void
poor_rubber_font_rep::get_extents (string s, metric& ex) {
  string name;
  int num= search_font (s, name);
  get_font (num) -> get_extents (name, ex);
}