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

[question] Fall back fonts. #41

Open
CamilleScholtz opened this issue Jul 28, 2017 · 3 comments
Open

[question] Fall back fonts. #41

CamilleScholtz opened this issue Jul 28, 2017 · 3 comments

Comments

@CamilleScholtz
Copy link

How would I go about loading fallback fonts, for example I'm using a ttf font that doesn't have Japanese characters, so I want a different to be used whenever there is a Japanese character.

@BurntSushi
Copy link
Owner

I don't understand the question. You need to load the fonts yourself.

Please provide more detail, including the code you're using.

@CamilleScholtz
Copy link
Author

So I'm making a panel for X. What it does is display various stats. So first load a font: https://github.com/onodera-punpun/melonbar/blob/master/bar.go#L108-L119 and then later use that font to draw a given string: https://github.com/onodera-punpun/melonbar/blob/master/bar.go#L194-L199

Now, one of the pieces of information I display is the title of the music I'm currently listening, which often uses Japanese, Korean or Arabic characters. Now say that for example I loaded a font that has gyphs for the Latin alphabet, but not for Korean, I want it to automatically fall back on a specified font that does have Korean characters.

My excuses is this is not something actually handled by xgraphics, but by freetype!

@BurntSushi
Copy link
Owner

I have no idea how to solve your problem, but it doesn't seem it should be solved by xgbutil.

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

No branches or pull requests

2 participants