n-t-roff / heirloom-doctools

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

Not Functioning: .fd Specifies %20 as Escape Code for Space #30

Closed jacobp100 closed 8 years ago

jacobp100 commented 8 years ago

Tested on OS X El Capitan only.

Works:

.fp 10 R Roboto-Medium ttf

Doesn’t work (Open Sans.ttf exists in same directory as Roboto-Medium.ttf)

.fp 10 R Open%20Sans ttf
n-t-roff commented 8 years ago

Thank you for reporting this. According to the source code this seems to be not implemended. It is usual for roff to quote with " in this case, e.g.:

.fp 10 R "Open Sans" ttf

I have no idea why Gunnar had choosen such a unusual escape method (yes, it is used in URLs--for good reason there). My suggestion is to change the specification and implement quoting with ".

n-t-roff commented 8 years ago

That is interesting--it does not work for me. It seems that there is still work to do (there is nothing in the source code which skips the " so it reads the font name "Open which can't be found of course). So I'm going to implement quoting with " and change the specification.

BTW: Is it really a good idea to mount to position 10? I suggest to mount to position 0 (then automatically the next free position is used, usually 11) and name it not R but e.g. OS and make a font change with .ft OS. Alternatively mount it to the R font position 1. (But R (roman) is usually not a sans serif font.)

jacobp100 commented 8 years ago

Sorry, I was mistaken: it didn’t work for me either.

Thanks for the tips with the mounting positions—I didn’t really get it. Does the number actually mean anything?

n-t-roff commented 8 years ago

It should work now when xflag is set.

I suggest to use

.fp 0 OSANS "Open Sans" ttf
.ft OSANS

For every font to mount position 0 can be used which means that troff chooses the next free position. Font position of R is 1. If you really want to replace R you should use this font position. But I see no advantages in replacing R (except that \fR is faster to type than \f[OSANS]).

n-t-roff commented 8 years ago

Closing solved issue.