From: Dov G. <dov...@gm...> - 2006-09-26 20:32:42
|
I give up... I've been reading both the OpenType spec, and all the relevant FontForge manuals, but I can still not figure out "how it works". I guess I would really need a "FontForge and OpenType for Dummies" introduction. So let me describe my toy problem, and what I don't understand from the FontForge tutorial and manual. E.g. let's take the "5th" examples from the manual. Let's take two examples. In the first we want to do a vertical displacement of t and h, and in the second example we want to replace the th with a separate glyph. Example 1: Q1. Which table should I use? "Context Pos" or "Chain Pos"? Q2. I'm assuming Context Pos since I want to match a certain context. I choose Contextual/Context Pos/New. What tag should I use? I'm trying "kern". This is probably not ok. But how can I know what is allowed here? Q3. I choose "by coverage". I do Match/New and type "five t h"? Is this ok? Q4. In the lookup I choose Sequence number 0 and type the label L001. Is this ok? If I now save the font as an otf font and reload it I get the following error messages: Attempt to apply a lookup to a location out of the range of this contextual lookup seq=1, max=0 Bad format for coverage table 3 Attempt to reference lookup 3 (within a contextual lookup), but there are only 2 lookups in 'GPOS' : So I erase the "Context Pos" entry and will instead try "Chain Pos". Try reloading and I still get a similar error message. Erase the context pos and save and reload without any gpos/gsub tables. This works without any error message. So I moved over to example 2, using "Chained Sub" and it worked! I.e. I could save and reload a truetype font. Some progress. :-) But now the question is, how do I use my newly created tag L001? What do I now need to do to make it trigger the use of glyph "thlig" glyph that I presumably defined? (What I want to do later is to change the order of "B n m" to "B m n" so that the "B m" ligature may be applied, where B is a base character and m and n are marks. But I figured that I should first learn the basics.) Thank you very much in advance! Dov |
From: George W. <gw...@si...> - 2006-09-27 16:25:02
|
On Tue, 2006-09-26 at 13:32, Dov Grobgeld wrote: > E.g. let's take the "5th" examples from the manual. Let's take two > examples. In the first we want to do a vertical displacement of t and > h, and in the second example we want to replace the th with a separate > glyph. > > Example 1: > > Q1. Which table should I use? "Context Pos" or "Chain Pos"? Either. It depends on how much context you feel you need to provide. I generally choose "Chain Pos", which is more flexible, but you can get by with "Context Pos" in this case. > Q2. I'm assuming Context Pos since I want to match a certain context. > I choose Contextual/Context Pos/New. What tag should I use? I'm trying > "kern". This is probably not ok. But how can I know what is allowed > here? Um... Any four letter tag is "allowed". Only certain ones will be recognized. The OpenType spec defines these: http://partners.adobe.com/public/developer/opentype/index_tag3.html 'kern' is not a particularly good choice, I'd go with 'ordn' myself. > Q3. I choose "by coverage". I do Match/New and type "five t h"? Is this ok? Nope. That would mean you would have one coverage table which matches either 5 t and h. Instead you should: [New] five [Next>] [New] t [Next>] [New] h [Next>] Now you have 3 coverage tables each matching an individual glyph. You'd probably have done better to select "by glyphs" rather than "by coverage" but this will work. > Q4. In the lookup I choose Sequence number 0 and type the label L001. > Is this ok? Nope. In the case above that would mean that whenever either a 5, t or h was found in the input stream then L001 would be applied to it. In the situation I described above you want to apply L001 to sequence positions 1 and 2. (the t and the h) > > If I now save the font as an otf font and reload it I get the > following error messages: Did you define L001? > > Attempt to apply a lookup to a location out of the range of this > contextual lookup seq=1, max=0 > Bad format for coverage table 3 > Attempt to reference lookup 3 (within a contextual lookup), but > there are only 2 lookups in 'GPOS' > : > > So I erase the "Context Pos" entry and will instead try "Chain Pos". > Try reloading and I still get a similar error message. Should not make a piece of difference. > But now the question is, how do I use my newly created tag L001? You haven't created it, you've only referenced it. You need to create it. In the contextual positioning case you need to select t (and then h) and use glyph info->Position to define L001 as a nested feature that raises the glyphs. > What > do I now need to do to make it trigger the use of glyph "thlig" glyph > that I presumably defined? "thlig" is not a very good name, Adobe suggests that you use "t_h.ordn" or some such. Anyway, create this glyph and use glyph info to define it as a ligature with tag L001 and t and h as components. > > (What I want to do later is to change the order of "B n m" to "B m n" > so that the "B m" ligature may be applied, where B is a base character > and m and n are marks. But I figured that I should first learn the > basics.) There's no really good way I can think of to reorder glyphs in the input stream. The layout engines know that certain scripts need reordering and they do that themselves, the font does not generally contain reordering info. I suppose you could do reordering by creating an mn ligature as one lookup and then decomposing it into n m as another. Not a good solution. |
From: George W. <gw...@si...> - 2006-09-27 17:11:51
Attachments:
coverage.patch.bz2
|
On Tue, 2006-09-26 at 13:32, Dov Grobgeld wrote: > If I now save the font as an otf font and reload it I get the > following error messages: > > Attempt to apply a lookup to a location out of the range of this > contextual lookup seq=1, max=0 > Bad format for coverage table 3 > Attempt to reference lookup 3 (within a contextual lookup), but > there are only 2 lookups in 'GPOS' Ah, yes. There is a bug in coverage output for contextuals. |