Quantcast

[Python API] Cleaning up lookup subtables

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Python API] Cleaning up lookup subtables

Abraham Lee
All,

I have an semi-automated process that goes something like this:

1. Open a font that contains lots more glyphs than I will create (as a template)
2. Edit the glyphs I want to change
3. Remove the glyphs I didn't change
4. Generate the OTF

Everything works just as I expect except for one thing. While in the process of generating OTF files (step #4), I get the following error (line 593 in "fontforge/lookups.c"):

"Lookup subtable contains unused glyph [XYZ] making the whole subtable invalid"

The larger font that has lots of lookups. However, since I only edit a subset of the original glyphs and remove the others, some of the lookups end up containing ligature substitution data that no longer is valid.

My question is this: Is there a fast way to clean up the lookup subtables prior to so that any reference to now non-existent glyphs can be removed? I'd like to be able to do this via the Python API since I'll be doing this quite a few times with different fonts.

Thanks in advance,
Abraham

P.S. Perhaps the error should specifically mention that it is a "ligature" subtable? That would at least help in pin-pointing the problem faster.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
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
|  
Report Content as Inappropriate

Re: [Python API] Cleaning up lookup subtables

Frank Trampe
Sorry about that. This is not a difficult problem to fix, and I think that we ought to add a general "Clean References" function that does this. I'm way behind on real work from the recent release, but it is on my list.

In the interim, running RemovePosSub("*") on each glyph before removing it might work.


On Wed, Oct 5, 2016 at 2:01 PM, Abraham Lee <[hidden email]> wrote:
All,

I have an semi-automated process that goes something like this:

1. Open a font that contains lots more glyphs than I will create (as a template)
2. Edit the glyphs I want to change
3. Remove the glyphs I didn't change
4. Generate the OTF

Everything works just as I expect except for one thing. While in the process of generating OTF files (step #4), I get the following error (line 593 in "fontforge/lookups.c"):

"Lookup subtable contains unused glyph [XYZ] making the whole subtable invalid"

The larger font that has lots of lookups. However, since I only edit a subset of the original glyphs and remove the others, some of the lookups end up containing ligature substitution data that no longer is valid.

My question is this: Is there a fast way to clean up the lookup subtables prior to so that any reference to now non-existent glyphs can be removed? I'd like to be able to do this via the Python API since I'll be doing this quite a few times with different fonts.

Thanks in advance,
Abraham

P.S. Perhaps the error should specifically mention that it is a "ligature" subtable? That would at least help in pin-pointing the problem faster.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
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
|  
Report Content as Inappropriate

Re: [Python API] Cleaning up lookup subtables

Abraham Lee
On Wed, Oct 5, 2016 at 1:23 PM, Frank Trampe <[hidden email]> wrote:
Sorry about that. This is not a difficult problem to fix, and I think that we ought to add a general "Clean References" function that does this. I'm way behind on real work from the recent release, but it is on my list.

That's wonderful! I didn't know I needed that until now.
 
In the interim, running RemovePosSub("*") on each glyph before removing it might work.

I tried that, but for some reason the error kept happening. In any case, I can move forward for now by doing that for ALL glyphs. Thanks for the help!

- Abraham 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
fontforge-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fontforge-users
http://fontforge.10959.n7.nabble.com/User-f8781.html
Loading...