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

Possibility to support opentype fonts? #3245

Closed
2 tasks done
rongcuid opened this issue Sep 7, 2022 · 6 comments
Closed
2 tasks done

Possibility to support opentype fonts? #3245

rongcuid opened this issue Sep 7, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@rongcuid
Copy link

rongcuid commented Sep 7, 2022

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

An earlier, related issue: #400

Some fonts I want to use comes with only Opentype (ttc) format, and Fyne doesn't load it. I don't know the underlying architecture as I am just trying this framework out, but it seems like golang.org/x/image/font/opentype already supports both formats. Is there a reason Fyne is not using it?

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

Support TTF and OTF fonts.

Bonus if Fyne bundles fonts for CJK languages and all languages on earth :)

@andydotxyz
Copy link
Member

it seems like golang.org/x/image/font/opentype already supports both formats. Is there a reason Fyne is not using it?

Thanks for the request, we are in the middle of moving to the go-text project for text handling and so what is supported will be set by that instead. At this time there is only .TTF support there I think, but once ported over we can work to expand that.

Bonus if Fyne bundles fonts for CJK languages and all languages on earth :)

We would love to do this, but it would make every application > 200MB on last count. We are trying to find a better approach.

@andydotxyz andydotxyz added the enhancement New feature or request label Sep 7, 2022
@rongcuid
Copy link
Author

rongcuid commented Sep 8, 2022

I think native GUI kits do something like "load system font". And maybe there can be a stack of fallbacks.

@andydotxyz
Copy link
Member

Indeed, the challenge is for consistency, and amount of platform code required.
To add support for system font lookup we have to land the code for macOS, Windows, Linux, BSD, Android and iOS, with more coming. We do intend to look at this, but it is a tremendous amount of work and so was pushed back to when we focus on internationalisation as that is where the focus shifts to this area.

@dweymouth
Copy link
Contributor

The issue title refers to OpenType support but the conversation here also relates to tracking TrueType Collection (.ttc) support, just commenting for clarity. Also there is .otc (OpenType Collection) as well

@andydotxyz
Copy link
Member

It turns out that collections is a lot more work than just different font formats.

To get collections working well also needs lazy loading based on some criteria, so opening a new issue for it - #4053

@andydotxyz
Copy link
Member

Support for ".otf" is in on develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants