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

Bitcoin sign (₿, U+20BF) doesn't render in PDF and some browsers #106

Open
dhimmel opened this issue Feb 1, 2018 · 15 comments
Open

Bitcoin sign (₿, U+20BF) doesn't render in PDF and some browsers #106

dhimmel opened this issue Feb 1, 2018 · 15 comments
Labels
frontend issues related to the HTML view and interactivity

Comments

@dhimmel
Copy link
Member

dhimmel commented Feb 1, 2018

As commented by @arielsvn in greenelab/scihub-manuscript#51 (comment):

there seems to be an encoding issue with the bitcoin symbol on the Discussion section. I noticed it on the pdf, and the same happens with the markdown file, at least on my computer.

screenshot

This is likely due to the unicode character (₿, U+20BF) a recent addition as part of Unicode 10.0, released June 2017. Note this release has other important symbols/emojis such as 🧟 (Zombie) and 🧖 (Person in Steamy Room).

For me, on Chrome on Ubuntu 17.10, the bitcoin sign renders in the HTML but not the PDF. I'm assuming the PDF gets a certain font embedded on Travis CI, which doesn't have the latest characters. Note that when I generate the PDF locally, the bitcoin signs do render.

So @arielsvn, I think we may want to look into the following solutions:

  • Updating the font used by the Travis CI build
  • Specifying a font to use that is up to date

@arielsvn you probably know best what to do here.

@arielsvn
Copy link

arielsvn commented Feb 1, 2018

Thanks for the info @dhimmel, I'll look into it.

In my case I was using Chrome on Ubuntu 16.04, and the bitcoin sign didn't render correctly on the html either.

@dhimmel
Copy link
Member Author

dhimmel commented Feb 1, 2018

I'll look into it

Awesome. Do you think we should load a font or leave it up to viewers to have up-to-date fonts? For reference, the CSS we're using is github-pandoc.css.

@arielsvn
Copy link

arielsvn commented Feb 1, 2018

I think is best to load a font, that way we would be certain that the generated document looks the same for anyone viewing it.

@dhimmel
Copy link
Member Author

dhimmel commented Feb 1, 2018

I think is best to load a font

Do you want to implement this? And if so, what's your timeline? I'm wondering whether we should wait to post to Sci-Hub Manuscript v3... I could always print to PDF as a workaround.

@arielsvn
Copy link

arielsvn commented Feb 1, 2018

Do you want to implement this? And if so, what's your timeline?

Sure! Let me give it a quick try now, and I'll let you know if I run into any issues that may require more time.

@arielsvn
Copy link

arielsvn commented Feb 1, 2018

@dhimmel do you have any preference for what font to use??

@dhimmel
Copy link
Member Author

dhimmel commented Feb 1, 2018

Not really.

Preferably one that is openly licensed although I don't know much about the interplay of fonts and copyright.

Perhaps something similar to what PeerJ uses (example)?

@agitter do you have any insight?

@arielsvn
Copy link

arielsvn commented Feb 1, 2018

PeerJ seems to be using Helvetica with fallback to Arial.

Another solution could be using the HTML entity ฿ of the bitcon character. That way it gets rendered correctly, even on my computer where I haven't updated the font.

@agitter
Copy link
Member

agitter commented Feb 1, 2018

do you have any insight?

Sorry, I have no ideas about the best font.

@dhimmel
Copy link
Member Author

dhimmel commented Feb 2, 2018

Another solution could be using the HTML entity ฿ of the bitcon character. That way it gets rendered correctly, even on my computer where I haven't updated the font.

I don't understand this? Why should how the character is represented in plain text affect whether your browser can display it?

@arielsvn
Copy link

arielsvn commented Feb 2, 2018

I don't understand this? Why should how the character is represented in plain text affect whether your browser can display it?

Me neither, I need to read more about it. On my computer I see they are rendered differently: (₿, U+20BF) vs (฿, ฿). My guess is that these are different characters.

₿ != ฿

Edit: Here's how I see these characters here on Github.

image

@agitter
Copy link
Member

agitter commented Feb 2, 2018

₿ != ฿

Same behavior for me in both browsers I tested

@dhimmel
Copy link
Member Author

dhimmel commented Feb 2, 2018

This is because ฿ encodes U+0E3F rather than U+20BF. ฿ is the Thai currency symbol Baht, not the bitcoin currency sign. ฿ has been around since Unicode 1.1.0 (June, 1993).

@arielsvn
Copy link

arielsvn commented Feb 5, 2018

Oh that explains the difference, I must have made a mistake when pasting the code ฿, I thought I had copied it from U+20BF but I see now that it has a different hex code ₿.

I'll try to look for a font that supports the latest unicode characters and embed it with the build.

@dhimmel dhimmel added the frontend issues related to the HTML view and interactivity label Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend issues related to the HTML view and interactivity
Projects
None yet
Development

No branches or pull requests

3 participants