The designer of a font is faced with the task of writing the substitution program. When you typeset with an OpenType font, your software (word processor, typesetting, even potentially the printer firmware, maybe) is supposed to interpret the substitution program and use that to determine what glyphs should be set. These programs are written in a declarative language designed for the purpose, and they can be edited with font-editing software. Each OpenType font includes a computer program that explains what replacements to perform. What replacements must be performed, depend on the font. (Note that that isn't the standard name for that particular ligature glyph - this is only an example of the need for replacement, and the standard name of "f_f_l" would be less clear.) So the input stream of symbols "a f f l i c t e d" must be converted into a new stream that might look like "a FFL.ligature i c t e d" - that is seven symbols - where "FFL.ligature" is the name of the special replacement glyph. For instance, in traditional English-language typesetting the sequence of symbols "f f l" is usually replaced by a single glyph called a "ligature," which combines the three letters into a shape that looks nicer than just setting them separately side by side. However, in some fonts, to make it look right on the page, there need to be translations applied. Usually, each of the intangible symbols in the text corresponds to a tangible symbol called a glyph, which is a pattern of ink on the printed page. For instance, to typeset the word "afflicted" your stream of symbols might be "a f f l i c t e d" that is nine symbols. By "font" I mean the computer program that lives in an OpenType font file (usual extension ".otf") that may in some cases correspond to what traditionalists would call a "typeface." Your text consists of a stream of symbols (in the computer-science sense). The situation is that you're going to typeset text using a font. I'll be using the terms that make sense to me, rather than the "easy" but uselessly vague simplified style used by all existing documentation I found. There is one important point I call the Terrible Secret, which makes all the difference to getting it to work but rather than jump to that immediately I'm going to give the needed background first. The purpose of this entry is to provide the important information that I wasn't able to find on the Net and wish I had had. What is unusual, though, is that I not only succeeded, but also figured out the undocumented underlying principle so that I can predictably succeed in the future as far as I can tell, the more usual practice is to just try things at random until one eventually either gets it working by accident, or gives up, without having learned anything useful either way. Anyone who has tried to write substitution rules for OpenType fonts has probably gone through something similar. I was up until 3 this morning trying to figure out how to make OpenType glyph substitution work. Tags used: programming, software, typography The Terrible Secret of OpenType Glyph Substitution « Animated romance day | Home | Electric kerning »
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |