58. makeindexk程序
作者:Pehong Chen,陈丕宏
并行qsort。
+59. 位图字体
+ FONT格式,Macintosh,1984
+ NFNT格式
+ CPI格式
+ FNT格式
+ FON格式
+ PSF格式
+ BDF格式
+ HBF格式
+60. TFM文件的结构。
+ 工具:tftopl,pltotf,作者:Leonidas Guibas
+ 语法:(KEYWORD VALUE)
+ 关键字:大写,旧时代风格
+ 中缀:R (real), O (octal), H (hexadecimal), D (decimal), C (character)
+ 全局声明:1. CHECKSUM,4-byte,校验
+ 2. DESIGNSIZE,0-2048,American printer's points
+ 3. DESIGNUNITS,正值
+ 4. CODINGSCHEME,废弃
+ 5. FAMILY,废弃
+ 6. FACE,废弃
+ 字体参数:1. SLANT
+ 2. SPACE
+ 3. STRETCH
+ 4. SHRINK
+ 5. XHEIGHT
+ 6. QUAD = em
+ 7. EXTRASPACE
+ 8. NUM1/DEFAULTRULETHICKNESS
+ 9. NUM2/BIGOPSPACING1
+ 10. NUM3/BIGOPSACING2
+ 11. DENOM1/BIGOPSPACING3
+ 12. DENOM2/BIGOPSPACING4
+ 13. SUP1/BIGOPSPACING45
+ 14. SUP2
+ 15. SUP3
+ 16. SUB1
+ 17. SUB2
+ 18. SUPDROP
+ 19. SUBDROP
+ 20. DELIM1
+ 21. DELIM2
+ 22. AXISHEIGHT
+ 缩距/合字:1. (LIGTABLE operations) 整体操作
+ 2. (LABEL glyph) 初始化字符
+ 3. (STOP) 结束
+ 4. (KRN C . R -.15)
+ 5. (LIG C f H 13)
+ 合字类型:1. /LIG/
+ 2. /LIG
+ 3. LIG/
+ 字体数据:1. CHARWD
+ 2. CHARHT
+ 3. CHARDP
+ 4. CHARIC
+ 5. NEXTLARGER
+61. JFM的扩展
+%@x [68] l.1068 - pTeX: we print GLUEKERN instead of LIGTABLE
+% begin left; out('LIGTABLE'); out_ln;@/
+%@y
+% begin left;
+% if file_format<>tfm_format then out('GLUEKERN') else out('LIGTABLE');
+% out_ln;@/
+%@z
+%@ list the |char_type| table in a similar way to the type table
+62. VF的处理
+63. PATGEN
+ 第一版:Frank~M. Liang
+ 第二版:Peter Breitenlohner
+64. 兼容性的讨论
+ No doubt there still is plenty of room for improvement, but the author
+ is firmly committed to keeping \TeX82 ``frozen'' from now on; stability
+ and reliability are to be its main virtues.
+65. 修改的讨论(不触及核心)
+ On the other hand, the \.{WEB} description can be extended without changing
+ the core of \TeX82 itself, and the program has been designed so that such
+ extensions are not extremely difficult to make.
+66. 名字与兼容系
+ If this program is changed, the resulting system should not be called
+ `\TeX'; the official name `\TeX' by itself is reserved
+ for software systems that are fully compatible with each other.
+67. 魔鬼测试
+ A special test suite called the ``\.{TRIP} test'' is available for
+ helping to determine whether a particular implementation deserves to be
+ known as `\TeX' [cf.~Stanford Computer Science report CS1027,
+ November 1984].
+68. TeX的全貌
+ @p @t\4@>@<Compiler directives@>@/
+ program TEX; {all file names are defined dynamically}
+ label @<Labels in the outer block@>@/
+ const @<Constants in the outer block@>@/
+ mtype @<Types in the outer block@>@/
+ var @<Global variables@>@/
+ @#
+ procedure initialize; {this procedure gets things started properly}
+ var @<Local variables for initialization@>@/
+ begin @<Initialize whatever \TeX\ might access@>@;
+ end;@#
+ @t\4@>@<Basic printing procedures@>@/
+ @t\4@>@<Error handling procedures@>@/
+69. 三个重要的标签
+ @d start_of_TEX=1 {go here when \TeX's variables are initialized}
+ @d end_of_TEX=9998 {go here to close files and terminate gracefully}
+ @d final_end=9999 {this label marks the ending of the program}
+70. 一大波常数正在接近
+ @<Constants...@>=
+ @!mem_max=30000; {greatest index in \TeX's internal |mem| array;
+ must be strictly less than |max_halfword|;
+ must be equal to |mem_top| in \.{INITEX}, otherwise |>=mem_top|}
+ @!mem_min=0; {smallest index in \TeX's internal |mem| array;
+ must be |min_halfword| or more;
+ must be equal to |mem_bot| in \.{INITEX}, otherwise |<=mem_bot|}
+ @!buf_size=500; {maximum number of characters simultaneously present in
+ current lines of open files and in control sequences between
+ \.{\\csname} and \.{\\endcsname}; must not exceed |max_halfword|}
+ @!error_line=72; {width of context lines on terminal error messages}
+ @!half_error_line=42; {width of first lines of contexts in terminal
+ error messages; should be between 30 and |error_line-15|}
+ @!max_print_line=79; {width of longest text lines output; should be at least 60}
+ @!stack_size=200; {maximum number of simultaneous input sources}
+ @!max_in_open=6; {maximum number of input files and error insertions that
+ can be going on simultaneously}
+ @!font_max=75; {maximum internal font number; must not exceed |max_quarterword|
+ and must be at most |font_base+256|}
+ @!font_mem_size=20000; {number of words of |font_info| for all fonts}
+ @!param_size=60; {maximum number of simultaneous macro parameters}
+ @!nest_size=40; {maximum number of semantic levels simultaneously active}
+ @!max_strings=3000; {maximum number of strings; must not exceed |max_halfword|}
+ @!string_vacancies=8000; {the minimum number of characters that should be
+ available for the user's control sequences and font names,
+ after \TeX's own error messages are stored}
+ @!pool_size=32000; {maximum number of characters in strings, including all
+ error messages and help texts, and the names of all fonts and
+ control sequences; must exceed |string_vacancies| by the total
+ length of \TeX's own strings, which is currently about 23000}
+ @!save_size=600; {space for saving values outside of current group; must be
+ at most |max_halfword|}
+ @!trie_size=8000; {space for hyphenation patterns; should be larger for
+ \.{INITEX} than it is in production versions of \TeX}
+ @!trie_op_size=500; {space for ``opcodes'' in the hyphenation patterns}
+ @!dvi_buf_size=800; {size of the output buffer; must be a multiple of 8}
+ @!file_name_size=40; {file names shouldn't be longer than this}
+ @!pool_name='TeXformats:TEX.POOL ';
+ {string of length |file_name_size|; tells where the string pool appears}
+ @.TeXformats@>
+71. 字符集
+ \TeX's internal code also defines the value of constants
+ that begin with a reverse apostrophe; and it provides an index to the
+ \.{\\catcode}, \.{\\mathcode}, \.{\\uccode}, \.{\\lccode}, and \.{\\delcode}
+ tables.
+72. 类型定义,这是PASCAL中的定义
+ @ Characters of text that have been converted to \TeX's internal form
+ are said to be of type |ASCII_code|, which is a subrange of the integers.
+
+ @<Types...@>=
+ @!ASCII_code=0..255; {eight-bit numbers}
+73. PoorMan's Chinese
+ However, other settings of |xchr| will make \TeX\ more friendly on
+ computers that have an extended character set, so that users can type things
+ like `\.^^Z' instead of `\.{\\ne}'. People with extended character sets can
+ assign codes arbitrarily, giving an |xchr| equivalent to whatever
+ characters the users of \TeX\ are allowed to have in their input files.
+74. 初始化之一
+ @<Set init...@>=
+ for i:=0 to @'37 do xchr[i]:=' ';
+ for i:=@'177 to @'377 do xchr[i]:=' ';
+75. 又是类型定义
+ @<Types...@>=
+ @!eight_bits=0..255; {unsigned one-byte quantity}
+ @!alpha_file=packed file of text_char; {files that contain textual data}
+ @!byte_file=packed file of eight_bits; {files that contain binary data}
+76. 类型
+ @<Types...@>=
+ @!pool_pointer = 0..pool_size; {for variables that point into |str_pool|}
+ @!str_number = 0..max_strings; {for variables that point into |str_start|}
+ @!packed_ASCII_code = 0..255; {elements of |str_pool| array}
+77. 三标志的由来
+ @ The first 128 strings will contain 95 standard ASCII characters, and the
+ other 33 characters will be printed in three-symbol form like `\.{\^\^A}'
+ unless a system-dependent change is made here. Installations that have
+ an extended character set, where for example |xchr[@'32]=@t\.{\'^^Z\'}@>|,
+ would like string @'32 to be the single character @'32 instead of the
+ three characters @'136, @'136, @'132 (\.{\^\^Z}). On the other hand,
+ even people with an extended character set will want to represent string
+ @'15 by \.{\^\^M}, since @'15 is |carriage_return|; the idea is to
+ produce visible strings instead of tabs or line-feeds or carriage-returns
+ or bell-rings or characters that are treated anomalously in text files.
+78. pool文件
+ @ When the \.{WEB} system program called \.{TANGLE} processes the \.{TEX.WEB}
+ description that you are now reading, it outputs the \PASCAL\ program
+ \.{TEX.PAS} and also a string pool file called \.{TEX.POOL}. The \.{INITEX}
+ @.WEB@>@.INITEX@>
+ program reads the latter file, where each string appears as a two-digit decimal
+ length followed by the string itself, and the information is recorded in
+ \TeX's string memory.
+
+ @<Glob...@>=
+ @!init @!pool_file:alpha_file; {the string-pool file output by \.{TANGLE}}
+ tini
+79. TeX中的DIG是个神奇的数组
+ @!dig : array[0..22] of 0..15; {digits in a number being output}
+80. print_ln是打印EOL的。
+81. print_char是用来输出字符的,ASCII
+82. slow_print是为了打印出特殊字符的
+83. print_nl是保证字符出现在新一行的
+84. print_esc是为了打印转义符的
+85. print_two是用来输出0到99之间的数字的
+86. print_hex是用来输出十六进制数的
+87. print_roman_int是个辅助函数
+88. Arithmetic with scaled dimensions.
+89. not a bug, it is a feature
+ (Actually there are three places where \TeX\ uses |div| with a possibly negative
+ numerator. These are harmless; see |div| in the index. Also if the user
+ sets the \.{\\time} or the \.{\\year} to a negative value, some diagnostic
+ information will involve negative-numerator division. The same remarks
+ apply for |mod| as well as for |div|.)
+90. CWEB注记
+ @ /@* 用来表示一个section
+ |int *pa| 用来表示行内的代码
+ @d 等同于#define
+ @f error normal 定义
+ @c @p 等同
+ @h 插入#define
+ @^system dependencies@> 索引
+91. sp
+ @ Physical sizes that a \TeX\ user specifies for portions of documents are
+ represented internally as scaled points. Thus, if we define an `sp' (scaled
+ @^sp@>
+ point) as a unit equal to $2^{-16}$ printer's points, every dimension
+ inside of \TeX\ is an integer number of sp. There are exactly
+ 4,736,286.72 sp per inch. Users are not allowed to specify dimensions
+ larger than $2^{30}-1$ sp, which is a distance of about 18.892 feet (5.7583
+ meters); two such quantities can be added without overflow on a 32-bit
+ computer.
+92. 数据结构入门
+ @* \[8] Packed data.
+ In order to make efficient use of storage space, \TeX\ bases its major data
+ structures on a |memory_word|, which contains either a (signed) integer,
+ possibly scaled, or a (signed) |glue_ratio|, or a small number of
+ fields that are one half or one quarter of the size used for storing
+ integers.
+93. 比较重要的glue_ratio
+ 需要仔细看一下:Fixed-point glue setting — an example of WEB
+ @ When \TeX\ ``packages'' a list into a box, it needs to calculate the
+ proportionality ratio by which the glue inside the box should stretch
+ or shrink. This calculation does not affect \TeX's decision making,
+ so the precise details of rounding, etc., in the glue calculation are not
+ of critical importance for the consistency of results on different computers.
+
+ We shall use the type |glue_ratio| for such proportionality ratios.
+ A glue ratio should take the same amount of memory as an
+ |integer| (usually 32 bits) if it is to blend smoothly with \TeX's
+ other data structures. Thus |glue_ratio| should be equivalent to
+ |short_real| in some implementations of \PASCAL. Alternatively,
+ it is possible to deal with glue ratios using nothing but fixed-point
+ arithmetic; see {\sl TUGboat \bf3},1 (March 1982), 10--27. (But the
+ routines cited there must be modified to allow negative glue ratios.)
+ @^system dependencies@>
+94. 内存耗尽
+ @ If memory is exhausted, it might mean that the user has forgotten
+ a right brace. We will define some procedures later that try to help
+ pinpoint the trouble.
+95. 是否需要加入方向属性?
+ @d is_char_node(#) == (#>=hi_mem_min)
+ {does the argument point to a |char_node|?}
+ @d font == type {the font code in a |char_node|}
+ @d character == subtype {the character code in a |char_node|}
+96. TeX82 Memory Structure
+97. new_param_glue 参数化glue
+ new_glue 匿名glue
+ new_skip_param 以上二者合体
+98. penalty控制断行分页
+ @ A |penalty_node| specifies the penalty associated with line or page
+ breaking, in its |penalty| field. This field is a fullword integer, but
+ the full range of integer values is not used: Any penalty |>=10000| is
+ treated as infinity, and no break will be allowed for such high values.
+ Similarly, any penalty |<=-10000| is treated as negative infinity, and a
+ break will be forced.
+99. explicit kern
+ 明确的,直接的 3989
+100. Uniscribe
+ http://blogs.msdn.com/b/murrays/archive/2010/01/12/special-capabilities-of-a-math-font.aspx
+ http://www.cnblogs.com/geniusvczh/archive/2012/11/06/2757868.html
+ http://msdn.microsoft.com/en-us/library/windows/desktop/dd374096%28v=vs.85%29.aspx
+ http://msdn.microsoft.com/zh-cn/goglobal/bb688099
+ http://www.tfsattic.com/codearc/windows/UnisSample.html
+ http://www.catch22.net/tuts/introduction-uniscribe
+ http://maxradi.us/documents/uniscribe/
+ http://www.microsoft.com/typography/developers/uniscribe/intro.htm
+ http://blog.csdn.net/jianlizhao66/article/details/1480748
+101. eexec Encryption,Type1字体的加密
+102. `T1ascii' translates a PostScript Type 1 font from compact binary (PFB) to
+ ASCII (PFA) format. The result is written to the standard output unless an
+ OUTPUT file is given.
+103. PASCAL的ord函数:ord('a')=97, chr(7)。加上x之后用户编码处理
+ @d null_code 0
+ @d carriage_return 015
+ @d invalid_code 0177
+104. 字符串处理,TeX中所有的字符串都存储在str_pool中
+105. memory_word是分段的,是有固定数目的。
+106. Lyle Ramshaw于1980年设计了TFM文件。
+ JFM是将character code转换成了character type。
+107. new_character 这就是要分析的。
+108. 注意XeTeX中的:
+ function new_native_word_node(f:internal_font_number; n:integer): pointer;
+ function new_native_character(f:internal_font_number; c:UnicodeScalar): pointer;
+ procedure font_feature_warning
+ procedure font_mapping_warning
+ procedure do_locale_linebreaks (s:integer; len:integer);
+109. DVI导言区的内容
+ i[1] DVI类型
+ num[4] den[4] 整数
+ mag[4] 缩放
+110. http://wiki.apache.org/xmlgraphics-fop/GoogleSummerOfCode2006/FloatsImplementationProgress/ImplementingBeforeFloats
+ http://tex.loria.fr/english/texbib.html
+ http://dl.acm.org/citation.cfm?id=865455
+111. BMP文件格式
+112. Michael Frederick Plass论文:Optimal Pagination Techniques for Automatic Typesetting System
+ a. 当全是文字的时候,是比较好办的,但是在有脚注和图像的时候就复杂了。
+ b. 文本list和figure list:box, glue, penalty, citation
+ c. trivial = 平凡,简单;intervention = 干预
+113. pdftoepdf.cc 调用poppler进行PDF处理的。
+ pdfTeX中的7b部分加入了随机数的支持。受METAPOST影响。
+ 所谓的FMT文件:Locations of |mem| between |mem_bot| and
+ |mem_top| may be dumped as part of preloaded format files,
+ by the \.{INITEX} preprocessor.
+ 关于mem表的动态分配:Production versions of \TeX\ may extend
+ the memory at both ends in order to provide more space;
+ locations between |mem_min| and |mem_bot| are always
+ used for variable-size nodes, and locations between |mem_top|
+ and |mem_max| are always used for single-word nodes.
+ mem表的分布:null<=
+ mem_min<=
+ mem_bot<
+ lo_mem_max<
+ hi_mem_min<
+ mem_top<=
+ mem_end<=
+ mem_max
+
+114. 关于CJK扩展的另一段文字
+ Extensions of \TeX\ for
+ oriental languages should be able to identify oriental fonts by means
+ of this additional header information.
+ @^oriental characters@>@^Chinese characters@>@^Japanese characters@>
+115. TeX关于TFM的处理,确实在不同版本之间存在一定的差异,tex.web-2.0就是个明证。
+ 其实更深层次的一点呢,就是七位和八位之间的区别。
+116. TeX源代码的相关部分:TAOCP 2.5的19题。
+117. 写入DVI文件的函数:write_dvi。在PDFTeX中存在着write_pdf。
+118. 976节,这是需要查看的,分页算法。
+119. TeX的String Pool,字符串池。str_pool是所有字符串的数组。
+ 而str_start是当前的索要用到的字符串的起始的那个字符串数组。
+ 字符串的选用,是直接写入一个整数的,所以有着关系:
+ str_start[s]<=j<str_start[s+1]
+120. hmtx表和microtypography。
+ 必须有一个基本值才可以进行运算。
+ 还必须要考虑到kerning。
+ GSUB是一个巨大的ligature表,需要定义一个subsititute node。
+ name table的操作。
+ language id。
+ sTypoLineGap与unitsPerEm共同运算行距。
+ cbox与竖排的应用。
+ vmtx是关于竖排的参数的。hmtx是关于横排的参数的。
+ 注意:6.1 Advanced Open Font layout extensions
+ 注意:layout翻译作布排
+ 注意:OFF布排字体使复杂字符和glyph相互映射实现可能,支持连字,位置变体,文本异位,和其他替换成为可能
+ 注意:OFF布排字体包含二维的位置和glyph叠加。
+ 注意:OFF字体含有书写系统和语言信息,文本处理应用可以读取以便校正。
+ 注意:complex typographical。
+ 复杂排版的含义就是针对于多语言和非latin的情况。
+ pTeX的\tatebaselineshift等也是对字体的调整,我需要强调的是另外的情况:多字体。
+ 用户看到的和打印出来的是glyph而不是character。Glyph是character的表现形式。
+ 字体是glyph的集合。用户想取到glyph,就必须读取字体的cmap表。
+ Glyph也可以表现出另外的一些情况:字符合并,字符变体。并不是一对一的关系。
+ Script是指的是书写系统。Language是指语言系统,具有不同的书写方式,比如断行。
+ Feature是指排版中需求的某一种特性。
+ OFF的五大表:GSUB,GPOS,BASE,JSTF和GDEF。
+ GSUB表的作用就是字体替换:单glyph替换,一对多替换,aesthetic(美学)变体,多glyph替换,上下文glyph替换。
+ GPOS表的作用:单字符校正,字符对校正,草写叠加,标记叠加,上下文glyph放置。
+ BASE表的作用:baseline信息。
+ JSTF表的作用:对齐信息,whitespace和Kashida。
+ GDEF表的作用:所有的glyph信息:type(glyph,ligature,复合标记),标记点,连写补助号。
+ 文本处理流程:chars -> glyph -> GSUB -> GPOS + BASE -> linebreak -> JSTF -> Render.
+ Glyph Substitution table
+ Glyph Positioning table
+ Baseline table
+ Justification table
+ Glyph Definition table
+ GSUB和GPOS使用的是一样的数据结构。ScriptList,FeatureList,LookupList。
+ OFF有7种GSUB lookup,9种GPOSlookup。
+ baseline的各种类型:hang(藏文,竖写)
+ 在PDF参考手册里面说到:A character is an abstract symbol, whereas a glyph is a specific graphical rendering of a character.
+ 那么这里的意思就是说:两个层面。
+ Codepoint是一个二进制的数组。
+121. Libotf的API。
+ OTF_open (const char *name); 读取OpenType字体
+ OTF_open_ft_face (FT_Face face); 调用FreeType的字体
+ OTF_close (OTF *otf); 关闭字体
+ OTF_get_table (OTF *otf, const char * name); 读取head/name/cmap/GDEF/GSUB表
+ OTF_check_table (OTF *otf, const char * name); 校验表,如果存在,返回0,否则-1
+ OTF_get_scripts (OTF *otf, int gsubp); 装载OTF_ScriptList
+ OTF_get_features (OTF *otf, int gsubp); 装载OTF_FeatureList
+ OTF_check_features (OTF *otf, int gsubp, OTF_Tag script, OTF_Tag language, const OTF_Tag *features; int n_features); 校验书写/语言系统/特性,特性,返回1,否则返回0,如错误,返回-1
+ OTF_drive_cmap (OTF *otf, OTF_GlyphString *gstring); 处理glyph string
+ OTF_drive_cmap2 (OTF *otf, OTF_GlyphString *gstring, int platform_id, int encoding_id); 处理平台相关的
+ OTF_get_variation_glyphs (OTF *otf, int c, OTF_GlyphID code[256]); 变体字符
+ OTF_drive_gdef (OTF *otf, OTF_GlyphString *gstring); 通过GDEF来处理字符串
+ OTF_drive_gsub (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *feature); 通过GSUB来进行字符处理。
+ OTF_drive_gsub_with_log (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *feature); 通过GSUB来进行字符处理。并附带日志。
+ OTF_drive_gpos2 (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *features); 通过GPOS来进行字符处理
+ OTF_drive_gpos_with_log (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *features); 通过GPOS来进行字符处理。并附带日志。
+ OTF_drive_tables (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *gsub_features, const char *gpos_features); 复合函数
+ OTF_get_unicode (OTF *otf, OTF_GlyphID code); 取回Glyph的ID
+ OTF_drive_gsub_alternate (OTF *otf, OTF_GlyphString *gstring, const char *script, const char *language, const char *features); 变体替换
+ OTF_iterate_gsub_feature (OTF *otf, OTF_Feature_Callback callback, const char *script, const char *language, const char *feature); feature迭代
+
+ 接下来看看定义了的类型:OTF_Tag, OTF_GlyphID, OTF_Offset。
+ OTF_Fixed是两个数,用来指代各种版本。
+ OTF_NameRecord是用来处理Name表的。
+ OTF_max_nameID是最大的nameID数:23
+ 一个重要的数据结构:typedef struct { int size; int used; OTF_Glyph *glyphs; } OTF_GlyphString;
+ 第一个结构成员:size指的是数组的大小
+ 第二个结构成员:used指的是这其中有多少是用了的,为了防止越界,就必须在替换或者调整后重新使用这个数值进行输出。
+ 第三个结构成员:指的是一串OTF_Glyph,这里面信息就很丰富了。
+
+
+122. UTF8格式 UTF-8 format (character.h)
+ 0-7F 0xxxxxxx
+ 80-7FF 110xxxxx 10xxxxxx
+ 800-FFFF 1110xxxx 10xxxxxx 10xxxxxx
+ 10000-1FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ 200000-3FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ 4000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+123. OpenType的hhea - Horizontal header
+ Fixed Table version number 版本号
+ FWORD Asender 最高Asender
+ FWORD Descender 最低Descender
+ FWORD LineGap 行距
+ UFWORD advanceWidthMax hmtx中最大的宽度
+ FWORD minLeftSideBearing 最小左边距
+ FWORD minRightSideBearing 最小右边距
+ FWORD xMaxEntent $Max(lsb + (xMax - xMin))$
+ SHORT caretSlopeRise
+ SHORT caretSlopeRun
+ SHORT caretOffset
+ SHORT metricDataFormat
+ USHORT numberOfHMetrics
+124. OpenType的hmtx - Horizontal metrics
+ typedef struct _longHorMetric {
+ USHORT advanceWidth;
+ SHORT lsb;
+ } longHorMetric;
+125. OpenType的post表,PostScript
+ CFF的VORG表,Vertical origin table
+ TrueType的vmtx,Vertical Metrics
+ cmap - Character to glyph index mapping table
+126. GDEF表
+ 表头
+ ULONG Version
+ Offset GlyphClassDef
+ Offset AttachList
+ Offset LigCaretList
+ Offset MarkAttachClassDef
+ Offset MarkGlyphSetsDef
+127. GlyphClassDef
+ 1). Base glyph (single character, spacing glyph)
+ 2). Ligature glyph (multiple character, spacing glyph)
+ 3). Mark glyph (non-spacing combining glyph)
+ 4). Component glyph (parts of single character, spacing glyph)
+128. AttachList
+ 用作缓存
+129. OTF中的head表OTF_head,还缺bbox的四个参数
+ OTF中的name表OTF_name,参数还算齐全
+ OTF中的cmap表OTF_cmap,参数齐全
+130. M17N使用了FLT来对layout进行处理,Font Layout Table
+ 对于简单的文本,一对一进行转换即可
+ 对于复杂的文本,需要二维上的变换
+ FLT会对文本进行重新排序
+ 分为不同的级别,第一级别是字符串,最后一级别是glyph code
+ 在其他级别上,是中间状态
+ category 域
+ combining-spec 字符重叠
+ left-padding-flag 左空格
+ right-padding-flag 右空格
+ 在绘制文本的时候,先有字体和FLT,然后转换成glyph sequene
+ 首先查询catgory表,如果所有的glyph都没有catgory了,那么接着走
+131. 很显然:libotf只是个读取OpenType的库,有时候甚至需要进行手动调整glyph的次序
+ 但是,从学术角度上看,这个未必不是个好东西
+132. ICU中的layout engine就是在layout文件夹下的
+133. 商业级别的Layout Engine
+ 文鼎的Arphic Layout Engine:http://www.arphic.com/usa/products/ifont/layoutengine_01.htm
+ Bitstream的Panorama:http://en.wikipedia.org/wiki/Panorama_%28Layout_Engine%29
+ 蒙纳的Word Type:http://www.monotype.com/services/screen-imaging-solutions/worldtype-layout-engine
+ 甲骨文的XmCTL:http://docs.oracle.com/cd/E19455-01/806-0169/6j9hsml4a/index.html
+ D-Type的引擎:http://www.d-type.com/page/text_layout
+ RICOH的引擎:http://www.ricoh.com/font/
+ http://www.ricoh.com/font/built_in/layout/
+134. 一个项目:UTRRS (Unicode Text Rendering Reference System)
+135. Unicode知识:{\sl Unicode Demystified} By Richard Gillam
+136. Unicode的断行算法和TeX的断行算法还是有区别的,前者管的太多了
+ 而后者很简单,但是效果不错。Linebreak也叫做word warp(变形)。
+ 值得注意的是,TeX中可以断行的地方(见TeXbook第14章):
+ glue, kern, math-off, penalty, discretionary
+137. Y and Y TeX中的可以使用的一些程序
+ dvidump,类似于dviasm,需要加一个反编译的功能?
+ prepdf,去除DVIPS中的位图字体的
+138. Ren\'e Descartes, 而直角坐标叫做:Cartesian coordination
+139. 中国少数民族文字:
+ 维吾尔文,哈萨克文,柯尔克孜文:基于阿拉伯文字母,没有复杂的草写和连写
+ 锡伯文,蒙古文,满文:基于蒙古文,nirugu类似kinsuda
+ 傣语:Tai Le。Windows下的是Dafont。
+ 僳僳文:拉丁文 J O Fraser
+140. GNU C 手册
+ 1. GCC 允许标示符以$开始
+ 2. C99新加的关键字:inline restrict _Bool _Complex _Imaginary
+ 3. 白字符是分隔符而不是token
+ 4. Pointers hold memory addresses of stored constants
+ or variables. For any data type, including both primitive
+ types and custom types, you can create a pointer that
+ holds the memory address of an instance of that type.
+141. The Fundamentals of Typography摘录
+ 1. 双行读取的文字:Boustrophedon。这个叫做Reading direction
+ 2. Movable Type 1436
+ 3. A typeface is a collection of character which have the same
+ distinct design {\sl Complete Manual of Typography}
+ 4. Font is the physical means used to creat a typeface.
+ 5. Ligatures是为了避免字符相撞的,Diphthong是双元音
+142. 书写存在自由度,但是活字是被限制在一个方块中的
+ 想要有一定的自由度,那就需要一些metrics
+ 书写呢,一是写成什么样(glyph),一是在哪写(位置)
+ 所谓的Layout Engine就是做这个两个工作的
+ TeX中的glue类似于活字印刷中的铅空
+