Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jul 2011 16:25:55 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        "Julian H. Stacey" <jhs@berklix.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: groff && UTF-8
Message-ID:  <20110719142555.GA21970@sh4-5.1blu.de>
In-Reply-To: <201107191154.p6JBsTm9091796@fire.js.berklix.net>
References:  <20110718145901.GB71153@slackbox.erewhon.net> <201107191154.p6JBsTm9091796@fire.js.berklix.net>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
El día Tuesday, July 19, 2011 a las 01:54:29PM +0200, Julian H. Stacey escribió:

> > If you want to produce postscript output from groff, you will have to deal
> > with postscript fonts. The usual Type 1 fonts are single-byte fonts. Groff
> > only deals with Latin-1 characters (see groff_char(7)).

I have some FreeFonts for CUPS made by someone of the CUPS guru's which
support some of the European Codepoints; from CUPS'

/usr/local/share/cups/charsets/utf-8:

0000 00FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
0100 01FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
0200 02FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
0300 03FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
# Cyrillic:
0400 04FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
# Hebrew:
0590 05FF rtol single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
0600 06FF rtol single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
0980 09FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
1E00 1EFF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
1F00 1FFF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
2000 20FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
2300 23FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
2400 24FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique
2500 25FF ltor single FreeMono FreeMonoBold FreeMonoOblique FreeMonoBoldOblique

using these fonts directly in a Postscript file, I can address the glyphs
directly with their Codepoint in Postscript like <nnnn> and it works
like this:

%%EndResource
%%EndProlog
%%Page: 1 1

gsave

55.200 771.884 B

/cupsNormal findfont
12 scalefont
setfont
<00a1>S
<0051>S
<0075>S
<0065>S
<0020>S

/cupsBold findfont
12 scalefont
setfont
<0076>S
<0069>S
<0076>S
<0061>S
<0020>S
...

a shoot of the output is here:
http://www.unixarea.de/Sbizhubc28011071816200.pdf

i.e. it should be possible with a small script:

- scan the UTF-8 text+PCL file
- generate the above Postscript code
- switch to Bold/normal/scale when this is done by PCL sequence

still have to check what to do with OCR-B...

Thanks

	matthias

-- 
Matthias Apitz
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <guru@unixarea.de> - w http://www.unixarea.de/



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20110719142555.GA21970>