beta-0.89.2
[luatex.git] / source / texk / web2c / luatexdir / font / texfont.h
blob3b2773109f21ece5c0fbe67631ee37eac707132d
1 /* texfont.h Main font API implementation for the pascal parts
3 Copyright 2006-2010 Taco Hoekwater <taco@luatex.org>
5 This file is part of LuaTeX.
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
21 /* Here we have the interface to LuaTeX's font system, as seen from the
22 main pascal program. There is a companion list in luatex.defines to
23 keep web2c happy */
26 This file is read at the end of ptexlib.h, which is called for at
27 the end of luatexcoerce.h, as well as from the C sources.
30 #ifndef TEXFONT_H
31 # define TEXFONT_H
33 # define pointer halfword
35 /* these are dumped en block, so they need endianness tests */
37 typedef struct liginfo {
38 # ifdef WORDS_BIGENDIAN
39 int adj;
40 int lig;
41 int type;
42 # else
43 int type;
44 int lig;
45 int adj;
46 # endif
47 } liginfo;
49 /* these are dumped en block, so they need endianness tests */
51 typedef struct kerninfo {
52 # ifdef WORDS_BIGENDIAN
53 int adj;
54 scaled sc;
55 # else
56 scaled sc;
57 int adj;
58 # endif
59 } kerninfo;
61 typedef struct extinfo {
62 struct extinfo *next;
63 int glyph;
64 int start_overlap;
65 int end_overlap;
66 int advance;
67 int extender;
68 } extinfo;
70 /* todo: maybe create a 'math info structure' */
72 typedef struct charinfo {
73 char *name; /* postscript character name */
74 liginfo *ligatures; /* ligature items */
75 kerninfo *kerns; /* kern items */
76 eight_bits *packets; /* virtual commands. */
77 unsigned short index; /* CID index */
78 int remainder; /* spare value for odd items, could be union-ed with extensible */
79 scaled width; /* width */
80 scaled height; /* height */
81 scaled depth; /* depth */
82 scaled italic; /* italic correction */
83 scaled vert_italic; /* italic correction */
84 scaled top_accent; /* top accent alignment */
85 scaled bot_accent; /* bot accent alignment */
86 int ef; /* font expansion factor */
87 int lp; /* left protruding factor */
88 int rp; /* right protruding factor */
89 char tag; /* list / ext taginfo */
90 char used; /* char is typeset ? */
91 char *tounicode; /* unicode equivalent */
92 extinfo *hor_variants; /* horizontal variants */
93 extinfo *vert_variants; /* vertical variants */
94 int top_left_math_kerns;
95 int top_right_math_kerns;
96 int bottom_right_math_kerns;
97 int bottom_left_math_kerns;
98 scaled *top_left_math_kern_array;
99 scaled *top_right_math_kern_array;
100 scaled *bottom_right_math_kern_array;
101 scaled *bottom_left_math_kern_array;
102 } charinfo;
104 # define EXT_NORMAL 0
105 # define EXT_REPEAT 1
107 extern extinfo *get_charinfo_vert_variants(charinfo * ci);
108 extern extinfo *get_charinfo_hor_variants(charinfo * ci);
109 extern void set_charinfo_hor_variants(charinfo * ci, extinfo * ext);
110 extern void set_charinfo_vert_variants(charinfo * ci, extinfo * ext);
111 extern void add_charinfo_vert_variant(charinfo * ci, extinfo * ext);
112 extern void add_charinfo_hor_variant(charinfo * ci, extinfo * ext);
114 extern extinfo *copy_variants(extinfo * o);
116 extern extinfo *new_variant(int glyph, int startconnect, int endconnect, int advance, int repeater);
118 extern scaled_whd get_charinfo_whd(internal_font_number f, int c);
120 typedef struct texfont {
121 int _font_size;
122 int _font_dsize;
123 int _font_units_per_em;
124 char *_font_name;
125 char *_font_area;
126 char *_font_filename;
127 char *_font_fullname;
128 char *_font_psname;
129 char *_font_encodingname;
130 char *_font_cidregistry;
131 char *_font_cidordering;
132 int _font_cidversion;
133 int _font_cidsupplement;
135 int _font_ec;
136 unsigned _font_checksum; /* internal information */
137 char _font_used; /* internal information */
138 char _font_touched; /* internal information */
139 int _font_cache_id; /* internal information */
140 char _font_encodingbytes; /* 1 or 2 bytes */
141 boolean _font_oldmath; /* default to false when MathConstants seen */
143 int _font_slant; /* a slant in ppt */
144 int _font_extend; /* an extension in ppt, or 1000 */
145 int font_max_shrink;
146 int font_max_stretch;
147 int _font_step; /* amount of one step of expansion */
148 boolean _font_auto_expand; /* this font is auto-expanded? */
150 char _font_tounicode; /* 1 if info is present */
151 fm_entry *_font_map;
152 int _font_type;
153 int _font_format;
154 int _font_embedding;
155 int _font_bc;
156 int _hyphen_char;
157 int _skew_char;
158 int _font_natural_dir;
160 charinfo *_left_boundary;
161 charinfo *_right_boundary;
163 int _font_params;
164 scaled *_param_base;
166 int _font_math_params;
167 scaled *_math_param_base;
169 sa_tree characters;
170 int charinfo_count;
171 int charinfo_size;
172 charinfo *charinfo;
173 int *charinfo_cache;
174 int ligatures_disabled;
176 int _pdf_font_num; /* maps to a PDF resource ID */
177 str_number _pdf_font_attr; /* pointer to additional attributes */
178 } texfont;
180 typedef enum {
181 unknown_font_type = 0, /* new font (has not been used yet) */
182 virtual_font_type, /* virtual font */
183 real_font_type, /* real font */
184 } font_types;
186 typedef enum {
187 unknown_format = 0,
188 type1_format,
189 type3_format,
190 truetype_format,
191 opentype_format,
192 } font_formats;
194 typedef enum {
195 unknown_embedding = 0,
196 no_embedding,
197 subset_embedding,
198 full_embedding,
199 } font_embedding_option;
201 extern const char *font_type_strings[];
202 extern const char *font_format_strings[];
203 extern const char *font_embedding_strings[];
205 # define font_checksum(a) font_tables[a]->_font_checksum
206 # define set_font_checksum(a,b) font_checksum(a) = b
208 # define font_check_0(a) ((font_tables[a]->_font_checksum&0xFF000000)>>24)
209 # define font_check_1(a) ((font_tables[a]->_font_checksum&0x00FF0000)>>16)
210 # define font_check_2(a) ((font_tables[a]->_font_checksum&0x0000FF00)>>8)
211 # define font_check_3(a) (font_tables[a]->_font_checksum&0x000000FF)
213 # define font_size(a) font_tables[a]->_font_size
214 # define set_font_size(a,b) font_size(a) = b
215 # define font_dsize(a) font_tables[a]->_font_dsize
216 # define set_font_dsize(a,b) font_dsize(a) = b
218 # define font_units_per_em(a) font_tables[a]->_font_units_per_em
219 # define set_font_units_per_em(a,b) font_units_per_em(a) = b
221 # define font_name(a) font_tables[a]->_font_name
222 # define get_font_name(a) (unsigned char *)font_name(a)
223 # define set_font_name(f,b) font_name(f) = b
224 # define tex_font_name(a) maketexstring(font_name(a))
226 # define font_area(a) font_tables[a]->_font_area
227 # define get_font_area(a) (unsigned char *)font_area(a)
228 # define set_font_area(f,b) font_area(f) = b
229 # define tex_font_area(a) maketexstring(font_area(a))
231 boolean cmp_font_area(int, str_number);
233 # define font_reassign(a,b) { if (a!=NULL) free(a); a = b; }
235 # define font_filename(a) font_tables[a]->_font_filename
236 # define set_font_filename(f,b) font_reassign(font_filename(f),b)
238 # define font_fullname(a) font_tables[a]->_font_fullname
239 # define set_font_fullname(f,b) font_reassign(font_fullname(f),b)
241 # define font_psname(a) font_tables[a]->_font_psname
242 # define set_font_psname(f,b) font_reassign(font_psname(f),b)
244 # define font_encodingname(a) font_tables[a]->_font_encodingname
245 # define set_font_encodingname(f,b) font_reassign(font_encodingname(f),b)
247 # define cmp_font_filename(a,b) (!(font_filename(a)!=NULL || font_filename(b)!=NULL || \
248 strcmp(font_filename(a),font_filename(b))))
249 # define cmp_font_fullname(a,b) (!(font_fullname(a)!=NULL || font_fullname(b)!=NULL || \
250 strcmp(font_fullname(a),font_fullname(b))))
251 # define cmp_font_encodingname(a,b) (!(font_encoding(a)!=NULL || font_encodingname(b)!=NULL || \
252 strcmp(font_encodingname(a),font_encodingname(b))))
254 # define font_bc(a) font_tables[a]->_font_bc
255 # define set_font_bc(f,b) font_bc(f) = b
257 # define font_ec(a) font_tables[a]->_font_ec
258 # define set_font_ec(f,b) font_ec(f) = b
260 # define font_used(a) (font_tables[a]!=NULL && font_tables[a]->_font_used)
261 # define set_font_used(a,b) font_tables[a]->_font_used = b
263 # define font_touched(a) font_tables[a]->_font_touched
264 # define set_font_touched(a,b) font_touched(a) = b
266 # define font_type(a) font_tables[a]->_font_type
267 # define set_font_type(a,b) font_type(a) = b;
269 # define font_format(a) font_tables[a]->_font_format
270 # define font_format_name(a) font_format_strings[font_tables[a]->_font_format]
271 # define set_font_format(a,b) font_format(a) = b
273 # define font_embedding(a) font_tables[a]->_font_embedding
274 # define set_font_embedding(a,b) font_embedding(a) = b
276 # define font_cidversion(a) font_tables[a]->_font_cidversion
277 # define set_font_cidversion(a,b) font_cidversion(a) = b
279 # define font_cidsupplement(a) font_tables[a]->_font_cidsupplement
280 # define set_font_cidsupplement(a,b) font_cidsupplement(a) = b
282 # define font_cidordering(a) font_tables[a]->_font_cidordering
283 # define set_font_cidordering(f,b) font_reassign(font_cidordering(f),b)
285 # define font_cidregistry(a) font_tables[a]->_font_cidregistry
286 # define set_font_cidregistry(f,b) font_reassign(font_cidregistry(f),b)
288 # define font_map(a) font_tables[a]->_font_map
289 # define set_font_map(a,b) font_map(a) = b
291 # define font_cache_id(a) font_tables[a]->_font_cache_id
292 # define set_font_cache_id(a,b) font_cache_id(a) = b
294 # define font_encodingbytes(a) font_tables[a]->_font_encodingbytes
295 # define set_font_encodingbytes(a,b) font_encodingbytes(a) = b
297 # define font_oldmath(a) font_tables[a]->_font_oldmath
298 # define set_font_oldmath(a,b) font_oldmath(a) = b
300 # define font_slant(a) font_tables[a]->_font_slant
301 # define set_font_slant(a,b) font_slant(a) = b
303 # define font_extend(a) font_tables[a]->_font_extend
304 # define set_font_extend(a,b) font_extend(a) = b
306 # define font_shrink(a) font_tables[a]->_font_shrink
307 # define set_font_shrink(a,b) font_shrink(a) = b
309 # define font_stretch(a) font_tables[a]->_font_stretch
310 # define set_font_stretch(a,b) font_stretch(a) = b
312 # define font_max_shrink(a) font_tables[a]->font_max_shrink
313 # define set_font_max_shrink(a,b) font_max_shrink(a) = b
315 # define font_max_stretch(a) font_tables[a]->font_max_stretch
316 # define set_font_max_stretch(a,b) font_max_stretch(a) = b
318 # define font_step(a) font_tables[a]->_font_step
319 # define set_font_step(a,b) font_step(a) = b
321 # define font_auto_expand(a) font_tables[a]->_font_auto_expand
322 # define set_font_auto_expand(a,b) font_auto_expand(a) = b
324 # define font_tounicode(a) font_tables[a]->_font_tounicode
325 # define set_font_tounicode(a,b) font_tounicode(a) = b
327 # define hyphen_char(a) font_tables[a]->_hyphen_char
328 # define set_hyphen_char(a,b) hyphen_char(a) = b
330 # define skew_char(a) font_tables[a]->_skew_char
331 # define set_skew_char(a,b) skew_char(a) = b
333 # define font_natural_dir(a) font_tables[a]->_font_natural_dir
334 # define set_font_natural_dir(a,b) font_natural_dir(a) = b
336 # define pdf_font_num(a) font_tables[a]->_pdf_font_num
337 # define set_pdf_font_num(a,b) pdf_font_num(a) = b
339 # define pdf_font_attr(a) font_tables[a]->_pdf_font_attr
340 # define set_pdf_font_attr(a,b) pdf_font_attr(a) = b
342 # define left_boundarychar -1
343 # define right_boundarychar -2
344 # define non_boundarychar -3
346 # define left_boundary(a) font_tables[a]->_left_boundary
347 # define has_left_boundary(a) (left_boundary(a)!=NULL)
348 # define set_left_boundary(a,b) font_reassign(left_boundary(a),b)
350 # define right_boundary(a) font_tables[a]->_right_boundary
351 # define has_right_boundary(a) (right_boundary(a)!=NULL)
352 # define set_right_boundary(a,b) font_reassign(right_boundary(a),b)
354 # define font_bchar(a) (right_boundary(a)!=NULL ? right_boundarychar : non_boundarychar)
356 /* font parameters */
358 # define font_params(a) font_tables[a]->_font_params
359 # define param_base(a) font_tables[a]->_param_base
360 # define font_param(a,b) font_tables[a]->_param_base[b]
362 extern void set_font_params(internal_font_number f, int b);
364 # define set_font_param(f,n,b) { \
365 if (font_params(f)<n) \
366 set_font_params(f,n); \
367 font_param(f,n) = b; \
369 # define font_math_params(a) font_tables[a]->_font_math_params
370 # define math_param_base(a) font_tables[a]->_math_param_base
371 # define font_math_param(a,b) font_tables[a]->_math_param_base[b]
373 extern void set_font_math_params(internal_font_number f, int b);
375 # define set_font_math_param(f,n,b) { \
376 if (font_math_params(f)<n) \
377 set_font_math_params(f,n); \
378 font_math_param(f,n) = b; \
381 /* Font parameters are sometimes referred to as |slant(f)|, |space(f)|, etc.*/
383 typedef enum {
384 slant_code = 1,
385 space_code = 2,
386 space_stretch_code = 3,
387 space_shrink_code = 4,
388 x_height_code = 5,
389 quad_code = 6,
390 extra_space_code = 7
391 } font_parameter_codes;
393 # define slant(f) font_param(f,slant_code)
394 # define space(f) font_param(f,space_code)
395 # define space_stretch(f) font_param(f,space_stretch_code)
396 # define space_shrink(f) font_param(f,space_shrink_code)
397 # define x_height(f) font_param(f,x_height_code)
398 # ifdef quad
399 # undef quad
400 # endif
401 # define quad(f) font_param(f,quad_code)
402 # define extra_space(f) font_param(f,extra_space_code)
404 /* now for characters */
406 typedef enum {
407 top_right_kern = 1,
408 bottom_right_kern = 2,
409 bottom_left_kern = 3,
410 top_left_kern = 4
411 } font_math_kern_codes;
413 extern charinfo *get_charinfo(internal_font_number f, int c);
414 extern int char_exists(internal_font_number f, int c);
415 extern charinfo *char_info(internal_font_number f, int c);
418 Here is a quick way to test if a glyph exists, when you are
419 already certain the font |f| exists, and that the |c| is a regular
420 glyph id, not one of the two special boundary objects.
423 # define quick_char_exists(f,c) (get_sa_item(font_tables[f]->characters,c).int_value)
425 extern void set_charinfo_width(charinfo * ci, scaled val);
426 extern void set_charinfo_height(charinfo * ci, scaled val);
427 extern void set_charinfo_depth(charinfo * ci, scaled val);
428 extern void set_charinfo_italic(charinfo * ci, scaled val);
429 extern void set_charinfo_vert_italic(charinfo * ci, scaled val);
430 extern void set_charinfo_top_accent(charinfo * ci, scaled val);
431 extern void set_charinfo_bot_accent(charinfo * ci, scaled val);
432 extern void set_charinfo_tag(charinfo * ci, scaled val);
433 extern void set_charinfo_remainder(charinfo * ci, scaled val);
434 extern void set_charinfo_used(charinfo * ci, scaled val);
435 extern void set_charinfo_index(charinfo * ci, scaled val);
436 extern void set_charinfo_name(charinfo * ci, char *val);
437 extern void set_charinfo_tounicode(charinfo * ci, char *val);
438 extern void set_charinfo_ligatures(charinfo * ci, liginfo * val);
439 extern void set_charinfo_kerns(charinfo * ci, kerninfo * val);
440 extern void set_charinfo_packets(charinfo * ci, eight_bits * val);
441 extern void set_charinfo_extensible(charinfo * ci, int a, int b, int c, int d);
442 extern void set_charinfo_ef(charinfo * ci, scaled val);
443 extern void set_charinfo_lp(charinfo * ci, scaled val);
444 extern void set_charinfo_rp(charinfo * ci, scaled val);
446 extern void add_charinfo_math_kern(charinfo * ci, int type, scaled ht, scaled krn);
447 extern int get_charinfo_math_kerns(charinfo * ci, int id);
449 # define set_char_used(f,a,b) do { \
450 if (char_exists(f,a)) \
451 set_charinfo_used(char_info(f,a),b); \
452 } while (0)
454 extern scaled get_charinfo_width(charinfo * ci);
455 extern scaled get_charinfo_height(charinfo * ci);
456 extern scaled get_charinfo_depth(charinfo * ci);
457 extern scaled get_charinfo_italic(charinfo * ci);
458 extern scaled get_charinfo_vert_italic(charinfo * ci);
459 extern scaled get_charinfo_top_accent(charinfo * ci);
460 extern scaled get_charinfo_bot_accent(charinfo * ci);
461 extern char get_charinfo_tag(charinfo * ci);
462 extern int get_charinfo_remainder(charinfo * ci);
463 extern char get_charinfo_used(charinfo * ci);
464 extern int get_charinfo_index(charinfo * ci);
465 extern char *get_charinfo_name(charinfo * ci);
466 extern char *get_charinfo_tounicode(charinfo * ci);
467 extern liginfo *get_charinfo_ligatures(charinfo * ci);
468 extern kerninfo *get_charinfo_kerns(charinfo * ci);
469 extern eight_bits *get_charinfo_packets(charinfo * ci);
470 extern int get_charinfo_ef(charinfo * ci);
471 extern int get_charinfo_rp(charinfo * ci);
472 extern int get_charinfo_lp(charinfo * ci);
473 extern int get_charinfo_extensible(charinfo * ci, int which);
475 extern int ext_top(internal_font_number f, int c);
476 extern int ext_bot(internal_font_number f, int c);
477 extern int ext_rep(internal_font_number f, int c);
478 extern int ext_mid(internal_font_number f, int c);
480 # define set_ligature_item(f,b,c,d) { f.type = b; f.adj = c; f.lig = d; }
481 # define set_kern_item(f,b,c) { f.adj = b; f.sc = c; }
483 /* character information */
485 # define non_char 65536 /* a code that can't match a real character */
486 # define non_address 0 /* a spurious |bchar_label| */
488 /* character kerns and ligatures */
490 # define end_kern 0x7FFFFF /* otherchar value meaning "stop" */
491 # define ignored_kern 0x800000 /* otherchar value meaning "disabled" */
493 # define charinfo_kern(b,c) b->kerns[c]
495 # define kern_char(b) (b).adj
496 # define kern_kern(b) (b).sc
497 # define kern_end(b) ((b).adj == end_kern)
498 # define kern_disabled(b) ((b).adj > end_kern)
500 /* character ligatures */
502 # define end_ligature 0x7FFFFF /* otherchar value meaning "stop" */
503 # define ignored_ligature 0x800000 /* otherchar value meaning "disabled" */
505 # define charinfo_ligature(b,c) b->ligatures[c]
507 # define is_valid_ligature(a) ((a).type!=0)
508 # define lig_type(a) ((a).type>>1)
509 # define lig_char(a) (a).adj
510 # define lig_replacement(a) (a).lig
511 # define lig_end(a) (lig_char(a) == end_ligature)
512 # define lig_disabled(a) (lig_char(a) > end_ligature)
514 # define no_tag 0 /* vanilla character */
515 # define lig_tag 1 /* character has a ligature/kerning program */
516 # define list_tag 2 /* character has a successor in a charlist */
517 # define ext_tag 3 /* character is extensible */
519 extern scaled char_height(internal_font_number f, int c);
520 extern scaled calc_char_width(internal_font_number f, int c, int ex);
521 extern scaled char_width(internal_font_number f, int c);
522 extern scaled char_depth(internal_font_number f, int c);
523 extern scaled char_italic(internal_font_number f, int c);
524 extern scaled char_vert_italic(internal_font_number f, int c);
525 extern scaled char_top_accent(internal_font_number f, int c);
526 extern scaled char_bot_accent(internal_font_number f, int c);
528 extern liginfo *char_ligatures(internal_font_number f, int c);
529 extern kerninfo *char_kerns(internal_font_number f, int c);
530 extern eight_bits *char_packets(internal_font_number f, int c);
532 # define has_lig(f,b) (char_exists(f,b) &&( char_ligatures(f,b) != NULL))
533 # define has_kern(f,b) (char_exists(f,b) && (char_kerns(f,b) != NULL))
534 # define has_packet(f,b) (char_exists(f,b) && (char_packets(f,b) != NULL))
536 extern int char_remainder(internal_font_number f, int c);
537 extern char char_tag(internal_font_number f, int c);
538 extern char char_used(internal_font_number f, int c);
539 extern char *char_name(internal_font_number f, int c);
540 extern int char_index(internal_font_number f, int c);
542 scaled raw_get_kern(internal_font_number f, int lc, int rc);
543 scaled get_kern(internal_font_number f, int lc, int rc);
544 liginfo get_ligature(internal_font_number f, int lc, int rc);
546 # define EXT_TOP 0
547 # define EXT_BOT 1
548 # define EXT_MID 2
549 # define EXT_REP 3
551 extern texfont **font_tables;
553 int new_font(void);
554 extern void font_malloc_charinfo(internal_font_number f, int num);
555 int copy_font(int id);
556 int scale_font(int id, int atsize);
557 int max_font_id(void);
558 void set_max_font_id(int id);
559 int new_font_id(void);
560 void create_null_font(void);
561 void delete_font(int id);
562 boolean is_valid_font(int id);
564 void dump_font(int font_number);
565 void undump_font(int font_number);
567 int test_no_ligatures(internal_font_number f);
568 void set_no_ligatures(internal_font_number f);
570 extern int get_tag_code(internal_font_number f, int c);
571 extern int get_lp_code(internal_font_number f, int c);
572 extern int get_rp_code(internal_font_number f, int c);
573 extern int get_ef_code(internal_font_number f, int c);
575 extern void set_tag_code(internal_font_number f, int c, int i);
576 extern void set_lp_code(internal_font_number f, int c, int i);
577 extern void set_rp_code(internal_font_number f, int c, int i);
578 extern void set_ef_code(internal_font_number f, int c, int i);
580 int read_tfm_info(internal_font_number f, const char *nom, scaled s);
582 /* from dofont.c */
584 extern int read_font_info(pointer u, char *cnom, scaled s, int ndir);
585 extern int find_font_id(const char *nom, scaled s);
587 /* for and from vfpacket.c */
589 typedef enum { packet_char_code,
590 packet_font_code,
591 packet_pop_code,
592 packet_push_code,
593 packet_special_code,
594 packet_image_code,
595 packet_right_code,
596 packet_down_code,
597 packet_rule_code,
598 packet_node_code,
599 packet_nop_code,
600 packet_end_code,
601 packet_scale_code,
602 packet_lua_code,
603 } packet_command_codes;
605 extern scaled store_scaled_f(scaled sq, int fw);
607 extern void do_vf_packet(PDF pdf, internal_font_number vf_f, int c, int ex);
608 extern int vf_packet_bytes(charinfo * co);
610 extern charinfo *copy_charinfo(charinfo * ci);
612 /* this function is in vfovf.c for the moment */
614 extern int make_vf_table(lua_State * L, const char *name, scaled s);
616 /* some bits of the old interface, used by e.g. writet3.c */
618 # define get_x_height(f) x_height(f)
619 # define get_quad(f) quad(f)
620 # define get_slant(f) slant(f)
621 # define get_charwidth(f,c) (char_exists(f,c) ? char_width(f,c) : 0)
622 # define get_charheight(f,c) (char_exists(f,c) ? char_height(f,c) : 0)
623 # define get_chardepth(f,c) (char_exists(f,c) ? char_depth(f,c) : 0)
625 extern int pk_dpi; /* PK pixel density value from \.{texmf.cnf} */
627 extern internal_font_number tfm_lookup(char *s, scaled fs);
629 extern int fix_expand_value(internal_font_number f, int e);
631 extern void set_expand_params(internal_font_number f, boolean auto_expand,
632 int stretch_limit, int shrink_limit,
633 int font_step);
635 extern void read_expand_font(void);
636 extern void new_letterspaced_font(small_number a);
637 extern void make_font_copy(small_number a);
639 extern void glyph_to_unicode(void);
641 #endif