Skip to content

kateliev/vfjLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vfjLib

Low-level reader and writer for FontLab JSON (VFJ) source font files

Installation

pip install --user git+https://github.com/kateliev/vfjLib

Usage

>>> import vfjLib
>>> jfont = vfjLib.vfjFont('testfont.vfj')
>>> jfont.dir()
Attributes (Keys) map:
   .version                   <class 'int'>
   .font                      <class 'vfjLib.object.attribdict'>
   .workspace                 <class 'vfjLib.object.attribdict'>
>>> jfont.font
<attribdict: 11>
>>> jfont.font.dir()
Attributes (Keys) map:
   .glyphsCount               <class 'int'>
   .upm                       <class 'int'>
   .glyphs                    <class 'list'>
   .interpolationFlags        <class 'int'>
   .classes                   <class 'list'>
   .openTypeFeatures          <class 'list'>
   .hinting                   <class 'vfjLib.object.attribdict'>
   .info                      <class 'vfjLib.object.attribdict'>
   .meta                      <class 'vfjLib.object.attribdict'>
   .settings                  <class 'vfjLib.object.attribdict'>
   .masters                   <class 'list'>
>>> jfont.font.glyphs[-1].layers[0].elements[0].component.glyphName
'l'
>>> jfont.font.glyphs[-1].layers[0].elements[0].component.glyphName = 'n'
>>> jfont.font.glyphs[-1].layers[0].elements[0].component.glyphName
'n'
>>> jfont.save('savedfont.vfj')

License