Article View: comp.lang.postscript
Article #3984Font question and possible ghostscript bug.
From: Frank Taylor
Date: Fri, 06 Nov 1992 14:33
Date: Fri, 06 Nov 1992 14:33
88 lines
3059 bytes
3059 bytes
Ok, I'm trying to print the character called odieresis (btw I don't
know all that much about PS programming). So after some digging around
I decide that I have to create a new font with a different encoding
vector.
First of all, is this the correct way to do it?
When, I wrote a small test program that was meant to do this and I
used ghostscript to check the results... I found that ghostscript and
my HP Laserjet III and PS cartridge differed in their output for the
following code:---
%!
% PS program to demonstrate what I think is a gs bug.
%
% I wanted to output the char odieresis and therefore created a new font based
% on Times-Roman but with a new encoding vector (having all slots paint
% an odieresis).
%
% The following is a test piece of code that should do this. The new font is
% called TR-Mine.
%
% The output of the program should be
%
% Hello$$$$$There
%
% Where Hello is larger than There and the $s are odieresis'.
%
% The Bug:
%
% If the base font for TR-Mine is the same as the font being used for text
% at the time of changing to the new font then gs does not do the change
% properly. The output I get is:
%
% HelloabcdeThere
%
% But if I change the base font to Helvetica (e.g.) then I get the correct
% output (with Helvetica odieresis').
%
% The code works as expected on an HP Laserject 3 (with PS cartridge).
%
% Note: I may be doing something wrong as I'm only a PS newbie!
% Create a copy of Times-Roman
/Times-Roman findfont dup length dict /myfont exch def
{1 index /FID ne
{myfont 3 1 roll put}
{pop pop}
ifelse
} forall
% Change the encoding to make a into odieresis.
/newencoding 256 array def
0 1 255 {newencoding exch /odieresis put} for
myfont /Encoding newencoding put
% Register changed font.
/TR-Mine myfont definefont pop
% Select normal text font.
/Times-Roman findfont 20 scalefont setfont
100 100 moveto
(Hello) show
% Use newly created font.
/TR-Mine findfont 20 scalefont setfont
(abcde) show
% And now use a different font.
/Times-Roman findfont 10 scalefont setfont
(There) show
showpage
%----------------- End of code ---------------------------------------
Is this a known bug with gs? Is this the correct way to get hold of such
a character?
Any help or guidance would be appreciated.
Thanks,
Frank.
| Frank Taylor -- FAST Project -- DoC -- Imperial College -- London |
|----------------------------------------------------------------------------|
| <fst@doc.ic.ac.uk> +44 (71) 589 5111 x5033 |
Technical Details
Message-ID:
<FST.92Nov6143317@cfast.doc.ic.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!news!fstShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!news!fst From: fst@doc.ic.ac.uk (Frank Taylor) Newsgroups: comp.lang.postscript Subject: Font question and possible ghostscript bug. Date: 6 Nov 92 14:33:17 Organization: Dept. of Computing, Imperial College. Lines: 88 Distribution: comp Message-ID: <FST.92Nov6143317@cfast.doc.ic.ac.uk> NNTP-Posting-Host: cfast.doc.ic.ac.uk