If the document contains specific characters, the fonts become smaller when printed

subscription.owl's Avatar

subscription.owl

20 Nov, 2024 08:12 AM

In some documents, I have noticed that certain strings cause the printed output to ignore my CSS font settings and make the text much smaller. However, I haven’t found what the exact pattern(s) causing this. But I assume it has to do with some parsing error. For example:
- "Buffalo_buffalo_Buffalo_buffalo_buffalo_buffalo_Buffalo" → odd number of underscores - "https://namu.wiki/w/%EB%B7%B0%ED%8B%B0%20%EC%9D%B8%EC%82%AC%EC%9D%B..." → special characters?

Some URLs with a lot of query parameters seem to cause the issue, but I’m unsure what the exact problem might be.

Showing page 2 out of 2. View the first page

  1. Support Staff 31 Posted by Brett on 14 Mar, 2025 09:37 AM

    Brett's Avatar

    That might help. Not sure why it would have the effect it's having, though. Will have to do some testing on that.

    When you say that "font size isn't applied when printing," do you mean the font size from the CSS, or the font size specified in Marked's Export Settings?

  2. 32 Posted by subscription.ow... on 14 Mar, 2025 06:12 PM

    subscription.owl's Avatar

    Ah, I meant—regarding the font size applied to #wrapper elements in the CSS file, it doesn’t seem to be enforced unless I include it in a @media print rule.

  3. Support Staff 33 Posted by Brett on 26 Apr, 2025 04:12 PM

    Brett's Avatar

    Ok, so getting back to this one. Marked specifies a font-size in its own @media print, so that would override (specificity-wise) ANY setting outside of the @media block when printing. So in order to override specificity in that case, yes, font-size declarations do need to be in a @media print block.

    Going to do some testing with that line today.

  4. 34 Posted by subscription.ow... on 26 Apr, 2025 09:06 PM

    subscription.owl's Avatar

    Ah, great thank you!

  5. 35 Posted by subscription.ow... on 26 Apr, 2025 10:10 PM

    subscription.owl's Avatar

    Let me know if there's anything I can help with testing on my end — hoping to figure this out since I might need to print a bunch using this CSS soon-ish (in the meantime, I'm just deleting URL-like strings with a bash script, which isn't ideal).

  6. Support Staff 36 Posted by Brett on 27 Apr, 2025 05:48 PM

    Brett's Avatar

    It just makes no sense that a specific text/type of text would change the font size. The only way that should happen is via CSS, and I don't see anything problematic in the text... although wait, what if it's about the length of the string? Maybe it's not the specific content, but the length of text with no spaces in it. I'm wondering if the view is zooming out to fit a div that expands too far to accommodate the text. Let me experiment with that.

  7. Support Staff 37 Posted by Brett on 27 Apr, 2025 05:52 PM

    Brett's Avatar

    I'm once again having trouble replicating the issue, but could you try:

    @media print {
      #wrapper { overflow: hidden; }
    }
    

    And let me know what happens?

  8. 38 Posted by subscription.ow... on 27 Apr, 2025 06:52 PM

    subscription.owl's Avatar

    Oh wow, that was it. Thank you so much for looking into this over the past few months—really, really appreciate it. Okay, while I have you here—I'm hoping I could ask one more thing. (No rush on this since you've already spent so much time on the other issue.)

    I noticed that when the content in code blocks is long, it gets truncated. For example, when I put the content of lorem.md in a code block (attached) using the same custom.css, the last two paragraphs or so get cut off.

    It doesn't seem to have anything to do with a character or word limit inside the code block. Because if I make it twice as long by copying the content and putting it in the same code block, a larger portion shows (i.e., previously truncated parts are displayed), but still the last two or three paragraphs get cut off.

  9. 39 Posted by subscription.ow... on 03 May, 2025 05:59 AM

    subscription.owl's Avatar

    Actually, I realized that the solution was the same: overflow: hidden;.
    Thank you so much for your help over an extended period — really appreciate this, Brett!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac