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

[Substance] Writing Japanese text fails when using Substance #4

Closed
kirill-grouchnikov opened this issue May 23, 2018 · 6 comments
Closed
Assignees
Labels
3.0 - Diamond Release 3.0 - 2020.H1

Comments

@kirill-grouchnikov
Copy link
Owner

When i use the default system look & feel, and click Browse to select a file i select a file with a Japanese name and its Japanese name appears fine in the JTextField. If i use a Substance look and feel, select the same file, its name appears as blocks in the JTextField.

@enwired
Copy link

enwired commented Nov 7, 2018

I am able to get around this on Windows by using
SubstanceCortex.GlobalScope.setFontPolicy(fontPolicy)
with a FontPolicy object designed to return fonts based on Arial Unicode MS font.

But if you are thinking of some fix that would work better, I'll be happy to hear of it!

Also, it took me quite a bit of digging through source code to find out how to create a FontSet and FontPolicy. If there is more documentation, I'd be happy to hear of that as well.

@DevCharly
Copy link

Had the same problem in FlatLaf and was able to solve it by using

Font font = new javax.swing.text.StyleContext().getFont( family, style, size );

to create fonts instead of new Font(...).

This creates a composite font that is able to display all Unicode characters.

See commit JFormDesigner/FlatLaf@9eaee8d

Hope this helps.

@kirill-grouchnikov
Copy link
Owner Author

Thanks! Looks like you're only doing this on Windows?

@DevCharly
Copy link

No, on all platforms.

@kirill-grouchnikov
Copy link
Owner Author

Just verified that it works on Windows. The font fallback already works on my Mac machine, but I'll add it for all the platforms. Just need to figure out the right place to put it.

@kirill-grouchnikov kirill-grouchnikov self-assigned this May 2, 2020
@kirill-grouchnikov kirill-grouchnikov added the 3.0 - Diamond Release 3.0 - 2020.H1 label May 2, 2020
kirill-grouchnikov added a commit that referenced this issue May 2, 2020
First pass for #4
@enwired
Copy link

enwired commented May 4, 2020

Thanks. Glad this was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 - Diamond Release 3.0 - 2020.H1
Projects
None yet
Development

No branches or pull requests

3 participants