#module \
Char

#const CHAR_WIDTH	32
#const UNKNOWN		52

#defcfunc local \
New \
		str	p_text
	If insNum <= 0 {
		NoteSel charDict
			NoteLoad "dict.dat"
		NoteUnsel
	}

	text.insNum = p_text

	posX.insNum = gInfo_cX
	posY.insNum = gInfo_cY
	size.insNum = CHAR_WIDTH

	exists.insNum = True

	insNum++

	Return insNum - 1

#deffunc local \
Destroy \
		int	p_insId
	exists.insNum = False

	Return

#deffunc local \
Draw \
		local	cnt_,\
		local	found,\
		local	zoom
	Repeat insNum
		If exists.cnt {
			cnt_ = cnt

			NoteSel charDict
				Repeat StrLen (text.cnt_) / 3
					Pos posX.cnt_ + cnt * size.cnt_, posY.cnt_

					found = NoteFind (StrMid (text.cnt_, cnt * 3, 3))

					If found = -1 {
						found = UNKNOWN
					}

					zoom = Double (size.cnt_) / CHAR_WIDTH
					CelPut BUFFER_CHAR, found, zoom, zoom
				Loop
			NoteUnsel
		}
	Loop

	Return

#global

