Support regarding input of unicode chars

2023-11-08 Thread Gustavo Calvo
Hi! Is there a way to use character U+2112 in my document? So far I have tried 
`\[u2112]`, which does seem to work for characters like `\[u0394]` that are 
listed in the groff_char manual.



Re: Support regarding input of unicode chars

2023-11-08 Thread G. Branden Robinson
Hi Gustavo,

At 2023-11-08T07:29:49+, Gustavo Calvo wrote:
> Hi! Is there a way to use character U+2112 in my document? So far I
> have tried `\[u2112]`, which does seem to work for characters like
> `\[u0394]` that are listed in the groff_char manual.

Sure.  There are a couple of approaches.

One is to use groff's special character escape sequences as you showed
above.

Like this:

$ cat ATTIC/2112a.groff
They've taken care of everything!
.rj
\[em] \[u2112]\[u2112]\[u2118]
.pl \n[nl]u
$ nroff ATTIC/2112a.groff

Another approach is to put UTF-8 in your source document, and then use
the '-k' option to nroff or groff to run preconv(1).

$ cat ATTIC/2112b.groff
They've taken care of everything!
.rj
— ℒℒ℘
.pl \n[nl]u
$ nroff -k ATTIC/2112b.groff

In either case you get the same output.

--snip---
They’ve taken care of everything!
— ℒℒ℘
--end snip---

Does this work for you?  Is there anything else we can help with?

Regards,
Branden


signature.asc
Description: PGP signature


Re: Support regarding input of unicode chars

2023-11-08 Thread Deri
On Wednesday, 8 November 2023 07:29:49 GMT Gustavo Calvo wrote:
> Hi! Is there a way to use character U+2112 in my document? So far I have
> tried `\[u2112]`, which does seem to work for characters like `\[u0394]`
> that are listed in the groff_char manual.

Hi Gustavo,

If you are going for terminal output, Branden has dealt with that. If you want 
PDF or Postscript output, I'm afraid you will have to do a bit of work. The 
problem is that the "Laplace transform" (U+2112) character is not present in 
groff's symbol font, so you need to install a suitable font to supply the 
glyph.

On my system I found the glyph in a font:-

/usr/share/fonts/opensymbol/opens___.ttf

Since it is a truetype font I had to convert it to a type 1 font with 
fontforge and then run afmtodit to create a groff font file called OS. You may 
be able to use the install-font.sh script available at:-

http://www.schaffter.ca/mom/mom-06.html

Although the font should be installed as a symbol font rather than a text font 
and I'm not sure if the script handles that yet.

After installation this works:-

printf ".special OS\n\s'24'ℒ"|groff -k -ms -Tpdf > Laplace.pdf

The result is attached.

If you prefer I can send you the resulting fonts, plus instructions.

Cheers 

Deri



Laplace.pdf
Description: Adobe PDF document