![]() |
|
Cyrillic fonts for allegro |
Kirr
Member #5,060
September 2004
![]() |
You would have much better chance to get help here if you include these things with your post: 1. Everything needed to reproduce the problem. Your program code (as short as possible), PCX/script/whatever else you use, steps you took with TTF2PCX and both TTF and PCX, as many details as possible. Also mention your OS and allegro version and anything else you think can be relevant. 2. What you expect your program to do, precisely. 3. What your program is actually doing, precisely. Then, if someone is willing to help, he will at least have such chance, instead of guessing what you might have done wrong. Quote: miran I do not think that I am the first man using unicode. Most people using unicode don't use codepages at all. Also using unicode does not imply using PCX fonts. Quote: And why when I used some already done PCX(from one site for beginers) it works? What site? Did you try to say they work with the same code, that you posted here? Or with some other code? Or you mean something else? I guess the question is rather why your PCX don't work. Did you actually try Miran's suggestions? Mark Knopfler said:
But in the communique you know he's gonna come clean
-- |
Nedjalko Milenkov
Member #5,394
January 2005
|
Kirr 1. I came from Bulgaria and I want my programs to support cyrillic.
The code does not work with the data file from the allegro unicode example and with the Mirian`s data file too, but when I write something like \x14\x04 it works. The problem is that I do not want to write like that |
Kirr
Member #5,060
September 2004
![]() |
OK, now it's better, although you still did not post your datafile, so I had to make that cyrillic font myself. After that and some modifications your code worked for me: #include "data.h"
You did not post "data.h", so I just commented it out. uconvert("Ïðîãðàìèðàíå", U_ASCII, buf, U_UNICODE, sizeof( buf )); Here is your problem. First, when you copy/paste your source into forum reply box, its encoding may be changed. You'd better attach your source file as attachment to the post. I assume that this line has actually some cyrillic characters. So I typed cyrillic "Медитирoвать не надo." indtead of "Ïðîãðàìèðàíå". Second. Cyrillic is not part of ASCII. You have to use U_ASCII_CP instead of U_ASCII in this function call. And last, for U_ASCII_CP to work you should specify a cyrillic codepage for ALlegro with set_ucodepage. So, instead of that your one line I typed two lines: set_ucodepage(cyrcodepage,0); Of course, for this to work I had to type in a cyrillic codepage earlier: const unsigned short cyrcodepage[256] = { ..... }; Then everything worked and the program printed cyrillic text on screen. One last thing: Quote: allegro_message("Unable to load %s\n"); There is not enough arguments in this call. -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
Seems there is a hope P.S. In the allegro manual there is no second argument in void allegro_message(const char *msg, ...); |
Kirr
Member #5,060
September 2004
![]() |
Actually MattSmith already mentioned in this thread that you need a codepage conversion table, and I posted a link to the codepage data. You could use it long time ago. Anyway, here you go, this is Windows-1251 codepage:
Quote: P.S. In the allegro manual there is no second argument in void allegro_message(const char *msg, ...); allegro_message() uses same format with printf(). Please check printf() documentation. -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
Thanks to all for the help. It works! |
Evert
Member #794
November 2000
![]() |
Quote: One last thing: On a related note, don't call allegro_message() when you're in graphics mode. It will either not work or cause problems. You should call set_gfx_mode(GFX_TEXT, ...) before allegro_message() if you're in graphics mode. |
|
|