~mcfletch/ttfquery/trunk

« back to all changes in this revision

Viewing changes to ttfquery/guessdescription.py

  • Committer: Mike C. Fletcher
  • Date: 2015-08-17 21:05:03 UTC
  • Revision ID: mcfletch@vrplumber.com-20150817210503-4ahhtt6yw8p62qd2
Port to python 2/3 compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
ITALIC_INDICATORS = [
54
54
    'italic', 'ital','itali', 'it', 'bolditalic',
55
55
]
 
56
SYSTEM_FONTS = {}
56
57
 
57
58
def interpretModifiers( name ):
58
59
    """Heuristic attempt to get weight and italic data from font-name
118
119
        style = tstyle
119
120
    set = SYSTEM_FONTS.get( name )
120
121
    if set:
121
 
        if set.has_key( style ):
 
122
        if style in set:
122
123
            return set[style]
123
124
        # try match on italics
124
125
        for key, value in set.items():
131
132
        # well, there's at least one font here, use it...
132
133
        for key, value in set.items():
133
134
            return value
134
 
    return None
 
 
b'\\ No newline at end of file'
 
135
    return None