Automatic code insertion


#1

When I use #Automatic Code Start and -End, Glyphs generates separate lookups for the prefix, the automatic generated code and for the suffix in the feature.

Is it possible to insert code (e.g. ignore statements) at the start of the auto-generated lookup?
When I put the ignore statements into the prefix, they are in a different lookup than the auto-generated code and do not work.

My intent is to use automatic mark positioning (e.g: b mark) where some combinations of glyphs (e.g: a b mark) just use contextual positioning without using the provided marks.
Is there a more elegant way to achieve this?


#2

Not possible inside the lookup, currently.


#3

Can you post an example?


#4

I tried to directly edit the features.fea file but I get an error message: “Lookup type different from previous rules in this lookup block”.
Is it possible to have auto generated mark to base (b mark) and ignore marks context based for combinations with a specific preceding glyph (a b mark)?

My Problem is when I combine mark to base and context based positioning, both get added together. But for the context based marking I would like to have a defined position with a fixed value for this specific case.


#5

Can you perhaps illustrate an example? I read the sentence a few times now, and <I just don’t get what exactly you want to do.


#6


I’m creating a font for a conlang. Basically it works like Korean Hangul where alphabet glyphs are combined to form syllables. I use numbers adjacent to characters to write pitch marks.


#7

So the position of the below mark is different in the last example. Why not just move the anchor in that base glyph? Or do I miss something?


#8

The a in the upper example is a full-syllable character. The syllable in the last block consist of the characters e (left) and thl (right). The anchor is part of the right glyph. The low pitch is only allowed to move left for combinations where there is space for it in the left glyph. But when I change the anchor it would collide with other combinations.


#9


#10

So the “contextual positioning” glyph is one or two glyphs?


#11

My idea was to inject ignore statements into lookup of the mark feature before the auto generated statements to override positioning for some glyph combinations.


#12

Yes, the last two syllables under contextual positioning have two glyphs each. The left is 1000pt wide and the right one is 0pt wide to form a complete syllable.

Here is another example where three glyphs form a syllable.


#13

Then you just need proper anchors in the glyphs that is the result of the contextual substitution. Or is that not a glyph and just looks like one (then your visualisation would be a bit misleading)


#14

The result of contextual substitution is still 3 glyphs. They are just transformed from the basic 1000pt wide version to a right half 0pt or a right mini 0pt version if thee glyphs fit according to the ruleset.

Because of the combinatorial complexion I cannot create glyphs for all combinations (over 20000 combinations). So the combined glyphs consist of a 1000pt wide glyph with following 0pt glyphs that fill the syllable and add pitch marks. But they stay separate.

The anchor is in the right glyph. In the last syllable of my second image you see the problem if I move the anchor inside the left half of the syllable. Only if the left glyph has space left on its right side, this would be possible.


#15

I first need to know if the shape we see on the bottom right in the last image is one precomposed glyphs or just the other three glyphs on top of each other.

The anchor in the r-conlang will only work if the ua-conlang.alt1, ng-conlang.alt1 and one-conlang.context are defined as marks.
something like this should work:

pos r-conlang ua-conlang.alt1 ng-conlang.alt1 one-conlang.context <100 100 0 0>;

This should move the one-conlang.context 100 units to the right and up. So you don’t overwrite the anchor but shift the mark glyph from the position that was defined by the anchor.


#16

The glyphs just overlap on top of each other.


#17

Can you send me the file and some sample texts?


#18

Sure


#19

Btw. short question: Is it possible to select multiple anchors that are at the same position? I can only select multiple by clicking with shift. But this way I can only select one of multiple overlapping ones.

Currently I’m experimenting with a minimal example of my font and have to add the markers to the main font.


#20

@GeorgSeifert I have sent you the files as PM

I just realized when I put the anchors only on the .isol forms where I need the low pitch in the raised position maybe they would not collide with contextual positioning as it would only be used on the combining (overlapping) glyphs. .isol glyphs always fill a glyph and are not combined with other glyphs.

I found another problem: When I set the mark glyphs to [Mark; Nonspacing] the kerning does not work anymore. e.g. ya2nai there should be a kerning of 230 between the 2 (mark) and the n.