Back to index

texmacs  1.0.7.15
Classes | Functions
virtual_font.cpp File Reference
#include "font.hpp"
#include "translator.hpp"
#include "analyze.hpp"

Go to the source code of this file.

Classes

struct  virtual_font_rep

Functions

static void outer_fit (metric &ex, metric &ey, SI x, SI y)
static tree subst_sharp (tree t, string by)
static void make_char_font (string name, font_metric &cfnm, font_glyphs &cfng)
font virtual_font (font base, string name, int size, int dpi)

Function Documentation

static void make_char_font ( string  name,
font_metric cfnm,
font_glyphs &  cfng 
) [static]

Definition at line 238 of file virtual_font.cpp.

                                                                   {
  cfnm= std_font_metric (name, tm_new_array<metric> (1), 0, 0);
  cfng= std_font_glyphs (name, tm_new_array<glyph> (1), 0, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void outer_fit ( metric ex,
metric ey,
SI  x,
SI  y 
) [static]

Definition at line 56 of file virtual_font.cpp.

                                               {
  ex->x1= min (ex->x1, x+ ey->x1);
  ex->y1= min (ex->y1, y+ ey->y1);
  ex->x2= max (ex->x2, x+ ey->x2);
  ex->y2= max (ex->y2, y+ ey->y2);
  ex->x3= min (ex->x3, x+ ey->x3);
  ex->y3= min (ex->y3, y+ ey->y3);
  ex->x4= max (ex->x4, x+ ey->x4);
  ex->y4= max (ex->y4, y+ ey->y4);
}

Here is the caller graph for this function:

static tree subst_sharp ( tree  t,
string  by 
) [static]

Definition at line 220 of file virtual_font.cpp.

                                {
  if (is_atomic (t)) {
    int i;
    string s= t->label;
    i= search_forwards ("#", s);
    if (i == -1) return s;
    else return s(0,i) * by * s(i+1,N(s));
  }
  else {
    int i, n= N(t);
    tree r (t, n);
    for (i=0; i<n; i++)
      r[i]= subst_sharp (t[i], by);
    return r;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

font virtual_font ( font  base,
string  name,
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: