in reply to Special characters and PostScript::Simple

Select a font that includes the ½ symbol, then include the PostScript escape code for that symbol (275 in the normal encoding). The escape codes are defined in the PostScript Language Reference Manual Appendix E

#!/usr/bin/perl use warnings; use strict; use PostScript::Simple; my $p = new PostScript::Simple(papersize => "A4", colour => 1, eps => 0, units => "in"); $p->setcolour("black"); $p->setfont("Times-Roman-iso", 20); $p->text(1,1, "Chee\275se"); $p->output("file.ps");

Incidentally, the code you provided was of little use – it doesn't run by itself, and the user is required to guess values for $line_height and $out_line. I'd never used PostScript::Simple before, and this didn't make a lot of sense straight away. Anyway, the question was interesting.

Cheers


davis
It wasn't easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.

Replies are listed 'Best First'.
Re^2: Special characters and PostScript::Simple
by PerlingTheUK (Hermit) on Aug 17, 2004 at 13:41 UTC
    Thanks that works great.

    The revolution of the world will not be stopped anytime soon!>