Skip to content

Map MODERN to "monospace" and TELETYPE to "typewriter"#977

Merged
corranwebster merged 11 commits into
mainfrom
fix/modern-family-map
May 15, 2023
Merged

Map MODERN to "monospace" and TELETYPE to "typewriter"#977
corranwebster merged 11 commits into
mainfrom
fix/modern-family-map

Conversation

@corranwebster
Copy link
Copy Markdown
Contributor

@corranwebster corranwebster commented Aug 4, 2022

This changes font handling to:

  • map "modern" font family to "monospace" rather than "sans-serif" like other backends
  • distinguish between "monospace" (sans-serif fixed pitch fonts) and "typewriter" (serif fixed pitch fonts).

Replaces uses of "modern" with "sans-serif" where appropriate (particularly in defaults) to keep appearances the same.

This now renders the benchmark like this (see the "mono" and "type" columns in particular):
image

This is not backwards compatible: users who use "modern" font family will get different fonts, but it is easily fixed by changing the font family. So this should probably be part of a major release.

Fixes #974.

This is less than ideal, as it doesn't distinguish between serif and sans-serif
monospaced fonts, but it will suit as a bugfix until something better can be
done.
This will keep the appearance the same.
@corranwebster corranwebster marked this pull request as draft August 4, 2022 19:25
@corranwebster
Copy link
Copy Markdown
Contributor Author

corranwebster commented Aug 4, 2022

Converting this to draft as there are other paths which get to modern in a FontQuery object and which are causing failures. The approach here may need a re-think.

@corranwebster corranwebster changed the title Map MODERN to "monospace" Map MODERN to "monospace" and TELETYPE to "typewriter" May 2, 2023
@corranwebster
Copy link
Copy Markdown
Contributor Author

This has been fixed up and is ready for review.

@corranwebster corranwebster marked this pull request as ready for review May 2, 2023 16:22
@corranwebster
Copy link
Copy Markdown
Contributor Author

Compare with current QPainter backend:
image

Copy link
Copy Markdown
Member

@dpinte dpinte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@corranwebster corranwebster merged commit f65de7f into main May 15, 2023
@corranwebster corranwebster deleted the fix/modern-family-map branch May 15, 2023 13:17
corranwebster added a commit to enthought/chaco that referenced this pull request May 16, 2023
This should be equivalent for currently released Enable, but will keep
things unchanged after [enable
#977](enthought/enable#977) is merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modern font family not supported properly in kiva.fonttools

2 participants