Back to index

texmacs  1.0.7.15
Functions
tt_file.hpp File Reference
#include "url.hpp"
#include "bitmap_font.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool tt_font_exists (string name)
url tt_font_find (string name)
string tt_find_name (string name, int size)

Function Documentation

string tt_find_name ( string  name,
int  size 
)

Definition at line 163 of file tt_file.cpp.

                                     {
  string s= "tt:" * name * as_string (size);
  if (is_cached ("font_cache.scm", s)) {
    string r= cache_get ("font_cache.scm", s) -> label;
    if (tt_font_exists (r)) return r;
    cache_reset ("font_cache.scm", s);
  }

  bench_start ("tt find name");
  string r= tt_find_name_sub (name, size);
  //cout << name << size << " -> " << r << "\n";
  bench_cumul ("tt find name");

  if (r != "") cache_set ("font_cache.scm", s, r);
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool tt_font_exists ( string  name)

Definition at line 126 of file tt_file.cpp.

                             {
  //cout << "tt_font_exists? " << name << "\n";
  if (tt_fonts->contains (name)) return tt_fonts[name] == "yes";
  bool yes= !is_none (tt_font_find (name));
  tt_fonts (name)= yes? string ("yes"): string ("no");
  return yes;
}

Here is the call graph for this function:

Here is the caller graph for this function:

url tt_font_find ( string  name)

Definition at line 109 of file tt_file.cpp.

                           {
  string s= "ttf:" * name;
  if (is_cached ("font_cache.scm", s)) {
    string r= cache_get ("font_cache.scm", s) -> label;
    if (r == "") return url_none ();
    url u= url_system (r);
    if (exists (u)) return u;
    cache_reset ("font_cache.scm", s);
  }

  url r= tt_font_find_sub (name);
  if (is_none (r)) cache_set ("font_cache.scm", s, "");
  else cache_set ("font_cache.scm", s, as_string (r));
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function: