Compile to PDF Font Hinting Distortions

User avatar
narrsd
Posts: 653
Joined: Wed Sep 22, 2010 8:34 pm
Platform: Win + iOS

Wed Sep 18, 2019 5:54 am Post

I decided to have a quick look here, rwfranz, because you noted on the other report that you didn't see it yourself, though it's clearly happening for kej2u.

I found out how to replicate it, and I found out something bad which is also a bug in current compile.

Trying a number of combinations, here's what dropped out:
  1. with single spacing of the Scriv document, I didn't see the font splitting, on a couple of files
  2. but after tryiing a number of combinations, I did replicate
  3. If, like both reports, you set _double_ (2.0) line spacing on the document, bingo: the splitting occurs
  4. I tested and found the splitting on both Compile to PDF and Compile to Print -> normal Microsoft PDF printer
  5. This last test turned up another big problem with Compile in its present state.
  6. The extra problem is a serious interaction with Font Hinting setting, as for our improved screens
    1. on Compile to Print -> Microsoft PDF printer, this problem is not observed
    2. But on Compile to PDF, with Font Hinting unchecked and Scrivener necessarily restarted, big distortion
    3. The font in the PDF is distorted to become larger than it should be,, perhaps mainly in height
    4. It's also become far too heavy, like a mis-calibrated Bold
    5. The font has lost its proper kerning, so that letters are too close together and overlap
    6. If you return Font Hinting to checked and restart Scrivener, then these PDF distortions don't occur

So I would say that two problems should be Listed. That would be the original font-splitting issue, now that we know how to repeat it, and this new issue with Font Hinting and Compile to PDF.

Given the improvement in screen clarity with Font Hinting unset, plus this Compile to PDF issue when it is set, I'd like to suggest that defaulting it to be unset for editors, but forcing it behind the scenes to be set duriing Compile to PDF action would be a quite reasonable solution to speed getting through this period and getting out the release.

Persons who preferred the spindlier screen appearance with Font Hinting set could simply check the box in their own options, for now. All the deeper issues could be postponed for a relaxed post-release exploration -- or Qt fix , etc..

Best I would think of, anyway...

th
thePhilosoraptor
Posts: 1156
Joined: Sat Feb 13, 2016 3:28 am
Platform: Windows

Wed Sep 18, 2019 9:28 pm Post

Hi Clive,

As this contains a separate bug from the one filed in the other thread, I've split it off for it's own topic.

I was not able to replicate this using just the information provided, could you tell me what fonts/compile formats are causing this distortion for you? Or possibly send a small sample project showing the issue?

Thank you for your help with this.
Bryan Bender

User avatar
narrsd
Posts: 653
Joined: Wed Sep 22, 2010 8:34 pm
Platform: Win + iOS

Wed Sep 18, 2019 10:48 pm Post

Ok, I've made such a project, attached as a zip.

You'll note there are four small documents, showing what happens with different fonts.

I've also included Scriv compile-to-PDF results with and without Font hinting checkmarked in Options|Editing

With Font hinting unchecked, we get the great accurate screen appearance, but in compile output, it's not good:
- the most dramatic is with (Adobe) Minion Pro, which you may have
- less dramatic, but same in qualities with Times Roman, which I'm sure you have
- still existing but more subtle, with Calibri
- of interest, Minion Pro Bold appearance with the issue looks identical to Minion Pro

With Font hinting checked, then screen appearance is spindly etc., but compile output is accurate.

This is why I suggest that to get the release out, a sensible fix would be:
- default Font hinting to unchecked, in Options|Editing, to get the screen to be good
- programatically turn it on regardless of Options setting, when compiling, then return to whatever Options determines
- this is easy and should be solid
- the person who doesn't like full font appearance on screen can just check Font hinting
- this leaves actually investigating/getting a fix out of Qt/etc. to be done over a comfortable, relaxed time

You've seen the justification for the better-screen setting, and below is justification for fully handling the issues. It's from the Minion font printing example, and for anyone shocked, it's not so severe for Times Roman, less even for Calibri, but you still wouldn't want it.

Best on this, Bryan, greetings to Tiho and Lee also,
Clive

serif-minion-demo-pdf-compile-hinting-off.png
serif-minion-demo-pdf-compile-hinting-off.png (86.62 KiB) Viewed 139 times
Attachments
hinting-compile-issue.zip
(164.16 KiB) Downloaded 5 times

rw
rwfranz
Posts: 731
Joined: Thu May 28, 2015 9:41 pm
Platform: Windows

Thu Sep 19, 2019 9:22 am Post

thePhilosoraptor wrote:I was not able to replicate this using just the information provided, could you tell me what fonts/compile formats are causing this distortion for you? Or possibly send a small sample project showing the issue?


It's fairly visible in Times New Roman (the letters get really crowded).

FontCrowding2_HintingOn.JPG
FontCrowding2_HintingOn.JPG (58.65 KiB) Viewed 113 times


FontCrowding2_HintingOff.JPG
FontCrowding2_HintingOff.JPG (61.04 KiB) Viewed 113 times


This is in compile to PDF (not to print using print to PDF), Manuscript (times).

It looks to me as though the fonts are larger with hinting off, but the spacing is the same as with hinting on. It's a bit strange (font hinting shouldn't change type size).

(text is from a random text generator I found on the 'Net)

rw
rwfranz
Posts: 731
Joined: Thu May 28, 2015 9:41 pm
Platform: Windows

Thu Sep 19, 2019 9:23 am Post

As I mentioned, it's also visible in Noto Serif, but it's harder to see.

Hinting on:
FontCrowding_HintingOn.JPG
FontCrowding_HintingOn.JPG (64.18 KiB) Viewed 113 times


And off:
FontCrowding_HintingOff.JPG
FontCrowding_HintingOff.JPG (60.03 KiB) Viewed 113 times