Typophile

fontlab - Replaces a single glyph with multiple glyphs

clankill3r

Hi,

i want to Replaces a single glyph with multiple glyphs.
For example if someone types "forward" then i want to replace it with "backward" but i don't want to make a glyph backward cause i have around 300.000 words.

I saw this in the fontlab manual:

*) FontLab Studio supports all of the substitutions except the multiple substitutions.

Is there any program where i can do this?

Could you give more detail, especially why you wouldn't use the automatic replace features of your favourite word processor?

What do you mean with, favourite word processor?
If that is a program like indesign then my answer is because i have to make a experimental font.

atm i use

sub w' o' r' d' by r_e_p_l_a_c_e;

but to do that it makes a glyph for r_e_p_l_a_c_e.
I would prefer,

sub w' o' r' d' by r' e' p' l' a' c' e';
so it doesnt make a glyph but that code doesnt work.

Atm, i have added more then 1000glyphs and the font is 1,5 mb now.
I i go on like that the font will be around 500mb which is quote heavy for a font :)

hope those details help

Have you had a look at this thread: http://www51.academy.typophile.com/node/32319?

I did now,

i installed AFDKO.
In the topic there is this example:

sub a by b c;

but it doesnt work, do i need to code in fontlab?

What exactly do you mean by 'it doesn't work'?

Do you mean you are getting an error from AFDKO, or do you mean that you aren't observing 'a' being replaced by 'bc' when you test your font?

If the latter, this is not surprising. Very few major applications support one-to-many substitutions, so even if an appropriate lookup is present in your font, the substitutions will not be performed.

FontLab doesn't support one-to-many substitutions, so you won't be able to code such substitutions there. The Adobe CS 3 applications don't support such lookups, so your font won't work correctly in any of those (and AFAIK, CS 4 doesn't support them either), nor do most other OpenType-savvy applications on the market today.

One-to-many substitutions are something which offers a great deal of promise for certain things, but they are still sufficiently undersupported that I wouldn't recommend relying on them at this time.

Moreover, it's really very unclear to me why you would want to perform the kinds of substitutions which you are proposing above within a font. Cases where I would consider one-to-many lookups useful would include things like

sub eacute by e acutecomb;

where the replacement of a particular glyph by a sequence of glyphs doesn't alter the underlying semantics. The replacements which you are proposing, however, involve changes to the semantics which are the sort of thing which one would normally want to achieve by changing the character string rather than the glyph string, and that's the sort of thing which should be done by the application rather than the font.

Perhaps you might clarify what it is that you are trying to achieve and why.

André

I'm making a translation font, which makes a dutch text of a english text.
I know it's useles and that there are translation programs that will perform better then a translation font but that doesnt matter, it's for an academic project.

Atm i get this error in fontlab:

[ERROR] Multiple substitution not yet supported [/Users/doekewartena/Library/Application Support/FontLab/Studio 5/Features/fontlab.fea 30]
[FATAL] aborting because of errors

What is an alternative program to code this?
And is there a program on mac that supports one to many substitutions? Like tekstedit or something?

I'm making a translation font, which makes a dutch text of a english text.
I know it's useles and that there are translation programs that will perform better then a translation font but that doesnt matter, it's for an academic project.

Atm i get this error in fontlab:

[ERROR] Multiple substitution not yet supported [/Users/doekewartena/Library/Application Support/FontLab/Studio 5/Features/fontlab.fea 30]
[FATAL] aborting because of errors

What is an alternative program to code this?
And is there a program on mac that supports one to many substitutions? Like tekstedit or something?

I don't see how you could accomplish this within a font.

While one could in principle make use of one-to-many substitutions to replace English words with Dutch ones, it would be impossible to replace arbitrary English text with Dutch text. Because English and Dutch syntax are non-identical, you'd need to have code which handles entire phrases. Since the length of those phrases is unbounded you'd be looking at an infinite amount of substitution code.

André

But it would boost the sales figures if you could market InDesign as an automatic translator, hehehe.

The OpenType font format does not support many-to-many substitutions. It supports many-to-one substitutions (they are implemented in FontLab Studio 5, and work in most OpenType applications), and it supports one-to-many substitutions (they are not implemented in FontLab Studio 5 but are in the new Adobe FDK for OpenType / AFDKO library version 2.5, which will be included in the next version of FontLab Studio and which is available separately from Adobe free of charge, but those substitutions don't work properly in most Adobe applications).

Cheers,
Adam

Are they suppose to work in cs4?
(illustrator or inDesign)

No

Captured from web.archive.org on 20 Feb 2015. view this capture