Text in Latin 1 Format

BlitzMax Forums/BlitzMax Programming/Text in Latin 1 Format

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I don't know about Latin 1 per se (<- OMG, Latin! <g>), but you can store Unicode within a BMax program via DefData (and maybe(?) strings with the recent Unicode upgrades, but definately with DefData if nothing else):
' adapted from neilo's Arabic version

Strict
Graphics 640,480

' Local font:TImageFont = LoadImageFont("c:\windows\fonts\cour.ttf",24) ' original, Arabic example
Local font:TImageFont = LoadImageFont("c:\windows\fonts\msgothic.ttf",24) ' for Japanese
SetImageFont font

Local text$ = ""
Local unicode:Short[8]
Local nextChar:Short

For Local i = 0 To 2 ' 6 To 0 Step -1 ' <- reverse order for Arabic
	ReadData nextChar
	unicode[i]=nextChar
Next

text$=string.FromShorts(unicode,7)

While Not KeyHit(KEY_ESCAPE)
	Cls
	DrawText text$,10,10
	Flip
Wend

' "Yamato" in katakana
DefData $30e4, $30de, $30c8

' A line of Arabic text
' DefData $0625,$0646,$0643,$0644,$064a,$0632,$064a