question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Odd Unicode characters instead of real letters are now used to render texts

See original GitHub issue

Hello, in v2.0.550 text rendered in SVG rendering mode used normal letters:

<tspan x="0 16.308 33.264 61.74 80.46 88.416 114.48 133.2 151.956 167.256 185.976 214.452 232.236 250.74" y="0" font-family="g_d0_f2" font-size="36px" fill="rgb(46,83,149)">
  Sampledocument
</tspan>

The same node in v2.0.943 (after #9192) looks like so:

<tspan x="0 16.308 33.264 61.74 80.46 88.416 114.48 133.2 151.956 167.256 185.976 214.452 232.236 250.74" y="0" font-family="g_d1_f2" font-size="36px" fill="rgb(47,84,150)">
  
</tspan>

I don’t see how losing the ability to read the source would benefit anyone. Is there a way to get the old behavior back?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Snuffleupaguscommented, Nov 13, 2018

[…] and using the same font as the original source in vast majority of cases gave me much more accurate results than using some default font.

A text-selection implementation that by design breaks a relatively common feature, such as ligatures, should probably not be described as a “good solution” in general; but I digress.

Perhaps it could be an option, like disablePrivateUnicodeArea on page.render?

If glyphs are left in their original positions, and are not being re-mapped to a PUA, that is guaranteed to completely break font rendering in a very large number of PDF files; refer to PR #9340 for additional details. Honestly, it really makes no sense whatsoever to add an option (and related code) that will knowingly break font rendering in this way.

Perhaps it may be slightly more acceptable to add an option, false by default of course (to not unnecessarily bloat toFontChar), that would leave glyphs in their original position in addition to re-mapping them to a PUA. Edit: D’oh, but obviously that won’t work, and you’d need an additional array (e.g. originalToFontChar, naming things is hard) to hold this data. However, before anyone attempts to implement something, it’s advisable to wait for Brendan to comment.

0reactions
timvandermeijcommented, Jan 21, 2019

Yes, let’s close this as such and track the issue there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Are My Web Pages Displaying Strange Letters?
When browsing the Internet, you may occasionally notice that some of the letters on a page appear as strange characters or question marks....
Read more >
Weird characters like â are showing up on my site - Blog
Weird characters like â are showing up on my site. Getting weird characters like  instead of or ’? Most likely there is...
Read more >
How do I get rid of these strange characters: Now apparently ...
If you see those strange characters even with UTF-8 selected then it is likely a problem with that specific page and may be...
Read more >
Mojibake - Wikipedia
Mojibake is the garbled text that is the result of text being decoded using an unintended character encoding. ... Failed rendering of glyphs...
Read more >
Why does some text display with square boxes in some apps ...
Certain fonts which were formerly packaged in the Windows image are now ... listed above for displaying certain Unicode characters and does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found