kiva.fonttools package¶
-
class
kiva.fonttools.
Font
(face_name='', size=12, family=1, weight=400, style=0, underline=0, encoding=0)[source]¶ Bases:
object
Font class for device independent font specification.
It is primarily based on wxPython, but looks to be similar to the needs of Mac OS X, etc.
The family defaults to SWISS so that font rotation will work correctly under wxPython. Revisit as we get more platforms defined.
-
familymap
= {0: 'serif', 1: 'sans-serif', 2: 'serif', 3: 'sans-serif', 4: 'fantasy', 5: 'cursive', 6: 'monospace'}¶
-
findfont
(language=None)[source]¶ Returns the file name and face index of the font that most closely matches our font properties.
- Parameters
language (str [optional]) – If provided, attempt to find a font which supports
language
.
-
findfontname
(language=None)[source]¶ Returns the name of the font that most closely matches our font properties.
- Parameters
language (str [optional]) – If provided, attempt to find a font which supports
language
.
-
is_bold
()[source]¶ Is the font considered bold or not?
This is a convenience method for backends which don’t fully support font weights. We consider a font to be bold if its weight is more than medium.
-
property
name
¶
-