Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Noto Serif can look very buggy in JavaFX 8 #1594

Open
Dico200 opened this issue Oct 23, 2019 · 4 comments
Open

Noto Serif can look very buggy in JavaFX 8 #1594

Dico200 opened this issue Oct 23, 2019 · 4 comments
Labels
Platform-Java Platform-Java

Comments

@Dico200
Copy link

Dico200 commented Oct 23, 2019

Title

Noto Serif can look very buggy in JavaFX 8

Font

NotoSerif-Regular.ttf
NotoSerif-Bold.ttf

Where the font came from, and when

22-10-2019
https://fonts.google.com/download?family=Noto%20Serif
This repository, today during testing

Font Version

2.002; tffautohint (v1.8.2)

I tested files from
repo root/phaseIII_only/unhinted/ttf
repo root/phaseIII_only/hinted/ttf
repo root/phaseIII_only/unhinted/otf
repo root/hinted/ttf

OS name and version

Windows 10

Application name and version

JavaFX 8 distribution from Java Runtime Environment SE 1.8.0_181

Issue

My application uses JavaFX 8. The NotoSerif font can look very buggy in it, making it unusable for production.

  1. Steps to Reproduce
    Load NotoSerif-Regular.ttf in JavaFX 8, useit in a Label or any other text-displaying node and run the application.

  2. Observed results
    Some letters from the font look malformed, others are completely missing.

  3. Expected results
    The font looks as expected and the same as in previews.

  4. Additional information
    There is no problem if the font is replaced with a built-in font or Roboto.

Character data

Any representative sequence of alphanumeric characters will show the issue.

Screenshot

image

Harfbuzz hb-view and hb-shape

I am certain that this is not an issue in my OS.

@marekjez86
Copy link
Contributor

@Dico200 :
where is NotoSerif stored? Is it preinstalled on your computer you test your Java? How do you load it?

Do you intend to distribute NotoSerif with your app?

If you follow the procedure under "Using Custom Fonts" in https://docs.oracle.com/javase/8/javafx/user-interface-tutorial/text-settings.htm do you still have an issue?

@Dico200
Copy link
Author

Dico200 commented Nov 1, 2019

@marekjez86

where is NotoSerif stored?

src/main/resources/fonts/<font file>.ttf

Is it preinstalled on your computer you test your Java?

No

How do you load it?

I tried multiple ways:

  1. Font.loadFont(getClass().getResourceAsStream("/fonts/<font file>.ttf"))
  2. Font.loadFont(getClass().getResource("/fonts/<font file>.ttf").toExternalForm())
  3. @font-face { ... } syntax in CSS stylesheet.

Do you intend to distribute NotoSerif with your app?

If this issue can be made to not occur in production, yes

If you follow the procedure under "Using Custom Fonts" in https://docs.oracle.com/javase/8/javafx/user-interface-tutorial/text-settings.htm do you still have an issue?

My testing has covered the exact guidelines in there (except for the URL they pass which may only work in development).

@Dico200
Copy link
Author

Dico200 commented Nov 1, 2019

In further testing I determined that the bug only occurs under specific conditions. I do not know what is the root cause still but, here it is:

  1. If I run the application through IntelliJ IDEA - my IDE, directly, it does not occur.
  2. If I run the application from a JAR file with IntelliJ IDEA (all dependencies embedded) it does occur.

This is consistent behaviour.

One thing to note about 1. is that the application classes and resources (dependencies not included) are loaded from a file system folder, not a jar file. I have tried extracting the resources to a temporary file before using them at no avail.

I should state that I do not think that this bug is caused by you, the authors of noto-fonts, directly, despite the issue occuring (in my testing) exclusively with these fonts. However, as I have no expertise in the field of how font files work at all, I was hoping that you would be able to give me a clue as to what could potentially be causing the issue.

I will keep you updated on my testing progress / finding workarounds of course.

@marekjez86 marekjez86 added the Platform-Java Platform-Java label Apr 2, 2021
@simoncozens
Copy link
Collaborator

@Dico200, I know this is an old bug and you may have moved on, but if you have still the application around with the latest versions of OS, Java, etc. does the bug still occur?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform-Java Platform-Java
Projects
None yet
Development

No branches or pull requests

3 participants