Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@ kiva/quartz/CTFont.c
# Auto-generated version info
enable/_version.py
kiva/_version.py

# Unclean test crud.
arc.png
arc_to.png
dash.bmp
sun.test_*.bmp
text_image.test_*.bmp
.hypothesis/
9 changes: 6 additions & 3 deletions kiva/fonttools/font_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
}

font_family_aliases = set(['serif', 'sans-serif', 'sans serif', 'cursive',
'fantasy', 'monospace', 'sans'])
'fantasy', 'monospace', 'sans', 'modern'])

# OS Font paths
MSFolders = \
Expand Down Expand Up @@ -445,11 +445,14 @@ def findSystemFonts(fontpaths=None, fontext='ttf'):
if len(ext) > 1 and ext[1:].lower() in fontexts:
fontfiles[f] = 1
else:
fontpaths = x11FontDirectory()
# check for OS X & load its fonts if present
if sys.platform == 'darwin':
fontpaths = []
for f in OSXInstalledFonts(fontext=fontext):
fontfiles[f] = 1
else:
# Otherwise, check X11.
fontpaths = x11FontDirectory()

for f in get_fontconfig_fonts(fontext):
fontfiles[f] = 1
Expand Down Expand Up @@ -1135,7 +1138,7 @@ def score_family(self, families, family2):
for i, family1 in enumerate(families):
family1 = family1.lower()
if family1 in font_family_aliases:
if family1 in ('sans', 'sans serif'):
if family1 in ('sans', 'sans serif', 'modern'):
family1 = 'sans-serif'
options = preferred_fonts[family1]
options = [x.lower() for x in options]
Expand Down