Skip to content

Script font family not supported in font queries #971

@corranwebster

Description

@corranwebster

If you do

gc.set_font(Font(family=SCRIPT, size=24))

in a backend that uses kiva.fonttools to find font files, then you get the following error:

/Users/cwebster/.edm/envs/edm/lib/python3.6/site-packages/kiva/fonttools/font_manager.py:294: UserWarning: findfont: Font family ['script'] not found. Falling back to sans-serif
  % (query.get_family(), self.default_family)

This is because script is not listed in the options here:

font_family_aliases = {
"serif",
"sans-serif",
"sans serif",
"cursive",
"fantasy",
"monospace",
"sans",
"modern",
}
preferred_fonts = {
"fantasy": [
"Comic Sans MS",
"Chicago",
"Charcoal",
"ImpactWestern",
"fantasy",
],
"cursive": [
"Apple Chancery",
"Textile",
"Zapf Chancery",
"Sand",
"cursive",
],
"monospace": [
"Bitstream Vera Sans Mono",
"DejaVu Sans Mono",
"Andale Mono",
"Nimbus Mono L",
"Courier New",
"Courier",
"Fixed",
"Terminal",
"monospace",
],
"serif": [
"Bitstream Vera Serif",
"DejaVu Serif",
"New Century Schoolbook",
"Century Schoolbook L",
"Utopia",
"ITC Bookman",
"Bookman",
"Nimbus Roman No9 L",
"Times New Roman",
"Times",
"Palatino",
"Charter",
"serif",
],
"sans-serif": [
"Bitstream Vera Sans",
"DejaVu Sans",
"Helvetica Neue",
"Arial",
"Verdana",
"Helvetica",
"Lucida Grande",
"Geneva",
"Lucid",
"Avant Garde",
"sans-serif",
],
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions