Back to index

texmacs  1.0.7.15
Classes | Defines | Functions | Variables
tex_font.cpp File Reference
#include "font.hpp"
#include "Metafont/load_tex.hpp"
#include "translator.hpp"
#include "iterator.hpp"
#include "gui.hpp"

Go to the source code of this file.

Classes

struct  tex_font_rep

Defines

#define TEX_ANY   0
#define TEX_EC   1
#define TEX_LA   2
#define TEX_CM   3
#define TEX_ADOBE   4
#define conv(x)   ((SI) (((double) (x))*unit))
#define ACCENTS_PREPARE

Functions

static void special_initialize ()
static string get_unaccented (string s)
static string get_accents (string s)
font tex_font (string family, int size, int dpi, int dsize)
font tex_cm_font (string family, int size, int dpi, int dsize)
font tex_ec_font (string family, int size, int dpi, int dsize)
font tex_la_font (string family, int size, int dpi, int dsize)
font tex_adobe_font (string family, int size, int dpi, int dsize)

Variables

static bool special_initialized = false
static hashmap< string, stringspecial_translate ("")
static char CM_unaccented [128]
static char CM_accents [128]
static char ADOBE_unaccented [128]
static char ADOBE_accents [128]
static char * the_unaccented
static char * the_accents

Define Documentation

#define ACCENTS_PREPARE
Value:
if (status==TEX_CM) { \
    the_unaccented= CM_unaccented; \
    the_accents   = CM_accents; \
  } \
  else { \
    the_unaccented= ADOBE_unaccented; \
    the_accents   = ADOBE_accents; \
  }

Definition at line 335 of file tex_font.cpp.

#define conv (   x)    ((SI) (((double) (x))*unit))

Definition at line 64 of file tex_font.cpp.

#define TEX_ADOBE   4

Definition at line 22 of file tex_font.cpp.

#define TEX_ANY   0

Definition at line 18 of file tex_font.cpp.

#define TEX_CM   3

Definition at line 21 of file tex_font.cpp.

#define TEX_EC   1

Definition at line 19 of file tex_font.cpp.

#define TEX_LA   2

Definition at line 20 of file tex_font.cpp.


Function Documentation

static string get_accents ( string  s) [static]

Definition at line 360 of file tex_font.cpp.

                       {
  int i;
  string r(N(s));
  for (i=0; i<N(s); i++)
    if ((s[i] & 128) == 0) r[i]= ' ';
    else r[i]= (char) the_accents [s[i] & 127];
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static string get_unaccented ( string  s) [static]

Definition at line 346 of file tex_font.cpp.

                          {
  int i;
  string r(N(s));
  for (i=0; i<N(s); i++)
    if ((s[i] & 128) == 0) r[i]= s[i];
    else {
      char c= the_unaccented[s[i] & 127];
      if (c==' ') r[i]= s[i];
      else r[i]= the_unaccented[s[i] & 127];
    }
  return r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void special_initialize ( ) [static]

Definition at line 126 of file tex_font.cpp.

                      {
  if (special_initialized) return;
  special_translate ("<less>")= "<";
  special_translate ("<gtr>")= ">";
  translator trl= load_translator ("larm");
  iterator<string> it= iterate (trl->dict);
  while (it->busy ()) {
    string s= it->next ();
    special_translate (s)= string ((char) (unsigned char) trl->dict[s]);
  }
  special_initialized= true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

font tex_adobe_font ( string  family,
int  size,
int  dpi,
int  dsize 
)

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  family,
int  size,
int  dpi,
int  dsize 
)

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_ec_font ( string  family,
int  size,
int  dpi,
int  dsize 
)

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  family,
int  size,
int  dpi,
int  dsize 
)

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  family,
int  size,
int  dpi,
int  dsize 
)

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:


Variable Documentation

char ADOBE_accents[128] [static]
Initial value:
 {
  198, 206, 194, 207, 207, 207, 206, 198,
  194, 39 , ' ', 194, 207, ' ', 205, 194,
  207, 194, 207, 203, 207, 203, 205, 202,
  200, 194, 207, 199, ' ', 199, 197, ' ',
  198, 206, 194, 207, 207, 207, 206, 198,
  194, 39 , ' ', 194, 207, ' ', 205, 194,
  207, 194, 207, 203, 207, 203, 205, 202,
  200, 194, 207, 199, ' ', ' ', ' ', ' ',
  193, 194, 195, 196, 200, 202, ' ', 203,
  193, 194, 195, 200, 193, 194, 195, 200,
  197, 196, 193, 194, 195, 196, 200, ' ',
  ' ', 193, 194, 195, 200, 194, ' ', ' ',
  193, 194, 195, 196, 200, 202, ' ', 203,
  193, 194, 195, 200, 193, 194, 195, 200,
  197, 196, 193, 194, 195, 196, 200, ' ',
  ' ', 193, 194, 195, 200, 194, ' ', ' '
}

Definition at line 313 of file tex_font.cpp.

char ADOBE_unaccented[128] [static]
Initial value:
 {
  'A', 'A', 'C', 'C', 'D', 'E', 'E', 'G',
  'L', 'L', 232, 'N', 'N', ' ', 'O', 'R',
  'R', 'S', 'S', 'S', 'T', 'T', 'U', 'U',
  'Y', 'Z', 'Z', 'Z', ' ', 'I', 'd', 167,
  'a', 'a', 'c', 'c', 'd', 'e', 'e', 'g',
  'l', 'l', 248, 'n', 'n', ' ', 'o', 'r',
  'r', 's', 's', 's', 't', 't', 'u', 'u',
  'y', 'z', 'z', 'z', ' ', 161, 191, 163,
  'A', 'A', 'A', 'A', 'A', 'A', 225, 'C',
  'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
  'D', 'N', 'O', 'O', 'O', 'O', 'O', 30 ,
  233, 'U', 'U', 'U', 'U', 'Y', ' ', ' ',
  'a', 'a', 'a', 'a', 'a', 'a', 241, 'c',
  'e', 'e', 'e', 'e', 245, 245, 245, 245,
  'd', 'n', 'o', 'o', 'o', 'o', 'o', 250,
  249, 'u', 'u', 'u', 'u', 'y', ' ', 251
}

Definition at line 294 of file tex_font.cpp.

char CM_accents[128] [static]
Initial value:
 {
  21 , ' ', 19 , 20 , 20 , 20 , ' ', 21 ,
  19 , 39 , ' ', 19 , 20 , ' ', 125, 19 ,
  20 , 19 , 20 , 24 , 20 , 24 , 125, 23 ,
  127, 19 , 20 , 95 , ' ', 95 , 22 , ' ',
  21 , ' ', 19 , 20 , 20 , 20 , ' ', 21 ,
  19 , 39 , ' ', 19 , 20 , ' ', 125, 19 ,
  20 , 19 , 20 , 24 , 20 , 24 , 125, 23 ,
  127, 19 , 20 , 95 , ' ', ' ', ' ', ' ',
  18 , 19 , 94 , 126, 127, 23 , ' ', 24 ,
  18 , 19 , 94 , 127, 18 , 19 , 94 , 127,
  22 , 126, 18 , 19 , 94 , 126, 127, ' ',
  ' ', 18 , 19 , 94 , 127, 19 , ' ', ' ',
  18 , 19 , 94 , 126, 127, 23 , ' ', 24 ,
  18 , 19 , 94 , 127, 18 , 19 , 94 , 127,
  22 , 126, 18 , 19 , 94 , 126, 127, ' ',
  ' ', 18 , 19 , 94 , 127, 19 , ' ', ' '
}

Definition at line 275 of file tex_font.cpp.

char CM_unaccented[128] [static]
Initial value:
 {
  'A', ' ', 'C', 'C', 'D', 'E', ' ', 'G',
  'L', 'L', ' ', 'N', 'N', ' ', 'O', 'R',
  'R', 'S', 'S', 'S', 'T', 'T', 'U', 'U',
  'Y', 'Z', 'Z', 'Z', ' ', 'I', 'd', ' ',
  'a', ' ', 'c', 'c', 'd', 'e', ' ', 'g',
  'l', 'l', ' ', 'n', 'n', ' ', 'o', 'r',
  'r', 's', 's', 's', 't', 't', 'u', 'u',
  'y', 'z', 'z', 'z', ' ', 60 , 62 , ' ',
  'A', 'A', 'A', 'A', 'A', 'A', 29 , 'C',
  'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
  'D', 'N', 'O', 'O', 'O', 'O', 'O', 30 ,
  31 , 'U', 'U', 'U', 'U', 'Y', ' ', ' ',
  'a', 'a', 'a', 'a', 'a', 'a', 26 , 'c',
  'e', 'e', 'e', 'e', 16 , 16 , 16 , 16 ,
  'd', 'n', 'o', 'o', 'o', 'o', 'o', 27 ,
  28 , 'u', 'u', 'u', 'u', 'y', ' ', 25
}

Definition at line 256 of file tex_font.cpp.

bool special_initialized = false [static]

Definition at line 122 of file tex_font.cpp.

char* the_accents [static]

Definition at line 333 of file tex_font.cpp.

char* the_unaccented [static]

Definition at line 332 of file tex_font.cpp.