|
Cyrillic fonts for allegro |
Thomas Fjellstrom
Member #476
June 2000
|
or use grabber's fonst script loading.. Just enter the correct info into a textfile and import as a FONT. -- |
DanielH
Member #934
January 2001
|
Can you do that with two different sets of values? The font should contain 224 characters: 176: 0x20 - 0xcf |
Thomas Fjellstrom
Member #476
June 2000
|
Thats what that font loader is for, to load more than one charater range into the same allegro FONT. Unfortunately I don't know the format of the file the grabber wants.. but I'm sure someone around does. -- |
Kirr
Member #5,060
September 2004
|
Wow, what a mess to just output text. How much easier it is to use TTF directly in your program. Also it lets you change the text size on-the-fly and see how it looks without re-running TTF2PCX, re-grabbing it with grabber etc.. -- |
miran
Member #2,407
June 2002
|
Daniel, Thomas: I already told him all that, but as usual he ignored it. -- |
Evert
Member #794
November 2000
|
Quote: testfont.pcx 0x20 0x7F Use a dash (-) for the second file name and see if that helps. Quote: You have to use ttf2pcx and use a paint program to combine them. No, you don't. Quote: Unfortunately I don't know the format of the file the grabber wants.. but I'm sure someone around does. I posted the relevant link in my first post in this thread. Miran posted the format as well. |
Nedjalko Milenkov
Member #5,394
January 2005
|
I did not used Paint program, but I think that the Font Editor is good too. Now I have one PCX file with English and Cyrillic, but when I write something and use unicode, I do see some strainght signs. How does allegro understand what part of the picture for an example "A" is? |
Evert
Member #794
November 2000
|
Have a look at [url http://alleg.sourceforge.net/onlinedocs/en/index017.html#load_bitmap_font] for a description of how the font should formatted in the bitmap. |
Nedjalko Milenkov
Member #5,394
January 2005
|
Somehow using ttf2pcx and Font Editor I`v managed to make a compilation - see the attached file, but when including it in my program, and print cyr. I see some unrecognized strings althought I have input cyrillic. |
miran
Member #2,407
June 2002
|
How did you write your font script? And how did you enter the text? Extended ASCII or Unicode? -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
Quote: How did you write your font script? And how did you enter the text? Extended ASCII or Unicode? I do not have font script. I just use data file. I use Unicode. |
miran
Member #2,407
June 2002
|
For the millionth time, YOU NEED A FONT SCRIPT!!!!!!!!!!!!!!!!!! Scroll up this thread and pick a random post to see how it's done.... -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
miran - Arrrrrr...how can I explain that I CAN NOT USE A SCRIPT! P.S. Sorry if I sound too rude, but 4 days for Unicode seems too much! P.S. 1 I do not use load_font because in version 4.0 there is no such function and ver. 4.1 is beta. |
Evert
Member #794
November 2000
|
Quote: Arrrrrr...how can I explain that I CAN NOT USE A SCRIPT! I don't know, but you should try to say it before shouting. Quote: I load into the grabber font.txt which contains: That looks ok. Can you post the exact script and font file? Quote: P.S. 1 I do not use load_font because in version 4.0 there is no such function and ver. 4.1 is beta. True, but the description of the font formats is the same as for the grabber, as I said in my first post. |
Nedjalko Milenkov
Member #5,394
January 2005
|
Sorry for the "shouting", but ... |
miran
Member #2,407
June 2002
|
I found two errors: 1. There needs to be a space between - and the number in the second line EDIT: Attached is arial.ttf converted to pcx with my FontEditor at size 36 with no antialiasing and two ranges: normal ASCII and the cyrillic characters. Also in the zip is a working font script for this pcx and the whole font packaged as a dat file. -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
I thought that they match |
miran
Member #2,407
June 2002
|
I edited while you were posting. See my example in the post above... -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
Thanks for the file, but again my grabber says that "I can not read arialfonts.pcx", but when I include the arialfonts.pcx direct from the PCX there is no problem at all . I`v tested the compiled data.dar and with set_uformat( U_UTF8 ); shows only ^^^ |
miran
Member #2,407
June 2002
|
Quote: my grabber says that "I can not read arialfonts.pcx", but when I include the arialfonts.pcx direct from the PCX there is no problem at all First of all, the file I made was called arialcyr.pcx. Secondly, you need to put both files, arialcyr.txt and arialcyr.pcx in the same directory. Then load grabber, select object->new->font. Then grab the txt file. There should be no errors. If you do get errors, then your grabber is defected... Quote: I`v tested the compiled data.dar and with set_uformat( U_UTF8 ); shows only ^^^
You need to call set_uformat(U_UNICODE) to be able to use that font, just EDIT: -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
It seems that my grabber is full of bugs but with your datafile and with set_uformat(U_UNICODE); does not works
|
Thomas Fjellstrom
Member #476
June 2000
|
set_uformat should go BEFORE allegro_init() IIRC. -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
I tried it but it does not work , but when I put to the screen this "\x14\x04" ">\x04" , which is from the allegro example it works, but when I use uconvert("Ïðîãðàìèðàíå", U_ASCII, buf, U_UNICODE, sizeof( buf ));, there is no cyr output. This is 30% solution, because I do not want to write like "\x14\x04" only for one alphabet . |
miran
Member #2,407
June 2002
|
You probably need to setup a codepage conversion table: void set_ucodepage(const unsigned short *table, const unsigned short *extras); -- |
Nedjalko Milenkov
Member #5,394
January 2005
|
miran I do not think that I am the first man using unicode. Is there something done? And why when I used some already done PCX(from one site for beginers) it works? |
|
|