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

Can i change font ? #400

Closed
devhalfdog opened this issue Aug 15, 2019 · 10 comments
Closed

Can i change font ? #400

devhalfdog opened this issue Aug 15, 2019 · 10 comments
Labels
question A question has been asked

Comments

@devhalfdog
Copy link

devhalfdog commented Aug 15, 2019

I had to delete the following file as it had 'error reading unexpected EOF' error and kept displaying broken Korean texts (white rectanlgles in the attached image).

$gopath/pkg/windows_amd64/fyne.io/fyne/vendor/golang.org/x/text/encoding/korean.a

Is there a way to change the font in go because it seems to be not supporting Korean language?

Image File - Korean

Image File - English

@andydotxyz
Copy link
Member

Unfortunately we don't package a Korean font with Fyne but yes, you can set your own.
If you find a suitable .ttf file you can set the environment variable "FYNE_FONT" to the path and then run the application. It should then work as expected.

We are trying to find a better solution without adding too much extra data into every app. Apologies for the inconvenience.

@devhalfdog
Copy link
Author

@andydotxyz Only TTF file? cannot otf?

oh. "Cause: freetype: invalid TrueType format: bad TTF version"

Thank ur reply

@andydotxyz
Copy link
Member

Only TTF, sorry. If you are experiencing problems can you share the file and we will test it out?

@andydotxyz andydotxyz added the question A question has been asked label Aug 22, 2019
@andydotxyz
Copy link
Member

Assuming that a TTF file was obtained and the issue resolved

@wejoy
Copy link

wejoy commented Sep 25, 2019

@andydotxyz Only TTF file? cannot otf?

oh. "Cause: freetype: invalid TrueType format: bad TTF version"

Thank ur reply

Well, that is because those package
github.com/golang/freetype
only support TTF and must be version1.0.0

You may try the ttf font file from Droid,
https://github.com/aosp-mirror/platform_frameworks_base/tree/android-sdk-4.0.3_r1/data/fonts
It looks good to me in Chinese.

@mazhiyu
Copy link

mazhiyu commented Nov 9, 2019

@andydotxyz Can the font file(.ttf) be integrated in app when packaging a graphical app? Otherwise i must provide the font file independently.

@andydotxyz
Copy link
Member

Yes that can be done. You can bundle a font resource using “fyne bundle” and then you could reference this in a custom theme. The theme would then be set with App.Settings().SetTheme(). It’s not exactly the same but it should work until we find a way to package all language fonts.

@mazhiyu
Copy link

mazhiyu commented Nov 10, 2019

Yes that can be done. You can bundle a font resource using “fyne bundle” and then you could reference this in a custom theme. The theme would then be set with App.Settings().SetTheme(). It’s not exactly the same but it should work until we find a way to package all language fonts.

Ok, i will try it. Thanks.

@aztack

This comment was marked as off-topic.

@andydotxyz

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question has been asked
Projects
None yet
Development

No branches or pull requests

5 participants