// RSilPressAux.bcpl
// Too much code generated in RSilPress.bcpl
get "sysdefs.d"
get "Sil.defs"
external
[
WSSB
]
external
[
@FontNames
@FontUsed
FontUsedTwo
FontSet // = 1 if le 4 fonts defined in user.cm
PressPass // = Number of passes needed to generate the font dir
CurrentPassNumber
]
let MarkFontUsed(slink) be
[
let line = slink>>item.line eq 1
let macro = slink>>item.macro eq 1
let textfont = slink>>item.font le 14
let S = textfont & not line & not macro
if S then SetFontUsedBit(slink>>item.fullfont)
]
and PutString(slink , st) be
[
// CurrentPassNumber = 0 ---> write everything
// CurrentPassNumber = 1 ---> write fonts le 15
// CurrentPassNumber = 2 ---> write fonts ge 16 & le 28
let line = slink>>item.line eq 1
let macro = slink>>item.macro eq 1
let font = slink>>item.font
let textfont = font le 14
let WritePass = false
if CurrentPassNumber eq 0 then WritePass = true
if (CurrentPassNumber eq 1) & (font le 7) then WritePass = true
if (CurrentPassNumber eq 2) & (font ge 8) then WritePass = true
let S = textfont & not line & not macro
if S & WritePass then WSSB(st,lv(slink>>item.string))
]
and SetFontUsedBit(xfnt) be
[
test xfnt le 15
ifso FontUsed = FontUsed % ( 1 lshift xfnt)
ifnot FontUsedTwo = FontUsedTwo % ( 1 lshift (xfnt - 16) )
]
// r270 font alignment and returns the number of font sets needed
and FontUtil(FontAlign) = valof
[
FontSet = 1
// Font Alignment for R270 fonts
let DefinedFonts = 0
for font = 0 to 6 do
[
let name = FontNames + 25*font
let siz = GetNum(name,0)
if siz ne 0 then DefinedFonts = DefinedFonts + 1
let triangle = StEq("triangles14",name,true)
let FontItem = FontOrientation!font
let Rotation = FontItem & #377
if Rotation eq 3 & not triangle then
[
FontAlign!font = 2
if siz ge 10 then FontAlign!font = 3
]
if Rotation eq 1 & not triangle then
[
FontAlign!font = 10
]
]
if DefinedFonts ge 5 then FontSet = 2
resultis FontSet// FontSet is 1 or 2
]
and WriteRemcm(Host,PressFile) be
[
let remcm = OpenFile("REM.CM",ksTypeReadWrite,1,0,fpRemCm,0,SilZone)
if remcm eq 0 then finish
let nc=0
until Endofs(remcm) do [ SpaceBase!nc=Gets(remcm); nc=nc+1 ]
Resets(remcm)
Wss(remcm,"Empress "); Wss(remcm,PressFile); Wss(remcm," ")
if ncopies ne 1 then [ Wns(remcm,ncopies𒿑); Wss(remcm,"/c ") ]
if Host!0 then [ Wss(remcm,Host) ]
Wss(remcm,"*n")
for i=0 to nc-1 do Puts(remcm, SpaceBase!i)
Closes(remcm)
]