// QINITFCODE.SR  overlay code

get "BRAVO.DF"
get "CHAR.DF"
get "GINN.DF"

// Incoming procedures

external
	[
	movec
	]

// Incoming statics

// Outgoing procedures

external
	[
	qinitfcode
	]

// Outgoing statics

external
	[
	rgfcode
	]

// Local statics

static
	[
	rgfcode
	]

let qinitfcode(alloc) be
[
rgfcode = alloc(128)
movec(rgfcode, rgfcode+127, -1)

qinitfcodebit($c, kquad, fquad, fcenter)
qinitfcodebit($j, kquad, fquad, fjust)

qinitfcodebit($b, klook, flook, fbold)
qinitfcodebit($i, klook, flook, fitalic)
qinitfcodebit($m, klook, flook, fmenu)
qinitfcodebit($s, klook, flook, fserif)
qinitfcodebit($u, klook, flook, ful)
qinitfcodebit($v, klook, flook, fvanish)
qinitfcodebit($x, klook, flook, fremark)

for i = $0 to $9 do
	[
	let p = 0
	p << FCODE.kind = kdigit
	p << FCODE.bitn = i-$0
	rgfcode !i = p
	]

(rgfcode + chcr) >> FCODE.kind = kcr

(rgfcode + $n) >>  FCODE.kind = knormal
(rgfcode + $n) >>  FCODE.un = 0
(rgfcode + $N) >>  FCODE.kind = knormal
(rgfcode + $N) >>  FCODE.un = 1

qinitfcodeword($d, fdent, 0)
qinitfcodeword($l, flmarg, 0)
qinitfcodeword($r, frmarg, 1)
]

and qinitfcodebit(char, kind, wordn, bitn) be
[
let p = 0
p << FCODE.kind = kind
p << FCODE.wordn = wordn
p << FCODE.bitn = bitn
rgfcode ! char = p
p << FCODE.un = 1
rgfcode ! (char-#40) = p
]

and qinitfcodeword(char, wordn, subtract) be
[
let p = 0
p << FCODE.kind = kmeasure
p << FCODE.wordn = wordn
p << FCODE.un = subtract
rgfcode ! char = p
]