Abraham Lee
2016-02-29 15:18:10 UTC
All,
I use FontForge's python scripting capabilities all the time (it is
heaven-sent for my work). I have two questions about embedded tables:
*1. Is it possible to keep non-standard tables from getting tossed when
opening a file? *
I know it's possible when using the GUI, but I can't seem to determine the
proper syntax for doing this via python scripting.
In the docs, it gives the function definition as
*fontforge.open(filename[, flags])*
with the description:
*Opens a filename and returns the font it contains. If it does.*
*If the flags argument is 4, then ff will load all glyphs in the 'glyf'
table of a ttc file (rather than just the glyphs used in the font picked).
This will not load all 'glyf' tables though.*
Am I supposed to be able to access them this way? The variable "flags" is
supposed to be an integer, and it doesn't seem to matter what integer I put
in there, so I'm not sure what to do.
2. I'm also aware that you can access and embed any table in the font via
"getTableData" and "setTableData", respectively. These functions speak of
the data being in a "binary string" format. When keeping a non-standard
table in the GUI, they are encoded in the ascii85 format. *Is this the
format they are referring to?* If not, that's fine, I'd just like to know
what the correct format is.
Thanks, everyone! Any insight would be very much appreciated!
Best,
Abraham
I use FontForge's python scripting capabilities all the time (it is
heaven-sent for my work). I have two questions about embedded tables:
*1. Is it possible to keep non-standard tables from getting tossed when
opening a file? *
I know it's possible when using the GUI, but I can't seem to determine the
proper syntax for doing this via python scripting.
In the docs, it gives the function definition as
*fontforge.open(filename[, flags])*
with the description:
*Opens a filename and returns the font it contains. If it does.*
*If the flags argument is 4, then ff will load all glyphs in the 'glyf'
table of a ttc file (rather than just the glyphs used in the font picked).
This will not load all 'glyf' tables though.*
Am I supposed to be able to access them this way? The variable "flags" is
supposed to be an integer, and it doesn't seem to matter what integer I put
in there, so I'm not sure what to do.
2. I'm also aware that you can access and embed any table in the font via
"getTableData" and "setTableData", respectively. These functions speak of
the data being in a "binary string" format. When keeping a non-standard
table in the GUI, they are encoded in the ascii85 format. *Is this the
format they are referring to?* If not, that's fine, I'd just like to know
what the correct format is.
Thanks, everyone! Any insight would be very much appreciated!
Best,
Abraham