showing special characters

General discussion on Visual TFT Software.
Author
Message
Niceday
Posts: 61
Joined: 02 Jul 2012 09:34

showing special characters

#1 Post by Niceday » 22 Jul 2013 07:59

Hi all,

I'm using VTFT in connection with mikroC for ARM. Now I want to show some language specific characters like the german 'ü'. In the used font Tahoma this character has the code x00FC. According to this post http://www.mikroe.com/forum/viewtopic.p ... ic#p216383 this character should be displayed correctly. And in VTFT this character is displayed like expected. But if I start the compiled program, the display dont show the character. How could I get these characters on the TFT?
Any help would be appreciated.

Best regards
Niceday

JohnGB
Posts: 183
Joined: 17 Feb 2013 18:59

Re: showing special characters

#2 Post by JohnGB » 22 Jul 2013 10:58

When you want to access characters beyond 127 I think you need to re-import the required font into the resources with the character range adjusted to include the desired character. You will also need to adjust the end char property in the component being displayed.
JohnB
MikroPascal for PIC18 and DsPIC, Visual TFT

Niceday
Posts: 61
Joined: 02 Jul 2012 09:34

Re: showing special characters

#3 Post by Niceday » 22 Jul 2013 12:22

Hi John,

thanks for the quick reply.
Your hint solved the issue. Many thanks!

Best regards
Niceday

markusjo
Posts: 16
Joined: 22 Jul 2013 21:38

Re: showing special characters

#4 Post by markusjo » 05 Aug 2013 20:12

Hello,

i have the same problem with special character above character 127, but the solution above didn't help me. I have importet the Tahoma font in the resource collection with the character range set to 255 and the 'End Char' of the EVEText was set to 255. I used the 'Ö' character for testing ( char number 214) and all looks good in VTFT but after programming there was a 'V' (char number 86) on the screen. It seams there is a roll over after char number 127 and the char count start from the beginning. But i don't know how to solve this problem.

Can anybody help me?

I'm using VTFT v3.7.0 with mikroC Pro for AVR on a ATXMEGA128A1
Attachments
screen.png
screen.png (187.68 KiB) Viewed 7151 times

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: showing special characters

#5 Post by marina.petrovic » 07 Aug 2013 10:47

Hi,

I believe that I already answered you on the Support Desk.

Best regards,
Marina

anders_col
Posts: 19
Joined: 14 Jan 2013 11:03

Re: showing special characters

#6 Post by anders_col » 28 Oct 2013 10:20

Hello!

It works well to change character range to generate fonts which includes å, ä, ö, ü and others :)

*** EDIT ***

It works sometimes with small ö and ü, but often it only works with capital Ö and Ü. And when generating larger fonts (for ex. Tahoma or Calibri fontsize 22, range 32-255) many characters in the strings get scrambled, not only å, ä, ö, ü. I need help to figure this one out...anyone?

However, I need to use Chinese in my GUI. When trying to paste a Chinese character into mikroC PRO for dsPIC (in a char array in the code), it directly switches to a '?'. Just by pasting it in there I mean.

What would I need to do to make Chinese characters work in my program? I probably will have to edit the character range, but no idea about min/max there..? Sorry if I'm missing something obvious.. Thanks in advance!

Best regards, Anders

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: showing special characters

#7 Post by marina.petrovic » 29 Oct 2013 13:25

Hi,

Please, take a look at this forum topic:
http://www.mikroe.com/forum/viewtopic.php?f=160&t=56146

and project on LibStock:
http://www.libstock.com/projects/view/7 ... nt-library

There you can find explanation how to use non-ASCII characters in Visual TFT.

Best regards,
Marina

anders_col
Posts: 19
Joined: 14 Jan 2013 11:03

Re: showing special characters

#8 Post by anders_col » 29 Oct 2013 15:27

Thank you!

But that doesn't really answer my question about using Chinese characters (my mcu is dsPIC33EP) ?? I know how to, at least I think so, generate fonts with a specific character range etc. I'm doing the following in CP Font Generator:

- setting the range to 32-255 (makes whole character matrix green)
- setting code page to (1250) Central Europe (also tried Latin I, same result)
- setting font to Tahoma regular 16, script Western
- setting output format to Microchip AN1882+

My Windows 7 system locale setting is Swedish (Sweden). Are the above settings incorrect perhaps..?

When I try to use strings which includes å, ä, ö and even ü, that part of the text get scrambled?? And when change font size in CP Font Generator to 10 (and smaller) instead, all characters show up OK. Is this strange or expected result? I need some help here, please... Both regarding Chinese characters and the above problem...thanks!

Best regards, Anders


*** EDIT ***

Now I successfully can use the larger font size 16 (Tahoma), generated for Central Europe. To do this I had to unselect characters (from the green matrix) which I don't need anyway, to reduce the generated size. Now å, ä, ö, ü always look correct in my GUI. So, one problem solved... :)

I still need help though with the Chinese characters. Anyone?

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: showing special characters

#9 Post by marina.petrovic » 30 Oct 2013 17:02

Hi,

Visual TFT currently, doesn't supports Chinese language,
you can try to use application that aCkO posted from the link that I send you earlier.

Pay attention, CP Font Generator supported the following languages:
Central Europe, Cyrillic, Latin I, Greek, Turkish, Hebrew, Arabic, Baltic, Vietnam and Thai.

Did you changed default system code page (system locale) in Windows Control Panel (to use Chinese)?

Best regards,
Marina

anders_col
Posts: 19
Joined: 14 Jan 2013 11:03

Re: showing special characters

#10 Post by anders_col » 30 Oct 2013 17:18

Thanks for your reply, I will try more tomorrow! :)

BR Anders

aCkO
Posts: 1119
Joined: 14 Feb 2011 04:07
Location: Bar, Montenegro

Re: showing special characters

#11 Post by aCkO » 01 Nov 2013 04:49

As Marina already suggested, your system locale must match the selected code page in CP Font Generator. The default code page for Swedish is Windows-1252 (Latin I or Western Script). You have to do that if you want to use Swedish alphabet in the IDE:
swedish.png
swedish.png (15.81 KiB) Viewed 6674 times
Output:
swedish.jpg
swedish.jpg (40.15 KiB) Viewed 6674 times
To change system locale, follow this tutorial: http://windows.microsoft.com/is-is/wind ... tem-locale.

CP Font Generator is originally designed to provide a workaround for the lack of Unicode support in mE software. It supports SBCS code pages only (Single Byte Character Set), i.e. languages with up to 256 keyboard mapped characters.
anders_col wrote:However, I need to use Chinese in my GUI. When trying to paste a Chinese character into mikroC PRO for dsPIC (in a char array in the code), it directly switches to a '?'. Just by pasting it in there I mean.
That's because the code editor component supports ANSI only (single byte characters). Chinese, Japanese and Korean (collectively named CJK) belong to DBCS code pages (Double Byte Character Set). However, there is a way to use CJK ideographs in VTFT and mE compilers but unfortunately not at design time because of the above mentioned ANSI limitations. I will create an application for that purpose along with complete tutorial as soon as I get some free time. Here's just a preview of the output:
china.jpg
china.jpg (75.67 KiB) Viewed 6674 times
Regards

anders_col
Posts: 19
Joined: 14 Jan 2013 11:03

Re: showing special characters

#12 Post by anders_col » 01 Nov 2013 10:09

Thank you aCkO for the info!

I understand that its a complex time-consuming issue for you. Very interesting to hear that you're working on that project, at least now I have some hope :) I'm looking forward to hear any progress you make. And thanks for providing CP Font Generator, it's really nice and helped me a lot with å, ä, ö, ü etc.

Best regards, Anders

anders_col
Posts: 19
Joined: 14 Jan 2013 11:03

Re: showing special characters

#13 Post by anders_col » 06 Nov 2013 16:42

Hello again!

I managed to redraw the existing characters in CP Font Generator program, to generate Chinese characters/font. The pixels that get drawn are based on a bitmap image (16x16) generated in a small program I wrote. This program also uses the window handle of the form that contains the editable character (in CP Font Gen, I use Spy++ to find the handle). It then can plot all the needed pixels in the Chinese character. For now it's on a character-by-character basis, but since our dsPIC program has quite few text strings in it (ca 30), this is an OK solution for us :)
I'm using existing CP Font Generator characters, for example "\".
I'm using existing CP Font Generator characters, for example "\".
font_gen_chinese.png (111.79 KiB) Viewed 6591 times
I type in the Chinese character in the textfield, generate the bitmap, and lastly the pixels get plotted in CP Font Generator.
I type in the Chinese character in the textfield, generate the bitmap, and lastly the pixels get plotted in CP Font Generator.
font_gen_chinese-2.png (179.3 KiB) Viewed 6591 times
Output on dsPIC33EP.
Output on dsPIC33EP.
start_view_s.png (264.46 KiB) Viewed 6591 times
Best regards, Anders

Niceday
Posts: 61
Joined: 02 Jul 2012 09:34

Re: showing special characters

#14 Post by Niceday » 23 Jan 2014 08:41

Hi All,

I'm still looking for a solution to use chinese characters in VTFT. If I change the system locale to traditional chinese as recommended above I could input chinese characters in VTFT and could compile the resulting code. But at runtime the application shows no screen. With latin characters (german codepage) it works. So what's wrong?

@aCkO: Did you already had the time to prepare a manual how to use chinese characters in VTFT? I'm sure a lot of people would highly appreciate this.

@ anders_col: Would it be possible to provide the software to generate the chinese font? As you already wrote, it's not a perfect solution, but will work as long as you have to translate only a limited number of characters.


Best regards
Niceday

aCkO
Posts: 1119
Joined: 14 Feb 2011 04:07
Location: Bar, Montenegro

Re: showing special characters

#15 Post by aCkO » 27 Jan 2014 01:16

Niceday wrote:I'm still looking for a solution to use chinese characters in VTFT. If I change the system locale to traditional chinese as recommended above I could input chinese characters in VTFT and could compile the resulting code. But at runtime the application shows no screen. With latin characters (german codepage) it works. So what's wrong?
That's because German belongs to SBCS (single byte character set) code page. Chinese is DBCS.
Niceday wrote: @aCkO: Did you already had the time to prepare a manual how to use chinese characters in VTFT? I'm sure a lot of people would highly appreciate this.
I made some modifications to CP Font Generator to allow export of Unicode characters. This is just a temporary solution that should get the job done: http://www.mikroe.com/forum/viewtopic.php?f=160&t=58298

Regards

Post Reply

Return to “Visual TFT General”