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

Illegible gibberish fonts #11755

Open
2 tasks done
jsmm opened this issue Sep 12, 2024 · 16 comments
Open
2 tasks done

Illegible gibberish fonts #11755

jsmm opened this issue Sep 12, 2024 · 16 comments

Comments

@jsmm
Copy link

jsmm commented Sep 12, 2024

JabRef version

5.15 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11 Pro 22631

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

JabRef is rendering text with illegible gibberish fonts.

This issue was reported in #10212 and #9423. I have tried the following steps without success:

  • Ran dism.exe (with the cleanup-image option) and sfc /scannow.
  • Reset the system fonts in Windows, logging in both Spanish (Spain) and English (United States).
  • Deleted fonts' cache.
  • Reinstalled Windows via Windows Update.

The issue occurs only in JabRef, and none of my other apps are affected. The issue persists in JabRef dev 5.16.348.

Could it be reasonable to assume that, regardless of whether this is a Windows issue, the problem is likely related to JabRef’s font settings?

From Log file:

2024-09-12 17:35:14 [pool-2-thread-3] org.apache.fontbox.ttf.CmapSubtable.processSubtype14() WARN: Format 14 cmap table is not supported and will be ignored

Appendix

Captura de pantalla 2024-09-11 133001

@Siedlerchr
Copy link
Member

Does the version with new javafx from here work? https://builds.jabref.org/jdk-ea/
Can you run in debug mode? https://docs.jabref.org/advanced/debugging-your-library-file#enable-debug-log

2024-09-12 17:35:14 [pool-2-thread-3] org.apache.fontbox.ttf.CmapSubtable.processSubtype14() WARN: Format 14 cmap table is not supported and will be ignored
This issue affects only pdf processing, not the jabref ui

If this still show the same issues, can you try this simple javafx reproducer?
https://github.com/Siedlerchr/javafxreproducer/actions/runs/10834651194/artifacts/1925778706

@jsmm
Copy link
Author

jsmm commented Sep 12, 2024

Thanks for your reply.

This is from the log of the version with new javafx:

No PostScript name data is provided for the font null
found wrong object number. expected [11870] found [12045]
Format 14 cmap table is not supported and will be ignored
No PostScript name data is provided for the font KCBBHT+Palatino-Bold
Unknown charstring command in glyph 0020 of font AEPIHR+AGaramondPro-Regular
Unknown charstring command in glyph 0020 of font BGDGBW+AGaramondPro-Italic
AAAAJV+HelveticaLTStd-Roman
Unknown charstring command in glyph 0020 of font QATHCS+Sabon-Roman
Unknown charstring command in glyph 0020 of font SJYTEO+AvenirLTStd-Book
Unknown charstring command in glyph h of font Times-Italic
Unknown charstring command in glyph i of font Times-Italic
Unknown charstring command in glyph s of font Times-Italic
Unknown charstring command in glyph s of font Times-Italic
Unknown charstring command in glyph p of font Times-Italic
Unknown charstring command in glyph a of font Times-Italic
Unknown charstring command in glyph g of font Times-Italic
Unknown charstring command in glyph n of font Times-Italic
Unknown charstring command in glyph n of font Times-Italic
Unknown charstring command in glyph l of font Times-Italic
Unknown charstring command in glyph y of font Times-Italic
Unknown charstring command in glyph b of font Times-Italic
Unknown charstring command in glyph k of font Times-Italic
found wrong object number. expected [2383] found [2384]
Unknown charstring command in glyph .notdef of font BHPBLG+TnQ
Format 14 cmap table is not supported and will be ignored

@Siedlerchr
Copy link
Member

Sorry, that is not related That is only from the pdf parser and has nothing to do with the fonts in jabref ui

@jsmm
Copy link
Author

jsmm commented Sep 12, 2024

Here is a portion of the debug log from the version using new JavaFX, where the issue still persists. Thanks.

...

Log File
Could not ping server at port 6050
java.net.ConnectException: Connection refused: getsockopt
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(Unknown Source)
	at java.base/sun.nio.ch.NioSocketImpl.connect(Unknown Source)
	at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
	at java.base/java.net.Socket.connect(Unknown Source)
	at [email protected]/org.jabref.logic.remote.client.RemoteClient.openNewConnection(Unknown Source)
	at [email protected]/org.jabref.logic.remote.client.RemoteClient.ping(Unknown Source)
	at [email protected]/org.jabref.Launcher.handleMultipleAppInstances(Unknown Source)
	at [email protected]/org.jabref.Launcher.main(Unknown Source)

Could not ping JabRef instance.
New prefs node already exists with content - skipping migration
Trust store path: C:\Users\josea\AppData\Local\org.jabref\jabref\ssl\truststore.jks
Updating base CSS for main window scene
Not updating theme because it hasn't changed
Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{jrt:/org.jabref/org/jabref/gui/Base.css}
Updating additional CSS for main window scene and 0 web engines
No api key stored for IEEEXplore fetcher
No api key stored for Biodiversity Heritage fetcher
No api key stored for Springer fetcher
No api key stored for ScienceDirect fetcher
No api key stored for SAO/NASA ADS fetcher
Unknown action: UNABBREVIATE
File: aboutdialog.fxml not found, attempting with camel case
Requested bundle for 'org.jabref.gui.help.aboutdialog'.
Injecting members for class class org.jabref.gui.help.AboutDialogView and instance org.jabref.gui.help.AboutDialogView@2d13c54c
Injecting members for class class org.jabref.gui.util.BaseDialog and instance org.jabref.gui.help.AboutDialogView@2d13c54c
Injecting members for class class javafx.scene.control.Dialog and instance org.jabref.gui.help.AboutDialogView@2d13c54c
Injecting members for class class java.lang.Object and instance org.jabref.gui.help.AboutDialogView@2d13c54c
File: aboutdialog.bss not found, attempting with camel case
File: aboutdialog.css not found, attempting with camel case
No open database detected
Initializing frame
Reading from prefs: isMaximized true
Screens: [javafx.stage.Screen@61b3a81e bounds:Rectangle2D [minX=0.0, minY=0.0, maxX=1152.0, maxY=768.0, width=1152.0, height=768.0] visualBounds:Rectangle2D [minX=0.0, minY=0.0, maxX=1152.0, maxY=720.0, width=1152.0, height=720.0] dpi:106.0 outputScale:(2.5,2.5)]
screen data:
  mainStage.WINDOW_MAXIMISED: false
  mainStage.POS_X: NaN
  mainStage.POS_Y: NaN
  mainStage.SIZE_X: NaN
  mainStage.SIZE_Y: NaN

Screen bounds: Rectangle2D [minX=0.0, minY=0.0, maxX=1152.0, maxY=768.0, width=1152.0, height=768.0]
left x: 10.0, bottom y: 768.0
lower left corner is in bounds: true
right x: 1014.0, top y: 0.0
upper right corner is in bounds: true
The JabRef window is inside screen bounds.
NOT saving window positions
screen data:
  mainStage.WINDOW_MAXIMISED: true
  mainStage.POS_X: 0.0
  mainStage.POS_Y: 0.0
  mainStage.SIZE_X: 1024.0
  mainStage.SIZE_Y: 768.0

installing CSS
Handle TextEditor key bindings
Showing mainStage
File: entryeditor.fxml not found, attempting with camel case
Requested bundle for 'org.jabref.gui.entryeditor.entryeditor'.
Injecting members for class class org.jabref.gui.entryeditor.EntryEditor and instance EntryEditor@70919ef4
Injecting members for class class javafx.scene.layout.BorderPane and instance EntryEditor@70919ef4
Injecting members for class class javafx.scene.layout.Pane and instance EntryEditor@70919ef4
Injecting members for class class javafx.scene.layout.Region and instance EntryEditor@70919ef4
Injecting members for class class javafx.scene.Parent and instance EntryEditor@70919ef4
Injecting members for class class javafx.scene.Node and instance EntryEditor@70919ef4
Injecting members for class class java.lang.Object and instance EntryEditor@70919ef4
File: entryeditor.bss not found, attempting with camel case
File: entryeditor.css not found, attempting with camel case
Opening: 'C:\Users\josea\Documents\Biblioteca\biblio-books.bib'
Detected charset: UTF-8
Supplied encoding: Optional.empty
Encoding used to read the file: UTF-8
Resource "" not found.
Flags: []
Updated search query: 
frame initialized
Cached Web views: 1
Cached Web views: 2
Cached Web views: 3
Cached Web views: 4
Resource "" not found.
Cached Web views: 5
This case should not happen.
Java vector incubator module is not readable. For optimal vector performance, pass '--add-modules jdk.incubator.vector' to enable Vector API.
Index path for C:\Users\josea\Documents\Biblioteca\biblio-books.bib is C:\Users\josea\AppData\Local\org.jabref\jabref\lucene\1\33b22a28--biblio-books.bib
Using MemorySegmentIndexInput with Java 21 or later; to disable start with -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false
Getting all linked files from index.
Adding 2886 entries to index
File: entryeditor.fxml not found, attempting with camel case
Requested bundle for 'org.jabref.gui.entryeditor.entryeditor'.
Injecting members for class class org.jabref.gui.entryeditor.EntryEditor and instance EntryEditor@50bc9439
Injecting members for class class javafx.scene.layout.BorderPane and instance EntryEditor@50bc9439
Injecting members for class class javafx.scene.layout.Pane and instance EntryEditor@50bc9439
Injecting members for class class javafx.scene.layout.Region and instance EntryEditor@50bc9439
Injecting members for class class javafx.scene.Parent and instance EntryEditor@50bc9439
Injecting members for class class javafx.scene.Node and instance EntryEditor@50bc9439
Injecting members for class class java.lang.Object and instance EntryEditor@50bc9439
File: entryeditor.bss not found, attempting with camel case
File: entryeditor.css not found, attempting with camel case
Handling UI commands []
Adding 1527 files to index
Adding file biblio-books/renkema2009discourse.pdf to the index.
Reading file C:\Users\josea\Documents\Biblioteca\biblio-books\renkema2009discourse.pdf content with 403 pages
Unknown charstring command in glyph space of font NDSNWI+MinionPhoneticPro
Unknown charstring command in glyph space of font NDSNWI+MinionPhoneticPro
Unknown charstring command in glyph space of font NDSNWI+MinionPhoneticPro
Unknown charstring command in glyph space of font NDSNWI+MinionPhoneticPro
File: errorconsole.fxml not found, attempting with camel case
Requested bundle for 'org.jabref.gui.errorconsole.errorconsole'.
Injecting members for class class org.jabref.gui.errorconsole.ErrorConsoleView and instance org.jabref.gui.errorconsole.ErrorConsoleView@46c588aa
Injecting members for class class org.jabref.gui.util.BaseDialog and instance org.jabref.gui.errorconsole.ErrorConsoleView@46c588aa
Injecting members for class class javafx.scene.control.Dialog and instance org.jabref.gui.errorconsole.ErrorConsoleView@46c588aa
Injecting members for class class java.lang.Object and instance org.jabref.gui.errorconsole.ErrorConsoleView@46c588aa
File: errorconsole.bss not found, attempting with camel case
File: errorconsole.css not found, attempting with camel case
index exceeds maxCellCount. Check size calculations for class org.jabref.gui.errorconsole.ErrorConsoleView$1

@Siedlerchr
Copy link
Member

Okay, thanks for taking the time. It's hard to narrow this down, so might involve a lot of trial and error:
Have you tried the javafx reproducer? https://github.com/Siedlerchr/javafxreproducer/actions/runs/10834651194/artifacts/1925778706
Does it show the same issues?

@jsmm
Copy link
Author

jsmm commented Sep 12, 2024

I'm not sure how to proceed with the JavaFX reproducer. Here's what I see from it:

Captura de pantalla 2024-09-12 214724

@Siedlerchr
Copy link
Member

Okay, I just wanted to rule out that it's an issue with JabRef itself.
So we now have a minimal reproducer example, but I still have no clue :(

@Siedlerchr
Copy link
Member

Okay in the hope for some more clues:
Can you open the app.bat with an editor and replace the last line with:

pushd %DIR% & %JAVA_EXEC% %CDS_JVM_OPTS% -Dprism.verbose=true -p "%~dp0/../app" -m org.jabreftest.test.javafxreproducer/org.jabreftest.test.javafxreproducer.HelloApplication  %* & popd

and then start it again? It should now provide some extensive logs on font loading etc

@HoussemNasri
Copy link
Member

HoussemNasri commented Sep 13, 2024

Closest issue I could find: https://bugs.openjdk.org/browse/JDK-8242617

The issue reported suggests that it is related to an OpenType (.otf) font, that when removed the issue is gone.

The problem seems to be related to rendering (character spacing doesn't seem right) as well as character mapping (If you compare the expected text and the gibberish one you'll notice that it maps always to the same characters, for example 'e' always maps to 'g' and 'h' is mapped to 'j', etc).

The mapping bit is controlled by something called cmap which is part of the font file.

@jsmm
Copy link
Author

jsmm commented Sep 13, 2024

Here is the Command Prompt full output after modifying app.bat and removing all .otf fonts, even though these were system fonts that had been reset previously. The issue persists.
Despite the message indicating otherwise, I am not using Windows 10 but Windows 11 Pro, version 23H2, build 22631.
Thanks again.

...

Command Prompt output
>app.bat
Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
        succeeded.
D3DPipelineManager: Created D3D9Ex device
Direct3D initialization succeeded
(X) Got class = class com.sun.prism.d3d.D3DPipeline
Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline
Maximum supported texture size: 16384
Maximum texture size clamped to 4096
OS Information:
        Windows version 10.0 build 22631
D3D Driver Information:
        Intel(R) Iris(R) Xe Graphics
        \\.\DISPLAY1
        Driver igd10iumd64.dll, version 30.0.101.3118
        Pixel Shader version 3.0
        Device : ven_8086, dev_46A8, subsys_00631414
        Max Multisamples supported: 4
 vsync: true vpipe: true
new alphas with length = 16384
new alphas with length = 20480
new alphas with length = 61440

@Siedlerchr
Copy link
Member

Thanks, there is another more debug option: prism.debugfonts

can you post the output with this command line?

pushd %DIR% & %JAVA_EXEC% %CDS_JVM_OPTS% -Dprism.verbose=true -Dprism.debugfonts=true -p "%~dp0/../app" -m org.jabreftest.test.javafxreproducer/org.jabreftest.test.javafxreproducer.HelloApplication  %* & popd 

@Siedlerchr
Copy link
Member

@jsmm can you please test the reproducer with the new debug options? That would hopefully be enough to createa a bug rpeort for javafx

@koppor
Copy link
Member

koppor commented Sep 15, 2024

I would like to know about the language of the system used. Tried with English, but that worked. Maybe, it is a Chinese setup?


Maybe, we should ship a font by ourselfes? Suggested by https://guigarage.com/2014/10/integrate-custom-fonts-javafx-application-using-css/ (linked from https://stackoverflow.com/q/31344162/873282)

@Siedlerchr
Copy link
Member

@Siedlerchr
Copy link
Member

@koppor
Copy link
Member

koppor commented Sep 15, 2024

This is an interesting rabbit hole. One can replace the default font: https://www.buildwindows.com/change-windows-font/

@koppor koppor mentioned this issue Sep 15, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants