problem with using local language font in the textbox.
-
i need to use the local language font (sinhala) with textbox in my app in xp, so the user can type in the local language. for this i'm using ttf font. i can set the font to textbox without any problem. but when i'm typing in the text box it shows the english font,but i tried
char[] ch = {'\u0db8' };
textBox2.Text = new string(ch);in the form load and it showed the correct letter, but when type in the text box still only the english letters. (at the same time i set true regional setting->language->install files for east asian languages,when i set this off , characters in the textbox shows as black squares) so any one got any idea why this happens, but i tried the same app with the same font in win 7 and it works perfect, but i need this app to run in xp. thanx in advance.
-
i need to use the local language font (sinhala) with textbox in my app in xp, so the user can type in the local language. for this i'm using ttf font. i can set the font to textbox without any problem. but when i'm typing in the text box it shows the english font,but i tried
char[] ch = {'\u0db8' };
textBox2.Text = new string(ch);in the form load and it showed the correct letter, but when type in the text box still only the english letters. (at the same time i set true regional setting->language->install files for east asian languages,when i set this off , characters in the textbox shows as black squares) so any one got any idea why this happens, but i tried the same app with the same font in win 7 and it works perfect, but i need this app to run in xp. thanx in advance.
prasadbuddhika wrote:
but when i'm typing in the text box it
shows the english fontThat's because the font will be a Unicode font. In that case, you need to emit proper Unicode code points for Sinhala to get the characters displayed correctly. This is why the text set by you at the load is showing correctly but when you type you are entering English characters which is nowhere in the Sinhala code point range.
prasadbuddhika wrote:
time i set true regional setting->language->install files for east asian languages,when i set this off , characters in the textbox shows as black squares
Windows XP requires this to be installed to get the proper rendering. From Windows 7 onwards, this comes by default and you don't have to install separately. I think you have two choices here. 1 - Use a Sinhala ASCII font which you can supply with your application. In a ASCII font, English characters will be mapped to a Sinhala character. So typing using a English keyboard will show the Sinhala letter. When user wants the text out from the textbox, you need to convert it to Unicode. 2 - Interpret English characters and emit the Sinhala Unicode encoded (UTF8 or UTF16) characters.
prasadbuddhika wrote:
i tried the same app with the same font in win 7 and it works perfect
I can't think of how this will work on Windows 7 with a Unicode font other than using the methods that I explained. :)
Best wishes, Navaneeth