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

PDF math equations are displayed incorrectly #8316

Closed
1 of 2 tasks
proudzhu opened this issue Jan 12, 2023 · 5 comments · Fixed by #9926
Closed
1 of 2 tasks

PDF math equations are displayed incorrectly #8316

proudzhu opened this issue Jan 12, 2023 · 5 comments · Fixed by #9926
Labels
can-be-reproduced pdf upstream Blocked by upstream deps

Comments

@proudzhu
Copy link

Search first

  • I searched and no similar issues were found

What Happened?

PDF math equations are displayed incorrectly

Reproduce the Bug

Just open the attached pdf.
Sohn 等 - 1999 - A statistical model-based voice activity detection.pdf

Expected Behavior

No response

Screenshots

image
open from logseq

image
open in zotero

Desktop or Mobile Platform Information

Win11, logseq 0.8.15

Additional Context

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@andelf andelf added the pdf label Jan 12, 2023
@cnrpman cnrpman added math upstream Blocked by upstream deps and removed math labels Jan 12, 2023
@andrewcrook
Copy link

andrewcrook commented Jan 13, 2023

I noticed a couple of things

  • I get the same on macOS with that file,
  • however, it does work using Mozilla’s PDF.js (which LogSeq also uses) built into Firefox. Maybe it needs to be updated in logseq?
  • Under logseq I see the console error
    Warning: fetchStandardFontData: failed to fetch file "FoxitSymbol.pfb" with "UnknownErrorException: StandardFontDataFactory not initialized, see the “useWorkerFetch" parameter.”.
  • Apparently Mozilla PDF.js is not complete when it comes to Foxitfont support. As mentioned
    Replace most Foxit fonts with Liberation fonts mozilla/pdf.js#14843
  • I also wonder if it's something to do with useWorkerFetch ?

Also, note that both useWorkerFetch and cMapUrl are parameters that you need to pass to getDocument

@andrewcrook
Copy link

andrewcrook commented Jan 13, 2023

  • In the meantime, I wonder if using a PDF tool/editor to change fonts and embed them into the PDF might work?
  • maybe favour some OpenType fonts (which is packaging) which show as Type 1 when embedded (type 2 compression in OTF uncompressed when embedded). I think I have that correct
  • Adobe is dropping support for Type1 in favour of concentrating on the use of the more versatile OTF
    https://helpx.adobe.com/uk/fonts/kb/postscript-type-1-fonts-end-of-support.html

FYI

>>pdffonts ./Downloads/Sohn.-.1999.-.A.statistical.model-based.voice.activity.detection.pdf 
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
Times-Italic                         Type 1            Custom           no  no  no      30  0
Times-Roman                          Type 1            Custom           no  no  no      29  0
Symbol                               Type 1            Symbol           no  no  no      45  0
Times-Bold                           Type 1            Custom           no  no  no      32  0
Times-BoldItalic                     Type 1            Custom           no  no  no      33  0
[none]                               Type 3            Custom           yes no  no      16  0
[none]                               Type 3            Custom           yes no  no      10  0

anyway I hope this information helps someone to fix the issue in LogSeq
and for other to think about how they should be creating PDFs from now on and/or avoid bit rot when archiving.

@github-actions
Copy link

Hi There! 👋

We haven't seen any activity on this issue in a while 😴, and we just wanted to make sure that it's still relevant. If you're still experiencing this issue, you might find it helpful to update to the latest version of Logseq. The latest version includes bug fixes and new features that may help to resolve this issue, and you can download it from our website. If updating to the latest version doesn't help, please let us know by adding a comment 💬. We're here to help!

If the issue has been resolved or is no longer relevant, that's great news! 🎉
We'll go ahead and close this issue to keep our backlog organized. Please note that this issue will be closed automatically in 20 days if there is no further activity. If you need more time to resolve the issue or provide more information, please just let us know by adding a comment.

Access additional Logseq 🚀 resources:

Thanks for your contributions to Logseq! If you have any other issues or feature requests, please don't hesitate to let us know. We always welcome pull requests too!

@sujjeee
Copy link

sujjeee commented Feb 8, 2024

hey @andrewcrook something similar issue any idea how i can fix this ??
Warning: fetchStandardFontData: failed to fetch file "LiberationSans-Bold.ttf" with "UnknownErrorException: The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.".

@andrewcrook
Copy link

andrewcrook commented Feb 8, 2024

@sujjeee No sorry I am no longer using Logseq because I wanted to have a page system like obsidian.
Its an issue with PDFJS I believe there are some things that can be done.

Other than that, I would check with other editors/readers if fonts are type 1, installed on the system or are embedded in the PDF and maybe play around with the PDF embedding or change fonts etc to see if it makes a difference.

can you link to the PDF so I can have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-be-reproduced pdf upstream Blocked by upstream deps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants