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

Editor: Enable display of characters unsupported by chosen editor font #7753

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthiasblaesing
Copy link
Contributor

It was noticed, that in some contexts Swing was able to display characters unsupported by the currently chosen font. The problem was observed with emojis. Investigation showed, that the problem appears if a font is explicitly constructed via the constructor, but vanishes if the font is accessed via StyleContext#getFont.

The difference is that StyleContext#getFont returns a CompositeFont, that fallsback to other fonts for undefined glyphs.

As CompositeFont is located in the sun.font package, it can't be accessed directly. Instead the font acccess via the DefaultStyleContext is used.

Before:
Bildschirmfoto vom 2024-09-15 17-27-56

After:
Bildschirmfoto vom 2024-09-15 17-35-26

It was noticed, that in some contexts Swing was able to display
characters unsupported by the currently chosen font. The problem was
observed with emojis. Investigation showed, that the problem appears if
a font is explicitly constructed via the constructor, but vanishes if
the font is accessed via StyleContext#getFont.

The difference is that StyleContext#getFont returns a CompositeFont,
that fallsback to other fonts for undefined glyphs.

As CompositeFont is located in the sun.font package, it can't be
accessed directly. Instead the font acccess via the DefaultStyleContext
is used.
@matthiasblaesing matthiasblaesing added Platform [ci] enable platform tests (platform/*) UI User Interface ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Sep 15, 2024
@apache apache locked and limited conversation to collaborators Sep 15, 2024
@apache apache unlocked this conversation Sep 15, 2024
@mbien mbien added this to the NB24 milestone Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Platform [ci] enable platform tests (platform/*) UI User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants