• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

How to change Character Set in my program

As Everyone know: in ASCII Chr(49) = '1', But now I want to change Character Set in my program. eg: Chr(49) equal a inverse '!'.
How can I do it?

Thanks in advance!

Regards
Tiger
0
tiger2000
Asked:
tiger2000
  • 3
  • 3
  • 3
1 Solution
 
scrapdogCommented:
C-64 programmer?

You have to design a new font, that is the only way you can do it...
0
 
sburckCommented:
Depending on where you want it changed, you have options, some more difficult than others.  If you need it changed overall, scrapdog's answer that building a font will do it is correct, but not the only answer.  If you just want it changed in edit boxes, you can catch the OnKeyDown and swap the keys in a table like this:

    keyswap : array[0..255] of char;

intialize keyswap with whatever inversions you want

Keyswap[0] := 0;
....
Keyswap[49] = '!';
....

and then in the OnKeyDown, take the Key variable and do

Key := KeySwap(Ord(Key));

and the keyboard will be swapped around in your edit box.

Output of strings and labels, etc. can be done in the same way.
 
0
 
tiger2000Author Commented:
thanks scrapdog and sburck.
But how can I make a font?
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
scrapdogCommented:
sburck's suggestion will just remap the keyboard, and I don't think that's what you want (i.e. the actual character set appearance won't be changed)

To make a font, you need to find a font editor.  I've never used a font editor, so I couldn't make any suggestions.

The way a font is stored is quite complex...it is not as easy as finding the ASCII offset and filling that area of memory with a series of bytes.

So using a third party font editor is probably your best choice.

0
 
sburckCommented:
There are two font editors for Windows that I know of, both run around $300-400.  One is Macromedia Fontography, and the other is Pyrus Fontastic.
0
 
tiger2000Author Commented:
Yes, as scrapdog said, I want to make a new Character Set. I'm developing SMS(Short Message System) frontend program. U know, There are many strange characters In mobile phone/SIM card.
So, another question: if I make a font, is it only one byte? That is, I don't want to use DBCS.
Could the font deal with it?
BTW, if can give u two the points, I want to give u 50 points both. But now I can give only one person...
0
 
sburckCommented:
Both editors support single and double byte chararcters.  However, if you want these fonts for an LCD display (like a mobile phone), usually the LCD displays have a 5x7 or 7x9 grid on which you can define your own characters, and these are not characters like the Windows Truetype characters, but bitmaps.

To split the points, you can put out two new 'questions',
'Points for scrapdog' and 'Points for sburck', and we can answer them.  After that, either delete this question or lower the points to zero and give one of use the zero points, so that the answers here stay on record.
0
 
scrapdogCommented:
sburck:  E-E lets you raise the points, but you can't lower them.  =(

It is better to keep this question intact, so one of us should answer this one, and the other can answer a dummy question.  Since I'm here right now, I'll answer this one. =)

tiger:  just post a question entitled 'points for sburck', and then he can answer it and you can give him the points.
0
 
tiger2000Author Commented:
Aha, scrapdog, now the points is yours!
Thank you!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now