n-t-roff / heirloom-doctools

The Heirloom Documentation Tools: troff, nroff, and related utilities
http://n-t-roff.github.io/heirloom/doctools.html
Other
127 stars 23 forks source link

Constant-width fonts are messed up if paragraph crosses page boundaries #78

Closed ljrk0 closed 5 years ago

ljrk0 commented 5 years ago

Edit: Nevermind, after hours of debugging: It was just a typo, my bad.

It was a bug after all...


I've observed the behavior that if one paragraph crosses the boundary of a page, selecting the constant-width fonts is not working correctly. Here's a test file: test.pdf, it only contains the line

foo \f(CRbar(1)\fP

all over again.

To show the difference between one line on the first page and one on the second, I made to screenshots: first page second page

Setting .do xflag 3 does not change the behavior.

I'm running latest git (6fa0ad8) heirloom troff on Arch using:

$ /usr/heirloom/bin/ucb/troff -Tpost test.roff | /usr/heirloom/bin/ucb/dpost | ps2pdf - test.pdf

Thanks for this awesome work though!

n-t-roff commented 5 years ago

Thank you for reporting, the latest commit should fix it.

ljrk0 commented 5 years ago

However with \fCW I didn't have any issues in the first place for some reason. Or perhaps a paragraph just moved in a way that it looked like it, I thought the issue was on my side.

n-t-roff commented 5 years ago

Sorry, the commit message went wrong, I did use @Leonard instead of @LeonardKoenig ... Not easy to fix since commit is pushed already...

It does work for CW since no font name mapping needs to be applied for CW (it is the original name), but CR needs to be mapped to CW... This had been done at document start but not after a page break.

Alhadis commented 5 years ago

Not easy to fix since commit is pushed already...

It's not too late to force-push an amended commit, is it?

$ git commit --amend
…
$ git push origin master --force
ljrk0 commented 5 years ago

Ah, that makes sense, thanks for explaining!

No problem, perhaps the other guy might wonder why they get notified, though. Rewriting something officially pushed is not so good, but it's not that late, but don't bother for me.

n-t-roff commented 5 years ago

@Alhadis thank you, applied.