[comp.lang.postscript] Composite accented characters

bcockburn@acorn.co.uk (Bruce Cockburn) (03/20/91)

Hello PScripters,

  Does anyone know how to add accented characters to a font that doesn't
have the ones that you want like "uring" or is this not possible?

  Thanks in advance.

  Bruce.

mzellers@starnet.uucp (Mark Zellers) (03/26/91)

In article <5916@acorn.co.uk> bcockburn@acorn.co.uk (Bruce Cockburn) writes:
>
>  Does anyone know how to add accented characters to a font that doesn't
>have the ones that you want like "uring" or is this not possible?
>
If you are looking for characters such as a-umlaut, e-grave, etc, they
actually already exist in the standard PostScript fonts.  They are not,
however *encoded* which means that there is no character you can send to
the printer and get the accented characters printed without doing some
fiddling.

The prefered method is explained in the PostScript Tutorial and Cookbook
under the heading "Re-Encoding an Existing Font" or some such.  The idea
is to produce a new encoding vector which maps an ordinal character
number to the name of the character you want.  The characters and their
names are listed in the PostScript Language Reference manual (Red Book).
Many of the more modern printers have a pre-defined encoding vector
called ISOLatin1 available which is very close to the Dec Multinational
character set.

Once the encoding vector is defined, you create a new font dictionary
and copy everything in the base font dictionary except the encoding
vector and the unique id fields.  Then you register the new dictionary
as a font and can use it from there.  It is not as hard as it sounds,
especially when they give you the code to copy.  It is too bad however
that they did not make the re-encoding a standard part of the language
so that everyone didn't have to learn this little rain dance.

Mark H. Zellers
marc.com!bwayne!mark

maguire@cs.columbia.edu (Gerald Q. Maguire) (03/26/91)

Sample of using the encode from Scribe to provide the same 8 bit
characters as a HP terminal in Roman8 mode.
Enjoy,
Chip


@Use(Database="/u/cs/maguire/scribe")
@make(article)
@device(postscript)
@style(fontfamily="QTimesRoman8")
@style(stringmax 50000)

@style(DeviceInitialization=
<% the followin procedure is from Adobe_distill 1.0

 /REMAP { %def
   FontDirectory 2 index known { pop pop pop } { %ifelse
     findfont begin currentdict dup length dict begin
       { 1 index /FID ne {def}{pop pop} ifelse } forall
       exch dup length 0 gt { /Encoding exch def }{ pop } ifelse
     currentdict end end definefont pop
   } ifelse
 }  def

/appencoding
[
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
  /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quotesingle
  /parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
  /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon
  /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N
  /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright
  /asciicircum/underscore/grave/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o
  /p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde/.notdef
  /fraction /quotesingle /quotedblleft /guilsinglleft /guilsinglright
  /fi /endash /dagger
  /daggerdbl /periodcentered /quotesinglbase /quotedblbase
  /quotedblright /ellipsis /perthousand /breve
  /dotaccent /dieresis /cedilla /hungarumlaut /ogonek /caron /Lslash /OE
  /dotlessi /lslash /oe /Ecircumflex /Edieresis /Egrave /Eth
  /Icircumflex
  /Idieresis /Agrave /Acircumflex /Egrave /Ecircumflex /Edieresis
  /Icircumflex /Idieresis
  /acute /grave /circumflex /dieresis /tilde /Ugrave /Ucircumflex /fl
  /macron /Yacute /yacute /ring /Ccedilla /ccedilla /Ntilde /ntilde
  /exclamdown /questiondown /currency /sterling /yen /section /florin
  /cent
  /acircumflex /ecircumflex /ocircumflex /ucircumflex /aacute /eacute
  /oacute /uacute
  /agrave /egrave /ograve /ugrave /adieresis /edieresis /odieresis
  /udieresis
  /Aring /icircumflex /Oslash /AE /aring /iacute /oslash /ae
  /Adieresis /igrave /Odieresis /Udieresis /Eacute /idieresis
  /germandbls /Ocircumflex
  /Aacute /Atilde /atilde /Zcaron /zcaron /Iacute /Igrave /Oacute
  /Ograve /Otilde /otilde /Scaron /scaron /Uacute /Ydieresis /ydieresis
  /Thorn /thorn /bullet /mu /paragraph /threequarters /emdash
  /onequarter
  /onehalf /ordfeminine /ordmasculine /guillemotleft /brokenbar
  /guillemotright /plusminus /eth
] def

appencoding /Times-Roman8 /Times-Roman REMAP

% PostScript Prelude for Scribe.
...
%%EndProlog
>)

Print all the printing characters from the QTimesRoman8 font:





@begin(format)
 !"#$%&'()*+,-./0123456789:;<=>?
@@
ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`
abcdefghijklmnopqrstuvwxyz{|}~


????????????????

????????????????

????????????????

????????????????

????????????????

????????????????

????????????????

????????????????
@end(format)

@heading(Roman 8 characters and HP keyboard)

@begin(format)
?  8#200 /fraction	%% scribe 164
?  8#201 /quotesingle	%% scribe 169
?  8#202 /quotedblleft	%% scribe 170
?  8#203 /guilsinglleft  %% scribe 172
?  8#204 /guilsinglright %% scribe 173
?  8#205 /fi		%% scribe 174
?  8#206 /endash		%% scribe 177
?  8#207 /dagger		%% scribe 178

?  8#210 /daggerdbl	%% scribe 179
?  8#211 /periodcentered %% scribe 180
?  8#212 /quotesinglbase %% scribe 184
?  8#213 /quotedblbase   %% scribe 185
?  8#214 /quotedblright  %% scribe 186
?  8#215 /ellipsis	%% scribe 188
?  8#216 /perthousand	%% scribe 189
?  8#217 /breve		%% scribe 198

? 8#220 /dotaccent	%% scribe 199
?  8#221 /dieresis	%% scribe 200
?  8#222 /cedilla	%% scribe 203
?  8#223 /hungarumlaut	%% scribe 205
?  8#224 /ogonek		%% scribe 206
?  8#225 /caron		%% scribe 207
?  8#226 /Lslash		%% scribe 232
?  8#227 /OE		%% scribe 234

?  8#230 /dotlessi	%% scribe 245
?  8#231 /lslash		%% scribe 248
?  8#232 /oe		%% scribe 250
?  8#233 /Ecircumflex	%% unassigned
?  8#234 /Edieresis	%% unassigned
?  8#235 /Egrave		%% unassigned
?  8#236 /Eth		%% unassigned
?  8#237 /Icircumflex	%% unassigned

?  8#240 /Idieresis	%% unassigned
?    8#241 /Agrave
?    8#242 /Acircumflex
?    8#243 /Egrave
?    8#244 /Ecircumflex
?    8#245 /Edieresis
?    8#246 /Icircumflex
?    8#247 /Idieresis

?    8#250 /acute
?    8#251	/grave
?    8#252 /circumflex
?    8#253 /dieresis
?    8#254 /tilde
?    8#255 /Ugrave
?    8#256 /Ucircumflex
?    8#257 /fl  % /ItalianLira %%% missing from Postscript use fl

?    8#260 /macron
?    8#261 /Yacute
?    8#262 /yacute
?    8#263 /ring
?    8#264 /Ccedilla
?    8#265 /ccedilla
?    8#266 /Ntilde
?    8#267 /ntilde

?    8#270 /exclamdown
?    8#271	/questiondown
?    8#272 /currency
?    8#273 /sterling
?    8#274 /yen
?    8#275 /section
?    8#276 /florin
?    8#277 /cent

?    8#300 /acircumflex
?    8#301	/ecircumflex
?    8#302 /ocircumflex
?    8#303 /ucircumflex
?    8#304 /aacute
?    8#305 /eacute
?    8#306 /oacute
?    8#307 /uacute

?    8#310 /agrave
?    8#311	/egrave
?    8#312 /ograve
?    8#313 /ugrave
?    8#314 /adieresis
?    8#315 /edieresis
?    8#316 /odieresis
?    8#317 /udieresis

?    8#320 /Aring
?    8#321 /icircumflex
?    8#322 /Oslash
?    8#323 /AE
?    8#324 /aring
?    8#325 /iacute
?    8#326 /oslash
?    8#327 /ae

?    8#330 /Adieresis
?    8#331 /igrave
?    8#332 /Odieresis
?    8#333 /Udieresis
?    8#334 /Eacute
?    8#335 /idieresis
?    8#336 /germandbls
?    8#337 /Ocircumflex

?    8#340 /Aacute
?    8#341 /Atilde
?    8#342 /atilde
?    8#343 /Zcaron % /Dstroke %%% missing from Postscript use Zcaron
?    8#344 /zcaron % /dstroke %%% missing from Postscript use zcaron
?    8#345 /Iacute
?    8#346 /Igrave
?    8#347 /Oacute

?    8#350 /Ograve
?    8#351	/Otilde
?    8#352 /otilde
?    8#353 /Scaron
?    8#354 /scaron
?    8#355 /Uacute
?    8#356 /Ydieresis
?    8#357 /ydieresis

?    8#360 /Thorn
?    8#361 /thorn
?    8#362 /bullet
?    8#363 /mu
?    8#364 /paragraph
?    8#365 /threequarters % /IO %%% missing from Postscript use 3/4
?    8#366 /emdash
?    8#367 /onequarter

?    8#370 /onehalf
?    8#371	/ordfeminine
?    8#372 /ordmasculine
?    8#373 /guillemotleft
?    8#374 /brokenbar % /solidbox  %%% missing from Postscript use brokenbar
?     8#375 /guillemotright
?    8#376 /plusminus
?    8#377 /eth %%% use "eth" as the symbol in the 16#FF slot
@end(format)