w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

vfovf.c File Reference
#include "ptexlib.h"
Include dependency graph for vfovf.c:

Go to the source code of this file.

Classes

struct  vf_stack_record
 

Macros

#define font_max   5000
 
#define set_char_0   0 /* typeset character 0 and move right */
 
#define set1   128 /* typeset a character and move right */
 
#define set2   129 /* typeset a character and move right */
 
#define set3   130 /* typeset a character and move right */
 
#define set4   131 /* typeset a character and move right */
 
#define set_rule   132 /* typeset a rule and move right */
 
#define put1   133 /* typeset a character without moving */
 
#define put2   134 /* typeset a character without moving */
 
#define put3   135 /* typeset a character without moving */
 
#define put4   136 /* typeset a character without moving */
 
#define put_rule   137 /* typeset a rule */
 
#define nop   138 /* no operation */
 
#define bop   139 /* beginning of page */
 
#define eop   140 /* ending of page */
 
#define push   141 /* save the current positions */
 
#define pop   142 /* restore previous positions */
 
#define right1   143 /* move right */
 
#define right2   144 /* move right */
 
#define right3   145 /* move right */
 
#define right4   146 /* move right, 4 bytes */
 
#define w0   147 /* move right by |w| */
 
#define w1   148 /* move right and set |w| */
 
#define w2   149 /* move right and set |w| */
 
#define w3   150 /* move right and set |w| */
 
#define w4   151 /* move right and set |w| */
 
#define x0   152 /* move right by |x| */
 
#define x1   153 /* move right and set |x| */
 
#define x2   154 /* move right and set |x| */
 
#define x3   155 /* move right and set |x| */
 
#define x4   156 /* move right and set |x| */
 
#define down1   157 /* move down */
 
#define down2   158 /* move down */
 
#define down3   159 /* move down */
 
#define down4   160 /* move down, 4 bytes */
 
#define y0   161 /* move down by |y| */
 
#define y1   162 /* move down and set |y| */
 
#define y2   163 /* move down and set |y| */
 
#define y3   164 /* move down and set |y| */
 
#define y4   165 /* move down and set |y| */
 
#define z0   166 /* move down by |z| */
 
#define z1   167 /* move down and set |z| */
 
#define z2   168 /* move down and set |z| */
 
#define z3   169 /* move down and set |z| */
 
#define z4   170 /* move down and set |z| */
 
#define fnt_num_0   171 /* set current font to 0 */
 
#define fnt1   235 /* set current font */
 
#define fnt2   236 /* set current font */
 
#define fnt3   237 /* set current font */
 
#define fnt4   238 /* set current font */
 
#define xxx1   239 /* extension to DVI primitives */
 
#define xxx2   240 /* extension to DVI primitives */
 
#define xxx3   241 /* extension to DVI primitives */
 
#define xxx4   242 /* potentially long extension to DVI primitives */
 
#define fnt_def1   243 /* define the meaning of a font number */
 
#define pre   247 /* preamble */
 
#define post   248 /* postamble beginning */
 
#define post_post   249 /* postamble ending */
 
#define yyy1   250 /* PDF literal text */
 
#define yyy2   251 /* PDF literal text */
 
#define yyy3   252 /* PDF literal text */
 
#define yyy4   253 /* PDF literal text */
 
#define null_font   0
 
#define long_char   242 /* |VF| command for general character packet */
 
#define vf_id   202 /* identifies \VF\ files */
 
#define bad_vf(a)
 
#define lua_bad_vf(a)
 
#define tmp_b0   tmp_w.qqqq.b0
 
#define tmp_b1   tmp_w.qqqq.b1
 
#define tmp_b2   tmp_w.qqqq.b2
 
#define tmp_b3   tmp_w.qqqq.b3
 
#define tmp_int   tmp_w.cint
 
#define vf_stack_size   100
 
#define vf_byte(a)
 
#define vf_replace_z()
 
#define vf_read(k, l)
 
#define vf_read_u(k, l)
 
#define append_packet(k)   vpackets[vf_np++] = (eight_bits)(k)
 
#define append_fnt_set(k)
 
#define append_four(k)
 
#define test_checksum()
 
#define test_dsize()
 
#define make_command0(N, K)
 
#define make_command1(N, V, K)
 
#define make_command2(N, V, W, K)
 
#define make_commands(N, S, V, K)
 

Typedefs

typedef unsigned char vf_stack_index
 
typedef struct vf_stack_record vf_stack_record
 

Functions

void pdf_check_vf (internal_font_number f)
 
static void vf_local_font_warning (internal_font_number f, internal_font_number k, const char *s, int a, int b)
 
static internal_font_number vf_def_font (internal_font_number f, unsigned char *vf_buffer, int *vf_cr)
 
static int open_vf_file (const char *fn, unsigned char **vbuffer, int *vsize)
 
static int count_packet_bytes (eight_bits *vf_buf, int cur_bute, int count)
 
void do_vf (internal_font_number f)
 
int make_vf_table (lua_State *L, const char *cnom, scaled atsize)
 
internal_font_number letter_space_font (internal_font_number f, int e, boolean nolig)
 
internal_font_number copy_font_info (internal_font_number f)
 

Variables

int level = 0
 

Macro Definition Documentation

◆ append_fnt_set

#define append_fnt_set (   k)
Value:
{ \
assert(k > 0); \
append_packet(packet_font_code); \
append_four(k); \
}
int k
Definition: otp-parser.c:70
@ packet_font_code
Definition: texfont.h:634

Definition at line 352 of file vfovf.c.

◆ append_four

#define append_four (   k)
Value:
{ \
append_packet((k & 0xFF000000) >> 24); \
append_packet((k & 0x00FF0000) >> 16); \
append_packet((k & 0x0000FF00) >> 8); \
append_packet((k & 0x000000FF)); \
}

Definition at line 359 of file vfovf.c.

◆ append_packet

#define append_packet (   k)    vpackets[vf_np++] = (eight_bits)(k)

Definition at line 343 of file vfovf.c.

◆ bad_vf

#define bad_vf (   a)
Value:
{ \
xfree(vf_buffer); \
print_nlp(); \
formatted_warning("virtual font","file '%s', %s, font will be ignored",font_name(f),a); \
print_ln(); \
return; \
}
mpz_t * f
Definition: gen-fib.c:34
#define a(n)
Definition: gpos-common.c:148
struct const_name font_name[]
Definition: picttoppm.c:492

Definition at line 101 of file vfovf.c.

◆ bop

#define bop (   void)    139 /* beginning of page */

Definition at line 39 of file vfovf.c.

◆ down1

#define down1   157 /* move down */

Definition at line 57 of file vfovf.c.

◆ down2

#define down2   158 /* move down */

Definition at line 58 of file vfovf.c.

◆ down3

#define down3   159 /* move down */

Definition at line 59 of file vfovf.c.

◆ down4

#define down4   160 /* move down, 4 bytes */

Definition at line 60 of file vfovf.c.

◆ eop

#define eop   140 /* ending of page */

Definition at line 40 of file vfovf.c.

◆ fnt1

#define fnt1   235 /* set current font */

Definition at line 72 of file vfovf.c.

◆ fnt2

#define fnt2   236 /* set current font */

Definition at line 73 of file vfovf.c.

◆ fnt3

#define fnt3   237 /* set current font */

Definition at line 74 of file vfovf.c.

◆ fnt4

#define fnt4   238 /* set current font */

Definition at line 75 of file vfovf.c.

◆ fnt_def1

#define fnt_def1   243 /* define the meaning of a font number */

Definition at line 80 of file vfovf.c.

◆ fnt_num_0

#define fnt_num_0   171 /* set current font to 0 */

Definition at line 71 of file vfovf.c.

◆ font_max

#define font_max   5000

Definition at line 23 of file vfovf.c.

◆ long_char

#define long_char   242 /* |VF| command for general character packet */

Definition at line 91 of file vfovf.c.

◆ lua_bad_vf

#define lua_bad_vf (   a)
Value:
{ \
xfree(vf_buffer); \
lua_settop(L,s_top); \
lua_pushnil(L); \
lua_pushstring(L,a); \
return 2; \
}
@ L
Definition: ubidiimp.h:45

Definition at line 109 of file vfovf.c.

◆ make_command0

#define make_command0 (   N,
  K 
)
Value:
{ \
lua_newtable(L); \
lua_pushstring(L, N); \
lua_rawseti(L,-2, 1); \
lua_rawseti(L,-2, K); \
K++; }
cmd_t K[128]
Definition: fmtutil.c:72
long unsigned N
Definition: tex4ht.c:2765

Definition at line 1011 of file vfovf.c.

◆ make_command1

#define make_command1 (   N,
  V,
  K 
)
Value:
{ \
lua_newtable(L); \
lua_pushstring(L, N); \
lua_rawseti(L,-2, 1); \
lua_pushinteger(L, V); \
lua_rawseti(L,-2, 2); \
lua_rawseti(L,-2, K); \
K++; }
#define V
Definition: pgmcrater.c:68

Definition at line 1018 of file vfovf.c.

◆ make_command2

#define make_command2 (   N,
  V,
  W,
  K 
)
Value:
{ \
lua_newtable(L); \
lua_pushstring(L, N); \
lua_rawseti(L,-2, 1); \
lua_pushinteger(L, V); \
lua_rawseti(L,-2, 2); \
lua_pushinteger(L, W); \
lua_rawseti(L,-2, 3); \
lua_rawseti(L,-2, K); \
K++; }
#define W
Definition: dtl.h:141

Definition at line 1027 of file vfovf.c.

◆ make_commands

#define make_commands (   N,
  S,
  V,
  K 
)
Value:
{ \
lua_newtable(L); \
lua_pushstring(L, N); \
lua_rawseti(L,-2, 1); \
lua_pushlstring(L, S, V); \
lua_rawseti(L,-2, 2); \
lua_rawseti(L,-2, K); \
K++; }
@ S
Definition: ubidiimp.h:53

Definition at line 1038 of file vfovf.c.

◆ nop

#define nop   138 /* no operation */

Definition at line 38 of file vfovf.c.

◆ null_font

#define null_font   0

Definition at line 89 of file vfovf.c.

◆ pop

#define pop (   void)    142 /* restore previous positions */

Definition at line 42 of file vfovf.c.

◆ post

#define post   248 /* postamble beginning */

Definition at line 82 of file vfovf.c.

◆ post_post

#define post_post   249 /* postamble ending */

Definition at line 83 of file vfovf.c.

◆ pre

#define pre   247 /* preamble */

Definition at line 81 of file vfovf.c.

◆ push

#define push   141 /* save the current positions */

Definition at line 41 of file vfovf.c.

◆ put1

#define put1   133 /* typeset a character without moving */

Definition at line 33 of file vfovf.c.

◆ put2

#define put2   134 /* typeset a character without moving */

Definition at line 34 of file vfovf.c.

◆ put3

#define put3   135 /* typeset a character without moving */

Definition at line 35 of file vfovf.c.

◆ put4

#define put4   136 /* typeset a character without moving */

Definition at line 36 of file vfovf.c.

◆ put_rule

#define put_rule   137 /* typeset a rule */

Definition at line 37 of file vfovf.c.

◆ right1

#define right1   143 /* move right */

Definition at line 43 of file vfovf.c.

◆ right2

#define right2   144 /* move right */

Definition at line 44 of file vfovf.c.

◆ right3

#define right3   145 /* move right */

Definition at line 45 of file vfovf.c.

◆ right4

#define right4   146 /* move right, 4 bytes */

Definition at line 46 of file vfovf.c.

◆ set1

#define set1   128 /* typeset a character and move right */

Definition at line 28 of file vfovf.c.

◆ set2

#define set2   129 /* typeset a character and move right */

Definition at line 29 of file vfovf.c.

◆ set3

#define set3   130 /* typeset a character and move right */

Definition at line 30 of file vfovf.c.

◆ set4

#define set4   131 /* typeset a character and move right */

Definition at line 31 of file vfovf.c.

◆ set_char_0

#define set_char_0   0 /* typeset character 0 and move right */

Definition at line 27 of file vfovf.c.

◆ set_rule

#define set_rule   132 /* typeset a rule and move right */

Definition at line 32 of file vfovf.c.

◆ test_checksum

#define test_checksum ( )
Value:
vf_byte(tmp_b2); vf_byte(tmp_b3); \
if (((tmp_b0 != 0) || (tmp_b1 != 0) || (tmp_b2 != 0) || (tmp_b3 != 0)) && \
((font_check_0(f) != 0) || (font_check_1(f) != 0) || \
(font_check_2(f) != 0) || (font_check_3(f) != 0)) && \
((tmp_b0 != font_check_0(f)) || (tmp_b1 != font_check_1(f)) || \
(tmp_b2 != font_check_2(f)) || (tmp_b3 != font_check_3(f)))) { \
print_nlp(); \
tprint("checksum mismatch in font "); \
tprint(font_name(f)); \
tprint(".vf ignored "); } }
#define font_check_2(a)
Definition: texfont.h:232
#define font_check_0(a)
Definition: texfont.h:230
#define font_check_1(a)
Definition: texfont.h:231
#define font_check_3(a)
Definition: texfont.h:233
#define tmp_b2
Definition: vfovf.c:119
#define vf_byte(a)
Definition: vfovf.c:137
#define tmp_b0
Definition: vfovf.c:117
#define tmp_b1
Definition: vfovf.c:118
#define tmp_b3
Definition: vfovf.c:120

Definition at line 369 of file vfovf.c.

◆ test_dsize

#define test_dsize ( )
Value:
{ \
int read_tmp; \
vf_read(4, read_tmp); \
if ((read_tmp / 16) != font_dsize(f)) { \
print_nlp(); \
tprint("design size mismatch in font "); \
tprint(font_name(f)); \
tprint(".vf ignored"); \
} \
}
#define font_dsize(a)
Definition: texfont.h:237

Definition at line 381 of file vfovf.c.

◆ tmp_b0

#define tmp_b0   tmp_w.qqqq.b0

Definition at line 117 of file vfovf.c.

◆ tmp_b1

#define tmp_b1   tmp_w.qqqq.b1

Definition at line 118 of file vfovf.c.

◆ tmp_b2

#define tmp_b2   tmp_w.qqqq.b2

Definition at line 119 of file vfovf.c.

◆ tmp_b3

#define tmp_b3   tmp_w.qqqq.b3

Definition at line 120 of file vfovf.c.

◆ tmp_int

#define tmp_int   tmp_w.cint

Definition at line 121 of file vfovf.c.

◆ vf_byte

#define vf_byte (   a)
Value:
{ \
eight_bits vf_tmp_b; \
if (vf_cur >= vf_size) { \
normal_error("virtual font","unexpected eof"); \
} \
vf_tmp_b = vf_buffer[vf_cur++]; \
a = vf_tmp_b; \
}

Definition at line 137 of file vfovf.c.

◆ vf_id

#define vf_id   202 /* identifies \VF\ files */

Definition at line 93 of file vfovf.c.

◆ vf_read

#define vf_read (   k,
 
)
Value:
{ \
int itmp = 0, dtmp = (int)(k), jtmp = 0; \
while (dtmp > 0) { \
vf_byte(jtmp); \
if ((dtmp == (int) k) && jtmp > 127) \
jtmp = jtmp - 256; \
itmp = itmp * 256 + jtmp; \
decr(dtmp); \
} \
l = itmp; \
}
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)

Definition at line 165 of file vfovf.c.

◆ vf_read_u

#define vf_read_u (   k,
 
)
Value:
{ \
int dtmp = (int)(k); \
unsigned int itmp = 0, jtmp = 0; \
while (dtmp-- > 0) { \
vf_byte(jtmp); \
itmp = itmp * 256 + jtmp; \
} \
l = itmp; \
}

Definition at line 178 of file vfovf.c.

◆ vf_replace_z

#define vf_replace_z ( )
Value:
{ \
vf_alpha = 16; \
while (vf_z >= 040000000) { \
vf_z = vf_z / 2; \
vf_alpha += vf_alpha; \
} \
/*tex |vf_beta = (char)(256 / vf_alpha)| */ \
vf_alpha = (vf_alpha * vf_z); \
}
static void vf_z(SIGNED_QUAD z, spt_t ptsize)
Definition: vf.c:700

Definition at line 147 of file vfovf.c.

◆ vf_stack_size

#define vf_stack_size   100

Definition at line 125 of file vfovf.c.

◆ w0

#define w0   147 /* move right by |w| */

Definition at line 47 of file vfovf.c.

◆ w1

#define w1   148 /* move right and set |w| */

Definition at line 48 of file vfovf.c.

◆ w2

#define w2   149 /* move right and set |w| */

Definition at line 49 of file vfovf.c.

◆ w3

#define w3   150 /* move right and set |w| */

Definition at line 50 of file vfovf.c.

◆ w4

#define w4   151 /* move right and set |w| */

Definition at line 51 of file vfovf.c.

◆ x0

#define x0   152 /* move right by |x| */

Definition at line 52 of file vfovf.c.

◆ x1

#define x1   153 /* move right and set |x| */

Definition at line 53 of file vfovf.c.

◆ x2

#define x2   154 /* move right and set |x| */

Definition at line 54 of file vfovf.c.

◆ x3

#define x3   155 /* move right and set |x| */

Definition at line 55 of file vfovf.c.

◆ x4

#define x4   156 /* move right and set |x| */

Definition at line 56 of file vfovf.c.

◆ xxx1

#define xxx1   239 /* extension to DVI primitives */

Definition at line 76 of file vfovf.c.

◆ xxx2

#define xxx2   240 /* extension to DVI primitives */

Definition at line 77 of file vfovf.c.

◆ xxx3

#define xxx3   241 /* extension to DVI primitives */

Definition at line 78 of file vfovf.c.

◆ xxx4

#define xxx4   242 /* potentially long extension to DVI primitives */

Definition at line 79 of file vfovf.c.

◆ y0

#define y0   161 /* move down by |y| */

Definition at line 61 of file vfovf.c.

◆ y1

#define y1   162 /* move down and set |y| */

Definition at line 62 of file vfovf.c.

◆ y2

#define y2   163 /* move down and set |y| */

Definition at line 63 of file vfovf.c.

◆ y3

#define y3   164 /* move down and set |y| */

Definition at line 64 of file vfovf.c.

◆ y4

#define y4   165 /* move down and set |y| */

Definition at line 65 of file vfovf.c.

◆ yyy1

#define yyy1   250 /* PDF literal text */

Definition at line 84 of file vfovf.c.

◆ yyy2

#define yyy2   251 /* PDF literal text */

Definition at line 85 of file vfovf.c.

◆ yyy3

#define yyy3   252 /* PDF literal text */

Definition at line 86 of file vfovf.c.

◆ yyy4

#define yyy4   253 /* PDF literal text */

Definition at line 87 of file vfovf.c.

◆ z0

#define z0   166 /* move down by |z| */

Definition at line 66 of file vfovf.c.

◆ z1

#define z1   167 /* move down and set |z| */

Definition at line 67 of file vfovf.c.

◆ z2

#define z2   168 /* move down and set |z| */

Definition at line 68 of file vfovf.c.

◆ z3

#define z3   169 /* move down and set |z| */

Definition at line 69 of file vfovf.c.

◆ z4

#define z4   170 /* move down and set |z| */

Definition at line 70 of file vfovf.c.

Typedef Documentation

◆ vf_stack_index

typedef unsigned char vf_stack_index

Definition at line 129 of file vfovf.c.

◆ vf_stack_record

Function Documentation

◆ copy_font_info()

Definition at line 1441 of file vfovf.c.

References copy_font(), and f.

Referenced by make_font_copy().

◆ count_packet_bytes()

static int count_packet_bytes ( eight_bits vf_buf,
int  cur_bute,
int  count 
)
static

Definition at line 393 of file vfovf.c.

References acc, cmd, count, d, down1, down2, down3, down4, fnt1, fnt2, fnt3, fnt4, fnt_num_0, int(), k, nop, pop, push, put1, put2, put3, put4, put_rule, right1, right2, right3, right4, set1, set2, set3, set4, set_rule, w0, w1, w2, w3, w4, x0, x1, x2, x3, x4, xxx1, xxx2, xxx3, xxx4, y0, y1, y2, y3, y4, z0, z1, z2, z3, and z4.

Referenced by do_vf().

◆ do_vf()

◆ letter_space_font()

◆ make_vf_table()

◆ open_vf_file()

static int open_vf_file ( const char *  fn,
unsigned char **  vbuffer,
int vsize 
)
static

◆ pdf_check_vf()

void pdf_check_vf ( internal_font_number  f)

Definition at line 189 of file vfovf.c.

References f, font_type, normal_error(), and virtual_font_type.

Referenced by do_feedback_pdf().

◆ vf_def_font()

◆ vf_local_font_warning()

static void vf_local_font_warning ( internal_font_number  f,
internal_font_number  k,
const char *  s,
int  a,
int  b 
)
static

Definition at line 195 of file vfovf.c.

References a, b, f, font_name, k, print_int(), print_nlp(), s, and tprint().

Referenced by vf_def_font().

Variable Documentation

◆ level

int level = 0

Definition at line 212 of file vfovf.c.

Referenced by vf_def_font().