// sbepal.sr


get "BRAVO1.DF"
get "ALTOFILESYS.D"
get "FONT.DF"


// Incoming Procedures

external
[
stcopy
stnum
stappend
errhlta
]


// Incoming Statics

external
[
mpfunfd
]


// Outgoing Procedures

external
[
CreateSbEff
CreateSbAl
]


// Outgoing Statics

// external


// Local Statics

// static


// C R E A T E S B E F F

let CreateSbEff(sbDest, fun, fa) be
[
let fd = mpfunfd ! fun
let fdh = lv fd>>FD.fdh
test fun ge maxfun ifso
[
stcopy(sbDest, selecton fun into
[
case maxfun:
"HELVETICA10B.EP"
case maxfun+1:
"BORDER20.EP"
case maxfun+2:
"KEYHOLE20.EP"
default:
errhlta(180)
])
]
ifnot
[
stcopy(sbDest, lv fdh>>FDH.rvsbname)
let tsb = vec 5
stnum(tsb, fdh>>FDH.height)
stappend(sbDest, tsb)
if fa ne 0 then
[
stappend(sbDest, selecton fa into
[
case 1:"I"
case 2:"B"
case 3:"BI"
])
]
stappend(sbDest, ".EP")
]
]

// C R E A T E S B A L

and CreateSbAl(sbDest, fdd) be
[
stcopy(sbDest, lv fdd>>FDD.rvsbname)
let tsb = vec 5
stnum(tsb, fdd>>FDD.height)
stappend(sbDest, tsb)
stappend(sbDest, ".AL")
]