On Sunday, 31 December 2023 01:48:29 GMT Fernando via wrote:
> Greetings,
> 
> I am typesetting an old textbook on latin from Project
> Gutenberg which uses latin scripts such as an a with a
> macron which has u+0101. According to the Groff
> online documentation[1] and this stackexchange board[2],
> one can type unicode characters in the form of
> \[uxxxx]. So in this case, one could typset the
> lowercase a with macron with \[u0101]. This, however,
> did not print the character in the postscript document[3],
> and I can't tell if was in the troff dvi but I have
> uploaded the source here[4]. My next best guess was to
> check if the font supported such characters. Using
> ``
> fc-match -s -f '%{file}\n' ':charset=0101'
> ``
> I found that DejaVuSans and LinLibertine_R did support this
> character. I was able to double check this with this
> site that displays fonts that support that character[5].
> Perhaps my understanding of how to type unicode characters
> is incorrect. Or there is something wrong with the fonts I
> have tried (in which case, I would have no problem switching
> to another one). It is also possible that unicode characters
> are typeset differently in heirloom troff than in groff. I
> could not find anything that shows how to do unicode in
> heirloom troff so I just assumed it was the same as in
> groff. Any help would be appreciated.
> 
> [1]
> https://www.gnu.org/software/groff/manual/groff.html.node/Using-Symbols.htm
> l [2]
> https://unix.stackexchange.com/questions/648352/are-%E2%88%88-and-%E2%84%9D
> -symbols-available-in-eqn-roff [3] https://fortq.org/paste/unicode.ps
> [4] https://fortq.org/paste/unicode.ms
> [5] https://www.fileformat.info/info/unicode/char/0101/fontsupport.htm

The easiest way to include unicode characters into a groff document is to feed 
it a 
document written in UTF-8 and include the flag -k on the command line. This 
causes the 
preconv program to be run which converts the unicode characters to be converted 
to 
appropriate \[uXXXX] form.

For the document to be produced correctly you need suitable fonts available for 
groff with 
the unicode character glyphs you need. Since groff only type 1 postscript fonts 
you will 
need to convert the ttf or otf fonts to .pfa.

The easiest way to do this is with the install-font.sh script from Peter 
Schaffter's website 
for mom. [1].

The attached pdf illustrates a suitably amended version of your unicode.ms file 
run 
through groff. Note that I am using the git version built from the 
deri-gropdf-ng branch, 
but this should work fine with the current groff version except the pdf will be 
much larger 
and there is a limit on the number of unicode glyphs, which has been removed in 
my 
version.

Cheers 

Deri

[1] 
https://tkurtbond.github.io/posts/2021/07/17/install-fontsh-the-simple-approach/[1]

--------
[1] 
https://tkurtbond.github.io/posts/2021/07/17/install-fontsh-the-simple-approach/

Attachment: unicode.pdf
Description: Adobe PDF document

Reply via email to