New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to edit contextual subtables by commands? #2923

Closed
Pecita opened this Issue Oct 24, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@Pecita

Pecita commented Oct 24, 2016

Dear developers,
If you please, I would like a little help: how to edit contextual subtables by commands?

I would like to automate the creation of a font whose characters are connected in various ways,
in particular by generating articulations of calt and aalt subtables that it would be excessively tedious to do manually.
I have everything available except populating the contextual subtables.

@frank-trampe

This comment has been minimized.

Show comment
Hide comment
@frank-trampe

frank-trampe Oct 24, 2016

Contributor

@Pecita, are you asking about how to read/write contextual subtables in the scripting environment or how to generate the values?

Contributor

frank-trampe commented Oct 24, 2016

@Pecita, are you asking about how to read/write contextual subtables in the scripting environment or how to generate the values?

@Pecita

This comment has been minimized.

Show comment
Hide comment
@Pecita

Pecita Oct 25, 2016

read/write contextual subtables in the scripting environment.

For example, I imagine to generate (taking values from XML and XSLT logic) a such script:
#!/usr/bin/fontforge
Open('Arghja.sfd')
# Real commands
AddLookup('aalt_10','gsub_alternate',0,[['aalt',[['latn',['dflt']]]]])
AddLookupSubtable('aalt_10','aalt_10_')
AddLookup('aalt_01','gsub_alternate',0,[['aalt',[['latn',['dflt']]]]])
AddLookupSubtable('aalt_01','aalt_01_')
AddLookup('calt_pass1','gsub_context',8,[['calt',[['latn',['dflt']]]]])
AddLookupSubtable('calt_pass1','calt_pass1_')
Select('a')
AddPosSub('aalt_01_','uniE481')
AddPosSub('aalt_10_','uniE482')
# Imagined commands
ChangeMotif('calt_pass1',[['1',[['a d h k l m n r t u dotlessi']]]])
AddRules('calt_pass1','[1 @<aalt_01> 1 @<aalt_10>]')
(etc.)

To automatize this UI action :
capture du 2016-10-25 02-41-52

Pecita commented Oct 25, 2016

read/write contextual subtables in the scripting environment.

For example, I imagine to generate (taking values from XML and XSLT logic) a such script:
#!/usr/bin/fontforge
Open('Arghja.sfd')
# Real commands
AddLookup('aalt_10','gsub_alternate',0,[['aalt',[['latn',['dflt']]]]])
AddLookupSubtable('aalt_10','aalt_10_')
AddLookup('aalt_01','gsub_alternate',0,[['aalt',[['latn',['dflt']]]]])
AddLookupSubtable('aalt_01','aalt_01_')
AddLookup('calt_pass1','gsub_context',8,[['calt',[['latn',['dflt']]]]])
AddLookupSubtable('calt_pass1','calt_pass1_')
Select('a')
AddPosSub('aalt_01_','uniE481')
AddPosSub('aalt_10_','uniE482')
# Imagined commands
ChangeMotif('calt_pass1',[['1',[['a d h k l m n r t u dotlessi']]]])
AddRules('calt_pass1','[1 @<aalt_01> 1 @<aalt_10>]')
(etc.)

To automatize this UI action :
capture du 2016-10-25 02-41-52

@Pecita

This comment has been minimized.

Show comment
Hide comment
@Pecita

Pecita Jan 17, 2017

Dear developers,
I am (almost * ) able to generate using FF scripting a font with accentuable and connectable letters in the Pecita style. Sources are two concise XML files and SVG images without thickness. With this tool it is possible for a user not knowing typography nor how to use FontForge to create a complex Latin or Cyrillic writing font.

* Well almost !
For calt lookups tables I do not know what to do else that generate a file to do copy/paste. Still missed!
Do you have an idea to make my tool possible?

genCalt.txt

Pecita commented Jan 17, 2017

Dear developers,
I am (almost * ) able to generate using FF scripting a font with accentuable and connectable letters in the Pecita style. Sources are two concise XML files and SVG images without thickness. With this tool it is possible for a user not knowing typography nor how to use FontForge to create a complex Latin or Cyrillic writing font.

* Well almost !
For calt lookups tables I do not know what to do else that generate a file to do copy/paste. Still missed!
Do you have an idea to make my tool possible?

genCalt.txt

@Pecita

This comment has been minimized.

Show comment
Hide comment
@Pecita

Pecita Aug 26, 2017

Just a small up. Is there a way to replace the tedious copy/paste in this tool: aghja.net / gencalt step ?
I do not think it is possible with FontForge scripting but I am taker of any inventive solution.

Pecita commented Aug 26, 2017

Just a small up. Is there a way to replace the tedious copy/paste in this tool: aghja.net / gencalt step ?
I do not think it is possible with FontForge scripting but I am taker of any inventive solution.

@frank-trampe

This comment has been minimized.

Show comment
Hide comment
@frank-trampe

frank-trampe Aug 26, 2017

Contributor

@Pecita, my French isn't bad, but that's a long document. Based on your previous comments, I think that the best thing is to expose a little more of the GSUB functionality in the scripting interface. @davelab6, could you help us plan/design that?

Contributor

frank-trampe commented Aug 26, 2017

@Pecita, my French isn't bad, but that's a long document. Based on your previous comments, I think that the best thing is to expose a little more of the GSUB functionality in the scripting interface. @davelab6, could you help us plan/design that?

@Pecita

This comment has been minimized.

Show comment
Hide comment
@Pecita

Pecita Oct 26, 2017

Using a fea file may be a track?
I tried using an fea file generated by FF but it fail on merging back at the calt table step:

sub @cc2_match_2' @cc2_match_1'  by   ;

gives

No substitution specified on line 417 of Pecita-Latin.fea

Use for test fea.zip

Pecita commented Oct 26, 2017

Using a fea file may be a track?
I tried using an fea file generated by FF but it fail on merging back at the calt table step:

sub @cc2_match_2' @cc2_match_1'  by   ;

gives

No substitution specified on line 417 of Pecita-Latin.fea

Use for test fea.zip

@Pecita

This comment has been minimized.

Show comment
Hide comment
@Pecita

Pecita Dec 13, 2017

The issue #3219 is the best way to solve this problem.

Pecita commented Dec 13, 2017

The issue #3219 is the best way to solve this problem.

@Pecita Pecita closed this Dec 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment