Orcpub / orcpub

Code for Dungeon Master's Vault Community Edition
https://www.dungeonmastersvault.com/
Eclipse Public License 2.0
212 stars 106 forks source link

Apostrophe's in print view have extra spacing #185

Open Rachayz opened 5 years ago

Rachayz commented 5 years ago

Describe the bug Whenever I go to print a character sheet, any apostrophe (item name, backstory, etc) is given extra spacing. Instead of looking like "can't" it will look like "can ' t"

To Reproduce Steps to reproduce the behavior:

  1. Create character
  2. Have an apostrophe in anything that will be printed (items, personality traits, etc)
  3. Go to print character
  4. Have weird spacing when viewing preview around apostrophes.

Expected behavior A normally spaced apostrophe.

Screenshots exampleapostrophe

Desktop (please complete the following information):

KingMob commented 5 years ago

Hi @Rachayz, thanks for submitting.

I have a couple questions.

  1. Did you originally copy and paste from a document program, like MS Word or Pages?
  2. Did you try printing from Firefox, and if so, did that have the same problem?

Those things things that look like regular apostrophes might actually be "smart" quotes, which don't travel well. In DMV, try deleting them in the text field, and re-typing with an apostrophe. (Unlike MS Word, the browser won't convert to smart quotes.)

My own character has some single quotes in the description, and I just confirmed that they print out correctly.

Rachayz commented 5 years ago

Hey @KingMob, thanks for getting in touch.

To answer your questions:

  1. The picture I provided was copy pasted from another PDF (on Chrome). I also tested typing it myself, and the issue seemed to be fixed, at least for the background. However other apostrophes still had the strange spacing such as: image This is from homebrew content, however I tried retyping the apostrophes and it made no difference.
  2. When testing in Firefox I did not see any strange spacing. I must assume it is something Chrome is doing then.

I am able to fix it by retyping every messed up apostrophe when in the PDF's preview before print, but I am not sure what causes it initially still.

Butterfly-Dragon commented 5 years ago

it only happens if you use "fancy quotes" usually coming from direct copies of a book or from word processors instead of good plain old ' which is the output of a normal text editor.

If you keep using a word processor which always adds the fancy quotes, as is the one i see you "retyped" obviously it will keep happening.

Use a text editor like notepad instead fo a word processor and it will stop happening.

It's actually very simple, search for all the common idiotic substitutions that the word processors do within all files and change them with the standard quotes.

KingMob commented 5 years ago

@Rachayz

  1. As @Butterfly-Dragon pointed out, try to avoid using word processors. By default, they will keep trying to use smart/fancy quotes.
  2. That being said, you'd think PDFs could handle those. There's a slightly different code path between Chrome and non-Chrome browsers to try to handle their PDF viewers from back in the day. I'm not sure it's still useful, but if the issue doesn't appear in the non-Chrome PDF, that's good to know.