Back to index

texmacs  1.0.7.15
Classes | Defines | Functions
font.hpp File Reference
#include "space.hpp"
#include "renderer.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  font_rep

Defines

#define FONT_TYPE_TEX   0
#define FONT_TYPE_UNICODE   1
#define FONT_TYPE_OTHER   2

Functions

 RESOURCE (font)
string default_chinese_font_name ()
string default_japanese_font_name ()
string default_korean_font_name ()
font error_font (font fn)
font virtual_font (font base, string family, int size, int dpi)
font tt_font (string family, int size, int dpi)
font unicode_font (string family, int size, int dpi)
font unicode_math_font (font up, font it, font bup, font bit, font fb)
font x_font (string family, int size, int dpi)
font tex_font (string fam, int size, int dpi, int dsize=10)
font tex_cm_font (string fam, int size, int dpi, int dsize=10)
font tex_ec_font (string fam, int size, int dpi, int dsize=10)
font tex_la_font (string fam, int size, int dpi, int dsize=10)
font tex_adobe_font (string fam, int size, int dpi, int dsize=10)
font tex_rubber_font (string trl_name, string fam, int size, int dpi, int dsize=10)
font tex_dummy_rubber_font (font base_fn)
void font_rule (tree which, tree by)
font find_font (scheme_tree t)
font find_font (string family, string fn_class, string series, string shape, int sz, int dpi)
font math_font (scheme_tree t, font base_fn, font error_fn)
font compound_font (scheme_tree def)
int script (int sz, int level)

Define Documentation

#define FONT_TYPE_OTHER   2

Definition at line 23 of file font.hpp.

#define FONT_TYPE_TEX   0

Definition at line 21 of file font.hpp.

#define FONT_TYPE_UNICODE   1

Definition at line 22 of file font.hpp.


Function Documentation

font compound_font ( scheme_tree  def)

Definition at line 170 of file compound_font.cpp.

                                {
  string name= tree_to_scheme (def);
  if (font::instances->contains (name))
    return font (name);
  array<font> fn (N(def));
  fn[0]= find_font (def[0][1]);
  if (is_nil (fn[0])) return font ();
  return make (font, name, tm_new<compound_font_rep> (name, def, fn));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 195 of file font.cpp.

                             {
  if (tt_font_exists ("fireflysung")) return "fireflysung";
  if (tt_font_exists ("uming")) return "uming";
  if (tt_font_exists ("儷黑 Pro")) return "lihei";
  if (tt_font_exists ("华文细黑")) return "heiti";
  if (tt_font_exists ("simsun")) return "simsun";
  if (tt_font_exists ("SimSun")) return "apple-simsun";
  return "roman";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 206 of file font.cpp.

                              {
  if (tt_font_exists ("ipam")) return "modern";
  if (tt_font_exists ("sazanami")) return "sazanami";
  if (tt_font_exists ("ttf-japanese-gothic")) return "ttf-japanese";
  if (tt_font_exists ("ヒラギノ明朝 ProN W6")) return "kaku";
  if (tt_font_exists ("MS PGothic")) return "ms-gothic";
  if (tt_font_exists ("MS PMincho")) return "ms-mincho";
  return "roman";  
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 217 of file font.cpp.

                            {
  if (tt_font_exists ("unbatang")) return "modern";
  if (tt_font_exists ("UnBatang")) return "modern";
  if (tt_font_exists ("AppleGothic")) return "apple-gothic";
  if (tt_font_exists ("Gulim")) return "gulim";
  return "roman";
}

Here is the call graph for this function:

Here is the caller graph for this function:

font error_font ( font  fn)

Definition at line 176 of file font.cpp.

                     {
  string name= "error-" * fn->res_name;
  return make (font, name, tm_new<error_font_rep> (name, fn));
}

Here is the caller graph for this function:

font find_font ( scheme_tree  t)

Definition at line 174 of file find_font.cpp.

                   {
  bench_start ("find font");
  font fn= find_font_bis (t);
  bench_cumul ("find font");
  return fn;
}
font find_font ( string  family,
string  fn_class,
string  series,
string  shape,
int  sz,
int  dpi 
)

Definition at line 186 of file find_font.cpp.

{
  string s=
    family * "-" * fn_class * "-" *
    series * "-" * shape * "-" *
    as_string (sz) * "-" * as_string (dpi);
  if (font::instances->contains (s)) return font (s);

  tree t1 (TUPLE, 6);
  t1[0]= family;
  t1[1]= fn_class;
  t1[2]= series; t1[3]= shape;
  t1[4]= as_string (sz); t1[5]= as_string (dpi);
  font fn= find_font (t1);
  if (!is_nil (fn)) {
    font::instances (s)= (pointer) fn.rep;
    return fn;
  }

  tree t2 (TUPLE, 5);
  t2[0]= family;
  t2[1]= fn_class; t2[2]= series;
  t2[3]= as_string (sz); t2[4]= as_string (dpi);
  fn= find_font (t2);
  if (!is_nil (fn)) {
    font::instances (s)= (pointer) fn.rep;
    return fn;
  }

  tree t3 (TUPLE, 4);
  t3[0]= family;
  t3[1]= fn_class; t3[2]= as_string (sz); t3[3]= as_string (dpi);
  fn= find_font (t3);
  if (!is_nil (fn)) {
    font::instances (s)= (pointer) fn.rep;
    return fn;
  }

  tree panic (TUPLE, "tex", "cmr", as_string (sz), as_string (dpi));
  fn= find_font (panic);
  font::instances (s)= (pointer) fn.rep;
  return fn;
}

Here is the call graph for this function:

void font_rule ( tree  which,
tree  by 
)

Definition at line 25 of file find_font.cpp.

                                {
  if ((arity (which) * arity (by) == 0) || is_compound (which[0])) return;
  if (!font_conversion->contains (which[0]->label))
    font_conversion (which[0]->label)=
      tree (TUPLE, tree (ASSOCIATE, which, by));
  else font_conversion (which[0]->label) << tree (ASSOCIATE, which, by);
}

Here is the call graph for this function:

Here is the caller graph for this function:

font math_font ( scheme_tree  t,
font  base_fn,
font  error_fn 
)

Definition at line 223 of file math_font.cpp.

                                                       {
  string full_name= "compound-" * scheme_tree_to_string (t);
  return make (font, full_name,
    tm_new<math_font_rep> (full_name, t, base_fn, error_fn));
}

Here is the call graph for this function:

Here is the caller graph for this function:

RESOURCE ( font  )
int script ( int  sz,
int  level 
)

Definition at line 186 of file font.cpp.

                           {
  int i;
  if (level<0) level=0;
  if (level>2) level=2;
  for (i=0; i<level; i++) sz= (sz*2+2)/3;
  return sz;
}

Here is the caller graph for this function:

font tex_adobe_font ( string  fam,
int  size,
int  dpi,
int  dsize = 10 
)

Definition at line 741 of file tex_font.cpp.

                                                             {
  string name= "adobe:" * family * as_string (size) * "@" * as_string(dpi);
  return make (font, name,
    tm_new<tex_font_rep> (name, TEX_ADOBE, family, size, dpi, dsize));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tex_cm_font ( string  fam,
int  size,
int  dpi,
int  dsize = 10 
)

Definition at line 720 of file tex_font.cpp.

                                                          {
  string name= "cm:" * family * as_string (size) * "@" * as_string(dpi);
  return make (font, name,
    tm_new<tex_font_rep> (name, TEX_CM, family, size, dpi, dsize));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tex_dummy_rubber_font ( font  base_fn)

Definition at line 305 of file tex_rubber_font.cpp.

                                     {
  string name= "tex-dummy(" * base_fn->res_name * ")";
  return make (font, name, tm_new<tex_dummy_rubber_font_rep> (name, base_fn));
}

Here is the caller graph for this function:

font tex_ec_font ( string  fam,
int  size,
int  dpi,
int  dsize = 10 
)

Definition at line 727 of file tex_font.cpp.

                                                          {
  string name= "ec:" * family * as_string (size) * "@" * as_string(dpi);
  return make (font, name,
    tm_new<tex_font_rep> (name, TEX_EC, family, size, dpi, dsize));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tex_font ( string  fam,
int  size,
int  dpi,
int  dsize = 10 
)

Definition at line 713 of file tex_font.cpp.

                                                       {
  string name= "tex:" * family * as_string (size) * "@" * as_string(dpi);
  return make (font, name,
    tm_new<tex_font_rep> (name, TEX_ANY, family, size, dpi, dsize));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tex_la_font ( string  fam,
int  size,
int  dpi,
int  dsize = 10 
)

Definition at line 734 of file tex_font.cpp.

                                                          {
  string name= "la:" * family * as_string (size) * "@" * as_string(dpi);
  return make (font, name,
    tm_new<tex_font_rep> (name, TEX_LA, family, size, dpi, dsize));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tex_rubber_font ( string  trl_name,
string  fam,
int  size,
int  dpi,
int  dsize = 10 
)

Definition at line 94 of file tex_rubber_font.cpp.

                                                            {
  string name= "tex-rubber:"*family * as_string (size) * "@" * as_string(dpi);
  return make (font, name,
    tm_new<tex_rubber_font_rep> (name, trl_name, family, size, dpi, dsize));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tt_font ( string  family,
int  size,
int  dpi 
)

Definition at line 182 of file tt_font.cpp.

                                           {
  string name= "tt:" * family * as_string (size) * "@" * as_string(dpi);
  cerr << "\n\nFont name= " << name << "\n";
  FAILED ("true type support was disabled");
  return font ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

font unicode_font ( string  family,
int  size,
int  dpi 
)

Definition at line 243 of file unicode_font.cpp.

                                                {
  string name= "unicode:" * family * as_string (size) * "@" * as_string(dpi);
  cerr << "\n\nFont name= " << name << "\n";
  FAILED ("true type support was disabled");
  return font ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

font unicode_math_font ( font  up,
font  it,
font  bup,
font  bit,
font  fb 
)

Definition at line 261 of file unicode_math_font.cpp.

                                                                  {
  string name=
    "unimath[" *
    up->res_name * "," *
    it->res_name * "," *
    bup->res_name * "," *
    bit->res_name * "," *
    fb->res_name * "]";
  cerr << "\n\nFont name= " << name << "\n";
  FAILED ("true type support was disabled");
  return font ();
}

Here is the caller graph for this function:

font virtual_font ( font  base,
string  family,
int  size,
int  dpi 
)

Definition at line 307 of file virtual_font.cpp.

                                                         {
  string full_name=
    base->res_name * "#virtual-" *
    name * as_string (size) * "@" * as_string (dpi);
  return make (font, full_name,
    tm_new<virtual_font_rep> (full_name, base, name, size, dpi));
}

Here is the call graph for this function:

Here is the caller graph for this function:

font x_font ( string  family,
int  size,
int  dpi 
)

Definition at line 535 of file aqua_gui.mm.

{
  (void) family; (void) size; (void) dpi;
  if (DEBUG_EVENTS) cout << "x_font(): SHOULD NOT BE CALLED\n";
  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function: