JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.64k stars 2.59k forks source link

Illegible gibberish fonts #11755

Open jsmm opened 2 months ago

jsmm commented 2 months ago

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)

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:

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

jsmm commented 2 months ago

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 org.jabref@5.16.342/org.jabref.logic.remote.client.RemoteClient.openNewConnection(Unknown Source) at org.jabref@5.16.342/org.jabref.logic.remote.client.RemoteClient.ping(Unknown Source) at org.jabref@5.16.342/org.jabref.Launcher.handleMultipleAppInstances(Unknown Source) at org.jabref@5.16.342/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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

@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 commented 2 months ago

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 commented 2 months ago

For Chinese chars we have this in the FAQ https://docs.jabref.org/faq/windows#q-i-have-issues-with-the-chinese-display-language-in-windows-10-enterprise.-what-can-i-do

Siedlerchr commented 2 months ago

Another approach, define font family? https://stackoverflow.com/questions/67893273/javafx-font-not-being-rendered-correctly

koppor commented 2 months ago

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

koppor commented 2 months ago

Is it a nvidia graphics card?

I had the same issue with Firefox and could solve it by resizing the Window. (This does not help at JabRef)

image

jsmm commented 1 month ago

@Siedlerchr The output of the command you suggested seems to be informative:

Output ``` 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 Loading FontFactory com.sun.javafx.font.directwrite.DWFactory Subpixel: enabled No match for name null in C:\WINDOWS\Fonts\segoeui.ttf No match for name null in C:\WINDOWS\Fonts\segoeuib.ttf new alphas with length = 16384 new alphas with length = 20480 new alphas with length = 61440 ```

I have restored system fonts to default several times, and both segoeui and segoeuib are installed.

C:\WINDOWS\Fonts\ ![Image](https://github.com/user-attachments/assets/b6ac7ba0-bb4c-476e-a47c-08d2cc70d23f)

@koppor My system language is Spanish (Spain). Intel(R) Iris(R) Xe Graphics.

I am very interested in transitioning from BibDesk for Mac to JabRef for Windows. I apologize for my limited technical knowledge.

Siedlerchr commented 1 month ago

Thank you very much for providing this detailed information. This looks very interesting. I will try to file a bug with this info

jsmm commented 1 month ago

I installed PDFsam, another JavaFX application, to verify if the same font issue occurs: it does. I haven't encountered any issue with fonts in the many other apps I use.

HoussemNasri commented 1 month ago

Refs https://github.com/torakiki/pdfsam/issues/481