Font
===============================================
Font - base class to represent font
===============================================
CONSTRUCTOR
Font() - generic constructor, creates an empty Font
Font(Font) - copy constructor
Font(string filename) - creates a Font and assigns name of the file
from which it was opened
Font(Font, instances) - generate instance constructor, instances is a tuple
containing instance values for all MM axes defined
in the font (not reported by docstring)
ATTRIBUTES
IDENTIFICATION
file_name(string) - full path of the file from which
the font was opened/saved
(this attribute is not reported by the docstring)
family_name(string) - font Family Name
style_name
full_name(string) - font Full Name
font_name(string) - font Font Name
font_style(integer) - Font Style as BitList:
italic = 1
underscored = 2
negative = 4
outlined = 8
strikethough = 16
bold = 32
menu_name(string) - font menu name
apple_name(string) - FOND Name
(this attribute is not reported by the docstring)
fond_id(int) - FOND ID
(not reported by docstring, new in FL 4.5.2)
pref_family_name(string) - OpenType-specific font Family Name
(this attribute is not reported by the docstring)
pref_style_name(string) - OpenType-specific font Style Name
(this attribute is not reported by the docstring)
mac_compatible(string) - OpenType-specific font Mac Name
(this attribute is not reported by the docstring)
default_character(string)- glyph name that represents the PFM default
character attribute (not reported by docstring)
weight
weight_code
width
designer(string)
designer_url(string)
fontnames[NameRecord] - list of font name records
copyright(string) - Copyright name field
notice(string) - Notice field
note(string) - Font note
unique_id(integer) - Type 1 Unique ID number
tt_u_id(string) - TrueType Unique ID record
tt_version(string) - TrueType Version record
trademark(string)
x_u_id_num
x_u_id
vendor(string) - TrueType vendor code
vendor_url(string)
version(string)
year(integer)
version_major(integer)
version_minor(integer)
vp_id(integer)
ms_charset(integer)
ms_id(integer)
panose[integer] - list of Panose values
pcl_chars_set(string)
pcl_id(integer)
DIMENSIONS
upm
ascender[integer] - list of ascenders, one for each master
descender[integer] - list of descenders, one for each master
cap_height[integer] - list of CapHeight records, one for each master
x_height[integer] - list of xHeight values, one for each master
default_width
slant_angle
italic_angle(float) - Italic Angle
is_fixed_pitch
underline_position(integer)
underline_thickness(integer)
ALIGNMENT
blue_fuzz
blue_scale
blue_shift
blue_values_num(integer) - number of defined blue values
blue_values[integer[integer]] - two-dimentional array of BlueValues
master index is top-level index
other_blues_num(integer) - number of defined OtherBlues values
other_blues[integer[integer]] - two-dimentional array of OtherBlues
master index is top-level index
family_blues_num(integer) - number of FamilyBlues records
family_blues[integer[integer]] - two-dimentional array of FamilyBlues
master index is top-level index
family_other_blues_num(integer) - number of FamilyOtherBlues records
family_other_blues[integer[integer]] - two-dimentional array of FamilyOtherBlues
master index is top-level index
force_bold[integer] - list of Force Bold values, one for
each master
stem_snap_h_num(integer)
stem_snap_h
stem_snap_v_num(integer)
stem_snap_v
OTHER
modified(integer) - 0 if unmodified, 1 if modified (to control the
'save changes' dialog) (this attribute is not
reported by the docstring)
classes[string] - list of glyph classes
ot_classes(string) - string containing the OT classes defined in the lower
right part of the OpenType panel (this description
is not reported by the docstring)
features[Feature] - list of OpenType features
customdata(string) - font custom data field
truetypetables[TrueTypeTable] - list of custom TrueType tables
ttinfo(TTInfo) - loaded TrueType information
(mostly hinting-related tables)
encoding(Encoding) - current encoding of the font
codepages[integer] - list of codepage-numbers (see OT-specs)
(this attribute is not reported by the docstring
this attribute is linked with the
ttinfo.os2_ul_code_page_range1 and
ttinfo.os2_ul_code_page_range2 values)
unicoderanges[integer] - list of unicoderange-numbers (see OT-specs)
(this attribute is not reported by the docstring)
glyphs[Glyph] - array of glyphs
source - the Created By field
(this description is not reported by the docstring)
weight_vector[float] - list of MM-settings for generate instance
hguides [Guide] - list of horizontal guides
(new in v4.5.4 and not reported by docstring)
vguides [Guide] - list of vertical guides
(new in v4.5.4 and not reported by docstring)
OPERATIONS
len - returns number of glyphs
[] - accesses glyphs array
METHODS
New() - clears the font
Open(string filename) - opens font from VFB format
Save(string filename) - saves font in VFB format
OpenAFM(string filename, int mode, int layer)
- open AFM-File, mode is the integer bit field.
The bit list is:
ALLMETRICS - 0x0001
THICKERMETRICS - 0x0002
WIDERMETRICS - 0x0004
CLOSEMETRICS - 0x0008
REPLACEKERNING - 0x0010
ADDKERNING - 0x0020
AUTOKERNING - 0x0040
REPLACEOTHERDATA - 0x0100
REPLACENAMES - 0x0200
(this method is not reported by the docstring)
Constants for mode (only in FL 4.5 Mac)
mtALLMETRICS
mtTHICKERMETRICS
mtWIDERMETRIC
mtCLOSEMETRICS
mtREPLACEKERNING
mtADDKERNING
mtAUTOKERNING
mtREPLACEOTHERDATA
mtREPLACENAMES
SaveAFM(string filename)
- saves AFM- and INF-File
(this method is not reported by the docstring)
Reencode(Encoding E)|(Encoding E, integer style)
- applies Encoding E to Font
(the parameters of this method are not
reported by the docstring and i don't
know what the style parameter does)
FindGlyph(string name) | (Uni unicode) | (integer Unicode)
- finds glyph and return its index or -1
DefineAxis(string Name, string Type, string ShortName)
- defines the new Multiple Master axis
DeleteAxis(axisindex, float position)
- removes the axis
GenerateUnicode() - generates Unicode indexes for all glyphs
GenerateNames() - generates names for all glyphs
GenerateGlyph(string glyphname)
- generates new glyph using 'glyphname' as
a source of information about glyph's composition
see 'FontLabDir/Mapping/alias.dat' for composition
definitions
has_key(string name) | (Uni unicode) | (integer Unicode)
- finds glyph and return 1 (found) or 0 (not found)
(this method is not reported by the docstring)
GenerateFont(fontType, filename)
- generates Font, see FontLab class for
description. (As a method of the Font class, this
method is deprecated. Since FontLab 4.52 for Mac
and FontLab 4.53 for Windows, GenerateFont is a method
of the FontLab class)