ttfquery.describe
index
/home/mcfletch/pylive/ttfquery/describe.py

Extract meta-data from a font-file to describe the font

 
Modules
       
sys
fontTools.ttLib

 
Functions
       
family(font)
Get the family (and sub-family) for a font
familyNames(familyID, subFamilyID=0)
Convert family integers to human-readable names
guessEncoding(font, given=None)
Attempt to guess/retrieve an encoding from the font itself
 
Basically this will try to get the given encoding
(unless it is None).
 
If given is a single integer or a single-item tuple,
we will attempt scan looking for any table matching
given as the platform ID and returning the first sub
table.
 
If given is a two-value tuple, we will require
explicit matching, and raise errors if the encoding
cannot be retrieved.
 
if given is None, we will return the first encoding
in the font.
 
XXX This needs some work, particularly for non-win32
        platforms, where there is no preference embodied
        for the native encoding.
modifiers(font)
Get weight and italic modifiers for a font
 
weight is taken from the OS/2 usWeightClass field
italic is taken from either OS/2 fsSelection or
        head macStyle, if either indicates italics we
        report italics
openFont(filename)
Get a new font object
shortName(font)
Get the short name from the font's names table
weightName(number)
Convert integer number to a human-readable weight-name
weightNumber(name)
Convert a string-name to a weight number compatible with this module

 
Data
        FAMILY_NAMES = {0: ('ANY', {}), 1: ('SERIF-OLD', {0: 'ANY', 1: 'ROUNDED-LEGIBILITY', 2: 'GARALDE', 3: 'VENETIAN', 4: 'VENETIAN-MODIFIED', 5: 'DUTCH-MODERN', 6: 'DUTCH-TRADITIONAL', 7: 'CONTEMPORARY', 8: 'CALLIGRAPHIC', 15: 'MISCELLANEOUS'}), 2: ('SERIF-TRANSITIONAL', {0: 'ANY', 1: 'DIRECT-LINE', 2: 'SCRIPT', 15: 'MISCELLANEOUS'}), 3: ('SERIF', {0: 'ANY', 1: 'ITALIAN', 2: 'SCRIPT', 15: 'MISCELLANEOUS'}), 4: ('SERIF-CLARENDON', {0: 'ANY', 1: 'CLARENDON', 2: 'MODERN', 3: 'TRADITIONAL', 4: 'NEWSPAPER', 5: 'STUB-SERIF', 6: 'MONOTYPE', 7: 'TYPEWRITER', 15: 'MISCELLANEOUS'}), 5: ('SERIF-SLAB', {0: 'ANY', 1: 'MONOTONE', 2: 'HUMANIST', 3: 'GEOMETRIC', 4: 'SWISS', 5: 'TYPEWRITER', 15: 'MISCELLANEOUS'}), 7: ('SERIF-FREEFORM', {0: 'ANY', 1: 'MODERN', 15: 'MISCELLANEOUS'}), 8: ('SANS', {0: 'ANY', 1: 'GOTHIC-NEO-GROTESQUE-IBM', 2: 'HUMANIST', 3: 'ROUND-GEOMETRIC-LOW-X', 4: 'ROUND-GEOMETRIC-HIGH-X', 5: 'GOTHIC-NEO-GROTESQUE', 6: 'GOTHIC-NEO-GROTESQUE-MODIFIED', 9: 'GOTHIC-TYPEWRITER', 10: 'MATRIX', 15: 'MISCELLANEOUS'}), 9: ('ORNAMENTAL', {0: 'ANY', 1: 'ENGRAVER', 2: 'BLACK-LETTER', 3: 'DECORATIVE', 4: 'THREE-DIMENSIONAL', 15: 'MISCELLANEOUS'}), 10: ('SCRIPT', {0: 'ANY', 1: 'UNCIAL', 2: 'BRUSH-JOINED', 3: 'FORMAL-JOINED', 4: 'MONOTONE-JOINED', 5: 'CALLIGRAPHIC', 6: 'BRUSH-UNJOINED', 7: 'FORMAL-UNJOINED', 8: 'MONOTONE-UNJOINED', 15: 'MISCELLANEOUS'}), ...}
FONT_SPECIFIER_FAMILY_ID = 1
FONT_SPECIFIER_NAME_ID = 4
WEIGHT_NAMES = {'black': 900, 'bold': 700, 'demibold': 600, 'extrabold': 800, 'extralight': 200, 'heavy': 900, 'light': 300, 'medium': 500, 'normal': 400, 'plain': 400, ...}
WEIGHT_NUMBERS = {100: ['thin'], 200: ['extralight', 'ultralight'], 300: ['light'], 400: ['normal', 'regular', 'plain'], 500: ['medium'], 600: ['semibold', 'demibold'], 700: ['bold'], 800: ['extrabold', 'ultrabold'], 900: ['heavy', 'black']}
__file__ = '/home/mcfletch/pylive/ttfquery/describe.pyc'
__name__ = 'ttfquery.describe'
__package__ = 'ttfquery'
key = 'plain'
text_log = <logging.Logger instance at 0x35f8f38>
value = 400