home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
r
/
riscript
/
!RiScript
/
Fonts
/
Procedures
< prev
next >
Wrap
Text File
|
1994-06-24
|
1KB
|
54 lines
%
% RiScript font procedure definitions (30/10/93)
%
% --- Define decoding dictionary from encoding vector
% usage: <encoding> .decode
/.decode {
256 dict dup
begin
0 1 255 {dup 3 index exch get exch def} for
/.notdef currentdict /space get def
end
} def
% --- Define RISC OS (type 4) font
% usage: <RiScipt font> <RISC OS font> <Encoding> <Decoding> type4font
/type4font {
<< /Decoding 3 -1 roll
/Encoding 5 -1 roll
/RiscOsFont 7 -1 roll
/FontName 1 index
/FontType 4
/FontMatrix [ 1 640 div 0 0 1 640 div 0 0 ]
/FontBBox [ 0 0 0 0 ]
/FID null
>> definefont pop
} def
% --- Map fonts
% usage: <new name> <old name> <encoding> mapfont
/mapfont {
exch findfont dup length dict begin
{1 index /FID ne {def} {pop pop} ifelse} forall
/Encoding exch def
currentdict end
definefont pop
} def
% --- Load font
% usage: <name> loadfont
% post: true if loading succeeded
% false if loading failed
/loadfont {
/FontFiles dup where
{ exch get }
{ (RiScript:Fonts.FontFiles) run load } ifelse
dup 2 index known
{ 1 index get (\(Loading ‘) print dup =
(’ for ‘) print 1 index =
(’\)\n) print flush run}
{ exch pop } ifelse
FontDirectory exch known
} def