Skip to content

Text "gibberish" effect when export to PDF #1142

Closed

Description

@J1MC83N

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

Activity

  1. J1MC83N commented on Jul 5, 2019

    @J1MC83N
    Author

    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

  2. fxha commented on Jul 10, 2019

    @fxha
    Contributor

    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?

  3. added
    ❓ confirmation needed
    on Jul 10, 2019
  4. Jocs commented on Jul 16, 2019

    @Jocs
    Member

    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.

  5. Jocs commented on Sep 29, 2019

    @Jocs
    Member

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

  6. J1MC83N commented on Sep 30, 2019

    @J1MC83N
    Author

    @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.

  7. Jocs commented on Oct 2, 2019

    @Jocs
    Member

    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?

  8. jnnkB commented on Nov 28, 2019

    @jnnkB

    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

  9. added
    🐳 help wanted
    on Dec 2, 2019
  10. AamerShareef commented on Jan 14, 2020

    @AamerShareef

    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

  11. Dssdiego commented on Mar 30, 2020

    @Dssdiego

    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...

  12. gSpera commented on May 26, 2020

    @gSpera

    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

  13. fxha commented on May 31, 2020

    @fxha
    Contributor

    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?

  14. added
    🍏 platform/macOS
    🔍 needs further investigation
    and removed
    ❓ confirmation needed
    on May 31, 2020
  15. gSpera commented on May 31, 2020

    @gSpera

    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

  16. fxha commented on Jun 3, 2020

    @fxha
    Contributor

    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

  17. gSpera commented on Jun 4, 2020

    @gSpera

    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

  18. gSpera commented on Jun 4, 2020

    @gSpera

    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.

  19. fxha commented on Jun 6, 2020

    @fxha
    Contributor

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

  20. gSpera commented on Jun 7, 2020

    @gSpera

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

  21. fxha commented on Jun 7, 2020

    @fxha
    Contributor

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

  22. removed
    🐳 help wanted
    🔍 needs further investigation
    on Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🍏 platform/macOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions