Author Topic: unicode idea  (Read 3719 times)

vcxzet

  • Posts: 467
  • Turrets: +21/-13
unicode idea
« on: April 04, 2011, 01:02:48 am »
use utf-8 but input can be a problem
« Last Edit: April 20, 2011, 07:38:36 am by vcxzet »

Tremhelper

  • Posts: 76
  • Turrets: +12/-23
Re: unicode: random brain farts
« Reply #1 on: April 08, 2011, 10:23:44 pm »
step 0) realize that you can not load all unicode characters.
step 0) so pick "Basic Multilingual Plane"
step 1) also pick a few blocks you need from that plane
step 1) create extra images and font data files for those
step 2) create a clear text master font file
step 2) a line like "[block range start]-[block range end] [datafile]" for each block
step 2) load them at startup
step 3) use utf8 everywhere
step 4) remember that fonts use first 128 chars. you should increase that
step 4) (at least to 256 since most of the code blocks have ~256 chars)
step 5) detect non ascii in utf8 during drawing chars, convert to wide char
step 6) (actually you might convert the whole string to wide char)
step 6) find the unicode value of the char and use ranges to find the right datafile
step 7) use the corresponding datafile and draw it (as you'd draw a char with a different font)
step 8) how? convert utf8 char to int index. check ranges for index. pick the corresponding one
step 8) set new_index to index - [block range start]. this is the image index in the datafile

INPUT? -> problem? :/


???

Qrntz

  • Posts: 847
  • Turrets: +204/-12

You make up Qrntz, u always angry, just calmdown. :police:
I am stupid idiot who dares to open mouth and start debating

Nux

  • Posts: 1778
  • Turrets: +258/-69
Re: unicode: random brain farts
« Reply #3 on: April 08, 2011, 11:48:32 pm »
It looks like

"Basic Multilingual Plane"

isn't going to cut it.

vcxzet

  • Posts: 467
  • Turrets: +21/-13
Re: unicode: random brain farts
« Reply #4 on: April 09, 2011, 12:25:49 am »
you choose only a few blocks from that plane
« Last Edit: April 20, 2011, 07:37:08 am by vcxzet »