🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #7348

findfont.ps, new /Encoding in findfont

#7348
From: Poul-Henning Kamp
Date: Thu, 14 Jul 1988 14:43
65 lines
2309 bytes
In Denmark, and I suppose elsewhere, people use "funny" glyphs in their
texts. This is a little hack to put these glyphs in the default
/Encoding of all fonts.

As usual with my programs, it lacks comments.

You might recognize the example with scandinavian glyphs in "blue book",
as base of this. (Honour them, who honour fits.)

If you load it from outside the serverloop, you can make it permanent,
until power down-up.

On our P400PS (Agfa, and good) printer It's loaded at boottime from
the printers disk, together with ehandler etc.
START------------- findfont.ps ---------------------
%!
/#findfont /findfont load def

/findfont { 
    dup
    #findfont
    dup
    /Encoding get
    8#340 get /.notdef eq { 
        12 dict begin
        /newcodesandnames
        [
        8#340 /Aring	% put changes to encoding here
        8#360 /aring
        ] def
        /basefontdict exch def
        /newfontname exch def
        /newfont basefontdict maxlength dict def
        basefontdict {
            exch dup /FID ne {
                dup /Encoding eq {
                    exch 256 array copy
                    newfont 3 1 roll put
                } {
                    exch newfont 3 1 roll put
                }
                ifelse
            } {
                pop pop
            }
            ifelse
        } forall
        newfont /FontName newfontname put
        newcodesandnames aload pop
        newcodesandnames length 2 idiv {
            newfont /Encoding get 3 1 roll put
        }
        repeat
        newfontname newfont definefont
        end
    } { 
        exch pop
    } ifelse
} def
END--------------- findfont.ps ---------------------
-- 
Poul-Henning Kamp     I Kuwait Petroleum (Denmark) I Phone:  +45(0)2859333x523
phk@q8.dk             I Hummeltoftevej 49          I Private:+45(0)3531224
..!mcvax!diku!kpd!phk I DK-2830 Virum              I Fax:    +45(0)2851418
"Cave canem -- Beware, I might sing !"
Technical Details
Message-ID: <618@kpdc.kpd.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!mcvax!dkuug!kpd!phk

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!mcvax!dkuug!kpd!phk
From: phk@kpd.DK (Poul-Henning Kamp)
Newsgroups: comp.lang.postscript
Subject: findfont.ps, new /Encoding in findfont
Message-ID: <618@kpdc.kpd.UUCP>
Date: 14 Jul 88 14:43:20 GMT
Organization: Kuwait Petroleum (Denmark) A/S
Lines: 65