Can lookups create space for marks?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Can lookups create space for marks?

marty39
I'm making an all-caps font intended for close line spacing, so there's no room for accent marks. It's turned into an exercise in supporting Latin, Greek and Cyrillic scripts in a variety of European languages. To accommodate the necessary marks above and below, I want to use small caps if there is one mark, petite caps if there are two marks, maybe even teeny-weeny caps if there are three, and position the base glyph above the baseline if there's a mark below it.

I can take care of that for glyphs that I precompose in Fontforge. Can I use lookups to do the same substitutions and positioning for accented glyphs that are composed in a text layout application? If so, how?
Reply | Threaded
Open this post in threaded view
|

Re: Can lookups create space for marks?

Georg Duffner
Hi,

I’d use the ccmp feature for this purpose, put all letters sc-letters
and pc-letters in classes @LETTERS, @SCLETTERS and @PCLETTERS and all
accents in a class @ACCENTS and create a contextual lookup like this:

sub @LETTERS' @ACCENTS @ACCENTS by @PCLETTERS;
sub @LETTERS' @ACCENTS by @SCLETTERS;



Am 2016-01-04 um 18:44 schrieb marty39:

> I'm making an all-caps font intended for close line spacing, so there's no
> room for accent marks. It's turned into an exercise in supporting Latin,
> Greek and Cyrillic scripts in a variety of European languages. To
> accommodate the necessary marks above and below, I want to use small caps if
> there is one mark, petite caps if there are two marks, maybe even
> teeny-weeny caps if there are three, and position the base glyph above the
> baseline if there's a mark below it.
>
> I can take care of that for glyphs that I precompose in Fontforge. Can I use
> lookups to do the same substitutions and positioning for accented glyphs
> that are composed in a text layout application? If so, how?
>
>
>
> --
> View this message in context: http://fontforge.10959.n7.nabble.com/Can-lookups-create-space-for-marks-tp14962.html
> Sent from the User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> fontforge-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fontforge-users
> http://fontforge.10959.n7.nabble.com/User-f8781.html
>

------------------------------------------------------------------------------
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: Can lookups create space for marks?

marty39
Georg, I've seen code like that before but not within FontForge. I suppose it's for a feature file. I know there's a way to export and import feature files and snippets in FontForge, and I think I've found some usable info on how to write them.

What would I do to make room for accent marks below the base glyph? Try writing a contextual positioning lookup? Or create more substitutions with HISCLETTERS and HIPCLETTERS? I would need, not just a class @ACCENTS, but classes @TOPACCENTS and @BOTTOMACCENTS. I can do that.

Next question is which applications implement the ccmp feature. I did something in imitation of the sample attached to the 27 August 2008 developer topic "Contextual positioning," and it didn't do anything in NeoOffice Writer. Maybe writing it in a feature file would work better. Or maybe implementing anything beyond precomposed glyphs is a mere learning exercise.
Reply | Threaded
Open this post in threaded view
|

Re: Can lookups create space for marks?

marty39
In reply to this post by Georg Duffner
Georg Duffner wrote
I’d use the ccmp feature for this purpose, put all letters sc-letters
and pc-letters in classes @LETTERS, @SCLETTERS and @PCLETTERS and all
accents in a class @ACCENTS and create a contextual lookup like this:

sub @LETTERS' @ACCENTS @ACCENTS by @PCLETTERS;
sub @LETTERS' @ACCENTS by @SCLETTERS;
I just had a horrible thought. All accented letters can be made by adding one or more of the class @ACCENTS to one of the class @SCLETTERS or @PCLETTERS (only slightly oversimplified). These classes are all of manageable size. The task is  more complicated, but still manageable, when composites with single or double marks above and single marks below are considered.

But Fontforge can make doubly accented letters by adding an accent to an already accented letter. If text layout applications can similarly add accents to already accented letters, then I would have to write rules to change the size of any singly accented letter when an accent is added to it. Considering the possibility of double marks above with single marks below, and all the combinations that could generate them, the task becomes unmanageable. Do any applications do that?

BTW, why does FontForge do that?
Reply | Threaded
Open this post in threaded view
|

Re: Can lookups create space for marks?

Georg Duffner
In reply to this post by marty39
Am 2016-01-05 um 01:17 schrieb marty39:
> Georg, I've seen code like that before but not within FontForge. I suppose
> it's for a feature file. I know there's a way to export and import feature
> files and snippets in FontForge, and I think I've found some usable info on
> how to write them.

Yes, that code is for feature files. The documentation can be found at
http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html

> What would I do to make room for accent marks below the base glyph? Try
> writing a contextual positioning lookup? Or create more substitutions with
> HISCLETTERS and HIPCLETTERS? I would need, not just a class @ACCENTS, but
> classes @TOPACCENTS and @BOTTOMACCENTS. I can do that.

These cases should go to the same lookup and you have to take care of
the order. When the opentype engine goes through a string it tries to
match rule after rule in the active lookups. After matching a rule in a
lookup, the opentype engine passes on the next lookup in the font, so
you have to make sure to write the most specific or complex rule on top
and the least complex rule at the bottom of the lookup:

  sub @LETTERS' @TOPACCENTS @BOTTOMACCENTES by @HIPCLETTERS;
  sub @LETTERS' @BOTTOMACCENTS @TOPACCENTES by @HIPCLETTERS;
  sub @LETTERS' @TOPACCENTS @TOPACCENTES by @PCLETTERS;
  sub @LETTERS' @TOPACCENTS by @SCLETTERS;
  sub @LETTERS' @BOTTOMACCENTS @BOTTOMACCENTES by @HIPCLETTERS;
  sub @LETTERS' @BOTTOMACCENTS by @HISCLETTERS;

And of course, if that might occur, this and similar rules should come
even first:
  sub @LETTERS' @TOPACCENTS @TOPACCENTS @BOTTOMACCENTES by
@HIMINUSCULELETTERS;
  sub @LETTERS' @TOPACCENTS @BOTTOMACCENTS @BOTTOMACCENTES by
@SUPERHIMINUSCULELETTERS;

> Next question is which applications implement the ccmp feature. I did
> something in imitation of the sample attached to the 27 August 2008
> developer topic "Contextual positioning," and it didn't do anything in
> NeoOffice Writer. Maybe writing it in a feature file would work better. Or
> maybe implementing anything beyond precomposed glyphs is a mere learning
> exercise.

According to the Opentype layout tag registry, the ccmp feature should
be on by default
(https://www.microsoft.com/typography/otspec/features_ae.htm#ccmp). I’d
consider it a bug in the application, if it isn’t.

------------------------------------------------------------------------------
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Reply | Threaded
Open this post in threaded view
|

Re: Can lookups create space for marks?

Georg Duffner
In reply to this post by marty39
Am 2016-01-05 um 20:56 schrieb marty39:

> Georg Duffner wrote
>> I’d use the ccmp feature for this purpose, put all letters sc-letters
>> and pc-letters in classes @LETTERS, @SCLETTERS and @PCLETTERS and all
>> accents in a class @ACCENTS and create a contextual lookup like this:
>>
>> sub @LETTERS' @ACCENTS @ACCENTS by @PCLETTERS;
>> sub @LETTERS' @ACCENTS by @SCLETTERS;
>
> I just had a horrible thought. All accented letters can be made by adding
> one or more of the class @ACCENTS to one of the class @SCLETTERS or
> @PCLETTERS (only slightly oversimplified). These classes are all of
> manageable size. The task is  more complicated, but still manageable, when
> composites with single or double marks above and single marks below are
> considered.
>
> But Fontforge can make doubly accented letters by adding an accent to an
> already accented letter. If text layout applications can similarly add
> accents to already accented letters, then I would have to write rules to
> change the size of any singly accented letter when an accent is added to it.
> Considering the possibility of double marks above with single marks below,
> and all the combinations that could generate them, the task becomes
> unmanageable. Do any applications do that?
>
> BTW, why does FontForge do that?
>

What you describe is the mechanism to generate glyphs at certain code
points, that consist of a base glyph and accent glyphs. FF probably does
that because it’s the most simplistic approach, but I don’t know.

I’d circumvent these problems by decomposing precomposed glyphs in the
ccmp feature. I’d put that in a lookup that would come before the
previously discussed one:

  sub Agrave by A.sc gravecomb;
  sub Aacute by A.sc acutecomb;
  sub Acircumflex by A.sc uni0302;

and so on. So, when one types in the sequence <Á> <uni0300> (however you
do that in your application), the Á will first be replaced by A.sc and
acutecomb when passing through the first lookup. When passing through
the second lookup, the engine will already see the sequence <A.sc
acutecomb uni0302> and can match it with the line
  sub @LETTERS' @ACCENTS @ACCENTS by @PCLETTERS;


------------------------------------------------------------------------------
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html