How do I use special characters in my string? Ex: "α" I can use lowercase and uppercase, but I don't know how to use the greek characters that can be accessed normally through a TI basic program. Thanks.
Also, Do you guys know what the max X and max Y values for the coordinate system?
If youโ€™re programming for the CE, the screen is 320 x 240 px. You can also use the LCD_WIDTH and LCD_HEIGHT defines if youโ€™d prefer, which is probably cleaner.
Yolomep wrote:
How do I use special characters in my string? Ex: "α" I can use lowercase and uppercase, but I don't know how to use the greek characters that can be accessed normally through a TI basic program. Thanks.


I think if you want to use a special character, your best bet is to create your own font with fontlibc.
Yolomep wrote:
How do I use special characters in my string? Ex: "α" I can use lowercase and uppercase, but I don't know how to use the greek characters that can be accessed normally through a TI basic program. Thanks.


Do you mean on the homescreen, or using graphx? If you mean on the homescreen, I believe you can just print the string "\xBB" to display the "α" character. For other characters, you can replace the "BB" with the relevant character code from this table.

In graphx, the font doesn't contain a symbol for the "α" character. If you want to display it you'll have to change the way a symbol that you currently aren't using (the ones with values less than 32 work well for this) looks by using gfx_SetCharData and then using that character in place of "α".
commandblockguy wrote:
Yolomep wrote:
How do I use special characters in my string? Ex: "α" I can use lowercase and uppercase, but I don't know how to use the greek characters that can be accessed normally through a TI basic program. Thanks.


Do you mean on the homescreen, or using graphx? If you mean on the homescreen, I believe you can just print the string "\xBB" to display the "α" character. For other characters, you can replace the "BB" with the relevant character code from this table.

In graphx, the font doesn't contain a symbol for the "α" character. If you want to display it you'll have to change the way a symbol that you currently aren't using (the ones with values less than 32 work well for this) looks by using gfx_SetCharData and then using that character in place of "α".


Wait do you mean using something like gfx_SetCharData(3, "α")? How do I get the pointer to the 8x8 font? Do I use fontlib?
The character data tells the calculator which pixels to turn on. The 8x8 font is just an 8-byte bitmap of pixels. You can generate it with https://www.min.at/prinz/o/software/pixelfont/#download, and then load it like this, using the numbers it generates in place of the example ones:

Code:
uint8_t char_data = {0x00, 0x18, 0x24, 0x24, 0x3C, 0x24, 0x24, 0x00}; // Bitmap for "A"
gfx_SetCharData(3, char_data);
gfx_PrintChar(3);


Fontlib is another option, and it works entirely separately from graphx text - I'd recommend reading the docs for it.
Hum... So how would you use it in a string? Is it hexcode e.g. if I set it to 3 it would be x03? I'll test it later if you guys don't reply.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement