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

Add font loading for GTK backend #1846

Closed
wants to merge 10 commits into from

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Apr 5, 2023

Builds on the legwork done by @kiljoy001 and #1845; instead of vendoring the python-fontconfig library, and then using just 3 methods from it, this PR builds a ctypes binding for the 3 methods we need.

This design was discussed in Discord prior to python-fontconfig being considered, so there's no provenance/licensing issues.

With this PR, the font demo now works on Gtk.

I have also converted the core font tests to pytest, and got them to 100% coverage. This PR doesn't include a test probe for live tests.

Refs #1837.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742 freakboy3742 mentioned this pull request Apr 5, 2023
4 tasks
@freakboy3742
Copy link
Member Author

My preference would still be to use GI bindings for fontconfig; however it appears that they're woefully inadequate at present, so we have to work with what we have.

@kiljoy001
Copy link
Contributor

Looks good to me - fonts are loading.

Copy link
Contributor

@kiljoy001 kiljoy001 left a comment

Choose a reason for hiding this comment

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

Fonts load on my local system - thanks!

@freakboy3742 freakboy3742 requested a review from mhsmith April 6, 2023 04:34
freakboy3742 added a commit to freakboy3742/toga that referenced this pull request Apr 7, 2023
@studioph studioph mentioned this pull request Apr 25, 2023
11 tasks
@freakboy3742
Copy link
Member Author

I'm going to close this in favor of #1903 - the latter incorporates all of this PR, but also includes tests, so it's a much better candidate for merging.

@freakboy3742 freakboy3742 deleted the fontconfig branch May 3, 2023 04:29
freakboy3742 added a commit to freakboy3742/toga that referenced this pull request May 6, 2023
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.

2 participants