Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
May 15, 2023

Conversation

corranwebster
Copy link
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
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
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
Contributor Author

Compare with current QPainter backend:
image

Copy link
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
35 checks passed
@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