TeX in C
Explore TeX with modern c compiler.
|
宏定义 | |
#define | opbyte(x) (x.b2) |
[p199#545] 更多... | |
#define | rembyte(x) (x.b3) |
#define | stopflag qi(128) |
[p199#545] value indicating ‘.{STOP}’ in a lig/kern program. 更多... | |
#define | kernflag qi(128) |
[p199#545] op code for a kern step. 更多... | |
#define | skipbyte(x) x.b0 |
#define | nextchar(x) x.b1 |
#define | charexists(x) ((x).b0>MIN_QUARTER_WORD) |
[p203#554] 更多... | |
#define | chartag(x) ((qo((x).b2)) % 4) |
#define | heightdepth(x) qo(x.b1) |
[p203#554] 更多... | |
#define | ligkernstart(x, y) (ligkernbase[(x)] + rembyte(y)) |
[p204#557] beginning of lig/kern program 更多... | |
#define | ligkernrestart(x, y) (ligkernbase[(x)] + opbyte(y) * 256 + rembyte(y) - kernbaseoffset + 32768L) |
[p204#557] 更多... | |
#define | NON_CHAR 256 |
[#549] a |halfword| code that can't match a real character} 更多... | |
#define | nonaddress 0 |
[p201#549] a spurious bchar label 更多... | |
#define | kernbaseoffset 32768 |
[p204#557] 更多... | |
#define | param(x, y) (fontinfo[(x) + parambase[y]].sc) |
[p204#558] 更多... | |
#define | slant(x) param(SLANT_CODE,x) /* slant to the right, per unit distance upward}*/ |
#define | space(x) param(SPACE_CODE,x) /* NORMAL space between words}*/ |
#define | spacestretch(x) param(SPACE_STRETCH_CODE,x) /* stretch between words}*/ |
#define | spaceshrink(x) param(SPACE_SHRINK_CODE,x) /* shrink between words}*/ |
#define | xheight(x) param(X_HEIGHT_CODE,x) /* one ex}*/ |
#define | quad(x) param(QUAD_CODE,x) /* one em}*/ |
#define | extraspace(x) param(EXTRA_SPACE_CODE,x) /* additional space at end of sentence}*/ |
#define | badtfm 11 |
[p205#560] 更多... | |
#define | exttop(x) x.b0 /* |top| piece in a recipe */ |
[p199#564] 更多... | |
#define | extmid(x) x.b1 /* |mid| piece in a recipe */ |
#define | extbot(x) x.b2 /* |bot| piece in a recipe */ |
#define | extrep(x) x.b3 /* |rep| piece in a recipe */ |
类型定义 | |
typedef UChar | InternalFontNumber |
[#548]: [FONT_BASE, FONT_MAX] = [0, 75] 更多... | |
枚举 | |
enum | CharTag { NO_TAG , LIG_TAG , LIST_TAG , EXT_TAG } |
[p198#544]: tag field in a char_info_word that explain how to interpret the remainder field. 更多... | |
enum | TFMParamVal { TFM_PARAM_MISSING , SLANT_CODE , SPACE_CODE , SPACE_STRETCH_CODE , SPACE_SHRINK_CODE , X_HEIGHT_CODE , QUAD_CODE , EXTRA_SPACE_CODE } |
[p200#547] 更多... | |
变量 | |
MemoryWord | fontinfo [FONT_MEM_SIZE+1] |
the big collection of font data 更多... | |
FontIndex | fmemptr |
first unused word of font info 更多... | |
InternalFontNumber | fontptr |
largest internal font number in use 更多... | |
Static FourQuarters | fontcheck [FONT_MAX+1] |
check sum 更多... | |
Static Scaled | fontsize [FONT_MAX+1] |
"at" size 更多... | |
Static Scaled | fontdsize [FONT_MAX+1] |
"design" size 更多... | |
FontIndex | fontparams [FONT_MAX+1] |
how many font parameters are present 更多... | |
Static StrNumber | fontname [FONT_MAX+1] |
name of the font 更多... | |
Static StrNumber | fontarea [FONT_MAX+1] |
area of the font 更多... | |
EightBits | fontbc [FONT_MAX+1] |
beginning (smallest) character code 更多... | |
EightBits | fontec [FONT_MAX+1] |
ending (largest) character code. 更多... | |
Pointer | fontglue [FONT_MAX+1] |
glue specification for interword space, null if not allocated. 更多... | |
Boolean | fontused [FONT_MAX+1] |
has a character from this font actually appeared in the output? 更多... | |
Static Integer | hyphenchar [FONT_MAX+1] |
current \hyphenchar values 更多... | |
Static Integer | skewchar [FONT_MAX+1] |
current \skewchar values. 更多... | |
FontIndex | bcharlabel [FONT_MAX+1] |
start of lig kern program for left boundary character, non address if there is none. 更多... | |
Integer | fontbchar [FONT_MAX+1] |
right boundary character, non char if there is none. 更多... | |
Integer | fontfalsebchar [FONT_MAX+1] |
font bchar if it doesn’t exist in the font, otherwise non char. 更多... | |
Static Integer | charbase [FONT_MAX+1] |
base addresses for char info. 更多... | |
Static Integer | widthbase [FONT_MAX+1] |
base addresses for widths. 更多... | |
Static Integer | heightbase [FONT_MAX+1] |
base addresses for heights. 更多... | |
Static Integer | depthbase [FONT_MAX+1] |
base addresses for depths. 更多... | |
Static Integer | italicbase [FONT_MAX+1] |
base addresses for italic corrections. 更多... | |
Integer | ligkernbase [FONT_MAX+1] |
base addresses for ligature/kerning programs. 更多... | |
Static Integer | kernbase [FONT_MAX+1] |
base addresses for kerns. 更多... | |
Integer | extenbase [FONT_MAX+1] |
base addresses for extensible recipes. 更多... | |
Integer | parambase [FONT_MAX+1] |
base addresses for font parameters. 更多... | |
FourQuarters | nullcharacter |
#define badtfm 11 |
[p205#560]
#define charexists | ( | x | ) | ((x).b0>MIN_QUARTER_WORD) |
[p203#554]
#define extbot | ( | x | ) | x.b2 /* |bot| piece in a recipe */ |
#define extmid | ( | x | ) | x.b1 /* |mid| piece in a recipe */ |
#define extraspace | ( | x | ) | param(EXTRA_SPACE_CODE,x) /* additional space at end of sentence}*/ |
#define extrep | ( | x | ) | x.b3 /* |rep| piece in a recipe */ |
#define exttop | ( | x | ) | x.b0 /* |top| piece in a recipe */ |
[p199#564]
#define kernbaseoffset 32768 |
[p204#557]
#define ligkernrestart | ( | x, | |
y | |||
) | (ligkernbase[(x)] + opbyte(y) * 256 + rembyte(y) - kernbaseoffset + 32768L) |
[p204#557]
#define ligkernstart | ( | x, | |
y | |||
) | (ligkernbase[(x)] + rembyte(y)) |
[p204#557] beginning of lig/kern program
#define nextchar | ( | x | ) | x.b1 |
#define NON_CHAR 256 |
[#549] a |halfword| code that can't match a real character}
#define nonaddress 0 |
[p201#549] a spurious bchar label
#define opbyte | ( | x | ) | (x.b2) |
[p199#545]
#define rembyte | ( | x | ) | (x.b3) |
#define skipbyte | ( | x | ) | x.b0 |
#define slant | ( | x | ) | param(SLANT_CODE,x) /* slant to the right, per unit distance upward}*/ |
#define space | ( | x | ) | param(SPACE_CODE,x) /* NORMAL space between words}*/ |
#define spaceshrink | ( | x | ) | param(SPACE_SHRINK_CODE,x) /* shrink between words}*/ |
#define spacestretch | ( | x | ) | param(SPACE_STRETCH_CODE,x) /* stretch between words}*/ |
#define xheight | ( | x | ) | param(X_HEIGHT_CODE,x) /* one ex}*/ |
typedef UChar InternalFontNumber |
[#548]: [FONT_BASE, FONT_MAX] = [0, 75]
enum CharTag |
enum TFMParamVal |
Scaled chardepth | ( | InternalFontNumber | x, |
Integer | y | ||
) |
Scaled charheight | ( | InternalFontNumber | x, |
Integer | y | ||
) |
FourQuarters charinfo | ( | InternalFontNumber | f, |
EightBits | p | ||
) |
Scaled charitalic | ( | InternalFontNumber | x, |
FourQuarters | y | ||
) |
Scaled charkern | ( | InternalFontNumber | x, |
FourQuarters | y | ||
) |
void charwarning | ( | InternalFontNumber | f, |
EightBits | c | ||
) |
[#581]
Scaled charwidth | ( | InternalFontNumber | x, |
FourQuarters | y | ||
) |
void findfontdimen | ( | Boolean | writing | ) |
[#578] sets cur_val
to font_info
location.
implement \\fontdimen n f
. The boolean parameter writing is set true if the calling program intends to change the parameter value.
void font_init | ( | ) |
[#551, #556]
[#551]
[#556]
void fonts_dump | ( | ) |
[#1320] Dump the font information.
[#1322] Dump the array info for internal font number k.
void fonts_init_once | ( | void | ) |
[#552] TeX always knows at least one font, namely the null font.
It has no characters, and its seven parameters are all equal to zero.
int fonts_undump | ( | ) |
[#1321] Undump the font information.
undump fontinfo[]
[#1323] Undump the array info for internal font number k.
FourQuarters get_fontcheck | ( | InternalFontNumber | x | ) |
Scaled get_fontdsize | ( | InternalFontNumber | x | ) |
StrNumber get_fontname | ( | InternalFontNumber | x | ) |
Scaled get_fontsize | ( | InternalFontNumber | x | ) |
Integer get_hyphenchar | ( | InternalFontNumber | x | ) |
Integer get_skewchar | ( | InternalFontNumber | x | ) |
HalfWord newcharacter | ( | InternalFontNumber | f, |
EightBits | c | ||
) |
[#582]
InternalFontNumber readfontinfo | ( | Pointer | u, |
StrNumber | nom, | ||
StrNumber | aire, | ||
Scaled | s | ||
) |
[p205#560]: input a TFM file.
< index into font info
< was tfm file successfully opened?
#563: Open tfm file for input
#566: Use size fields to allocate font information.
#568: Read the TFM header
#569: Read character data
#571: Read box dimensions #572: Replace z by z 0 and compute α,β
#573: Read ligature/kern program
#574: Read extensible character recipes
#575: Read font parameters
void scanfontident | ( | void | ) |
[#577] Declare procedures that scan font-related stuff.
void set_hyphenchar | ( | InternalFontNumber | x, |
Integer | c | ||
) |
void set_skewchar | ( | InternalFontNumber | x, |
Integer | c | ||
) |
start of lig kern program for left boundary character, non address if there is none.
FontIndex fmemptr |
first unused word of font info
Static FourQuarters fontcheck[FONT_MAX+1] |
check sum
MemoryWord fontinfo[FONT_MEM_SIZE+1] |
the big collection of font data
InternalFontNumber fontptr |
largest internal font number in use
FourQuarters nullcharacter |