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

Text "gibberish" effect when export to PDF #1142

Closed
1 task done
J1MC83N opened this issue Jul 5, 2019 · 18 comments · Fixed by #2190
Closed
1 task done

Text "gibberish" effect when export to PDF #1142

J1MC83N opened this issue Jul 5, 2019 · 18 comments · Fixed by #2190
Labels
🍏 platform/macOS Pull request or issue on macOS
Projects

Comments

@J1MC83N
Copy link

J1MC83N commented Jul 5, 2019

Description

  • Can you reproduce the issue?
    Text "gibberish" effect when export to PDF
    The text itself is actually correct without all the extra notations
    First page of PDF doc is fine; all other pages are affected

Steps to reproduce

  1. Open file
  2. Export to PDF
    Expected behavior:

Normal text

Actual behavior:

"ṡìȟT»ṡǧñìṝõḽõć õẇț èȟț ñèèẇțèḇ qaḽṝèwõ ṡèǧḋè èṃõṡ țaȟț èwṝèṡḇõ èW»ḽḽèẇ ṡa èćñõ"
Screen Shot 2019-07-05 at 9 47 12 PM

Versions

  • Mark Text: 0.14
  • Operating system: OS X El-Captain
@J1MC83N
Copy link
Author

J1MC83N commented Jul 5, 2019

After further inspection, the gibberish-effect only happens with html text styled multiple times, for example <center> <i> <b>Fig.1.1:</b> An example flow network with labelled capacities </i> </center>
Version 0.13.65 didn't seem to have this problem

@fxha
Copy link
Contributor

fxha commented Jul 10, 2019

Thank you for taking the time to report this issue. We cannot reproduce this issue (at least on Linux/Windows), could you please provide a full example? @Jocs Can you reproduce this issue on macOS?

@fxha fxha added the ❓ confirmation needed This issue needs confirmation label Jul 10, 2019
@Jocs
Copy link
Member

Jocs commented Jul 16, 2019

This seems to be related to encode?. It may be related to upgrading Electron. We need to observe this issue for a while. I hope that you can do some testing after the release of our new version (0.15.0) to see if this problem still exists.

@Jocs
Copy link
Member

Jocs commented Sep 29, 2019

@J1MC83N Can you still reproduce this issue on the latest version?

@J1MC83N
Copy link
Author

J1MC83N commented Sep 30, 2019

@Jocs I upgraded my system to High Sierra a while back. For condensed cases, I now cannot reproduce the issue with versions 0.14.0, 0.15.0, and 0.15.1. For the original file where the issue first appeared, I again cannot reproduce with version 0.14.0, but for some reason with 0.15.0 and 0.15.1 "export to PDF" is unresponsive/does nothing.

@Jocs
Copy link
Member

Jocs commented Oct 2, 2019

I upgraded my system to High Sierra a while back. For condensed cases, I now cannot reproduce the issue with versions 0.14.0, 0.15.0, and 0.15.1. For the original file where the issue first appeared, I again cannot reproduce with version 0.14.0, but for some reason with 0.15.0 and 0.15.1 "export to PDF" is unresponsive/does nothing.

Do you mean export PDF is not work on you macOS? is there any error?

@jnnkB
Copy link

jnnkB commented Nov 28, 2019

I currently have the described problem on v0.15.1 on macOS Catalina 10.15.1. When I use a definition list like

<dl>
 <dt>test</dt>
 <dd>test</dd>
</dl>

I get the following when trying to export to pdf:
image

@Jocs Jocs added the 🐳 help wanted Extra attention is needed label Dec 2, 2019
@AamerShareef
Copy link

AamerShareef commented Jan 14, 2020

Hi @Jocs - just to add on to the above.

Using macOS catalina. I can reproduce this when the notes contain any italics data
The whole exported file gets saved as gibberish shown above. However, if I change any italic words to normal word - it exports fine.

Update : I think the issue is probably in enclosing the *word* characters
I am using the latest rc version v0.16.0-rc.2

@Dssdiego
Copy link

Dssdiego commented Mar 30, 2020

Hi @Jocs - just to add on to the above.

Using macOS catalina. I can reproduce this when the notes contain any italics data
The whole exported file gets saved as gibberish shown above. However, if I change any italic words to normal word - it exports fine.

Update : I think the issue is probably in enclosing the *word* characters
I am using the latest rc version v0.16.0-rc.2

Confirmed on the macOS Catalina v10.15.3 as well... Any italic breaks the export to PDF.
I'm using the v0.16.1

Making italics with the "_" character also didn't work...

@gSpera
Copy link

gSpera commented May 26, 2020

Hi, I just installed MarkText v0.16.1 on macOs Catalina and i got the same problem, a found workaround: this problem happens only while using the default theme(Github), while exporting with the other themes works normally(at least for me).
Today I tried to debug the application but i cannot get the debugger to trigger a breakpoint in utils/pandoc.js. I suspect the bug is in the arguments that are passed or, at least, it could help to identify the bug.

Maybe the error is in the Github theme CSS?? (Could?? It seems strange to me)

Edit:
If someone could help me setting up the debugger I could try to debug

@fxha
Copy link
Contributor

fxha commented May 31, 2020

Is it perhaps possible that this is a rendering issue? Did you tried to open it with another PDF viewer such a web browser as the issue seems only appear on macOS? The issue (with italic text) isn't reproducible on Linux or Windows and the PDF creation is done by Chromium. Could someone try to export the document as HTML and print it with a Chromium based browser or share the faulty PDF file?

@fxha fxha added 🍏 platform/macOS Pull request or issue on macOS 🔍 needs further investigation This issue needs further investigation. and removed ❓ confirmation needed This issue needs confirmation labels May 31, 2020
@gSpera
Copy link

gSpera commented May 31, 2020

Yeah, interesting.
I just tried to open it in Safari, Chrome, an online PDF viewer and on Android(muPDF)
Always renders the same wrong text

This is what i see in the PDF viewer
image

This is the PDF file

A.pdf

# A

A *b* C

This is the source code(heading is not necessary)

Would you try to export the same file and maybe sharing??

Honestly I am thinking that the problem is or in the Chromium source code or maybe in the GitHub theme CSS(or something else??) file

@fxha
Copy link
Contributor

fxha commented Jun 3, 2020

It's very interesting that the characters are mixed up on macOS. Could you please share the HTML file (File/Mark Text -> Export -> HTML).

Would you try to export the same file and maybe sharing??

A_linux.pdf

@gSpera
Copy link

gSpera commented Jun 4, 2020

Ok, there is the HTML exported file:
A.html.txt
(Sorry but rename was needed)

Okey, I just tried to export the HTML file from Chrome(80.0.3987.132 macOS), I get the same corrupted file, so the problem is in the Chrome PDF printing.
Exporting the same file in Safari is totally correct and the PDF is not corrupted.

I think we should investigate the CSS files(or in the difference between two HTML exports with two different themes) and then report to Google

@gSpera
Copy link

gSpera commented Jun 4, 2020

Ok, sorry for second comment but I think this is important
The problem is not in Marktext, it is probably in Chrome or in macOS's FontRenderingStuffSomething

I finally got to the source of the bug: the font-family: BlinkMacSystemFont
Causes this.

I created a custom HTML file:

<html>
    <head>
        <style>
            * {
                font-family: BlinkMacSystemFont;
            }
        </style>
    </head>
    <body>
        A <i> B</i>
    </body>
</html>

Which causes the bug, but if you remove the italic element everything is ok

The workaround for Marktext is simply to edit the CSS file and remove this font in the list.

@fxha
Copy link
Contributor

fxha commented Jun 6, 2020

Could you please confirm that -apple-system,Segoe UI,Helvetica,Arial,sans-serif works as expected, thanks!

@gSpera
Copy link

gSpera commented Jun 7, 2020

Yes, a document exported as HTML and manually edited changing the .markdown-body font-family property exports as intended

@fxha
Copy link
Contributor

fxha commented Jun 7, 2020

Thanks for your contribution and this is actually an upstream issue in Chromium.

@fxha fxha removed 🐳 help wanted Extra attention is needed 🔍 needs further investigation This issue needs further investigation. labels Jun 7, 2020
@fxha fxha added this to In Review in 0.16.2 Jun 7, 2020
@Jocs Jocs closed this as completed in #2190 Jun 7, 2020
@fxha fxha moved this from In Review to Done in 0.16.2 Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍏 platform/macOS Pull request or issue on macOS
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants