Hi!
I'm trying to understand how to use the Orx engine. I use
Grey's tutorials. There's no trouble with №1 and №2, but my project I made using tutorial №3 doesn't work properly.
Please help! Tell me, what I'm doing wrong. You can download the whole project from the link below.
My project
Comments
So I'm hesitant to work with the project.
The executables in the pre built binaries are packed, and most anti-viruses don't like that.
Mystic, can't help you yet... I'm at #2
Why don't you use its source code as a starting point for experimentation?
I just got your project (took me for ever to find the right link on the page, btw ^^) and will have a quick look to see if I can spot an error without building it.
As for the compressed exe issue with antivirus, I think I'll just sync the 1.3 release and replace the dev package with an un-compressed one, that'll be much easier for everybody.
So the only thing I could see was an early return in your StandAlone.cpp, line 37, which would prevent from executing all the code that's placed after (creating a clock, targeting the walk right anim, etc...).
I don't have vs2010 so I created a quick project with vs2008, used your project folders for include/lib and compiled the debug & release.
When removing the early return everything looks nice to me, at least the soldier is animated.
I couldn't find any other issues.
Hope this helps!
Cheers!
I'm trying to use a custom font in my Orx project. It's a .ttf file that contains English and Russian characters.
I placed it in the /myproject/data/fonts folder and specified ../data/fonts/font.ttf in the main .ini file as it shown in the attached screenshot.
It doesn't work, any text in the game window uses the default Orx font. Can anyone explain to me what's wrong and what should I do to use my font in the game? :side:
The config font template specifies info about the characters in the font, its spacing and an image file with all the characters. There is also a tool that comes with Orx called orxfontgen that can be used to create these things from a .ttf file.
Here's some more info on the font template and orxfontgen: http://orx-project.org/wiki/en/orx/config/settings_structure/orxtext
Here is a sample directly from my project of how to specify a font template:
So then you would have a line Font = F-Sam-20 in the [Display] section.
I do know what I described above does work when you are specifying a font when creating individual Text objects rather than specifying a default in the Display section.
But basically you need to create a text file containing all the characters you want generated from the font (see the CharacterList I specified above, add to it if necessary, and call it input_chars.txt). Don't forget the space character if you need it!
Then go to your command prompt and navigate to the directory containing the .exe (on my Windows machine, it's C:sdkandroid-ndk-r7sourcesorx oolsorxFontGeninwindows for example). Then run the command like this:
orxfontgen -t input_chars.txt -f myfont.ttf -s 20
Specify -s other than 20 for a different size.
When the tool runs, it will create a .tga image file which can be used in the Font template. It also generates the Font template itself into an .ini file. You can just cut and paste the contents of that .ini into a config file you are already using if you want.
and now the test string uses my font :cheer:
But there is nothing happens when I try to make an application use my font declaring the font in the [Display] section of the main .ini file, just as you said.
Thanks for your help!
One tip: it would probably be better to start a new forum thread for a completely new question, because it makes the answers easier to find for new people.
Let us know if you need any help. I hope you are enjoying learning Orx as much as I have been.
And one more problem with fonts - I can't use Russian characters and I've got no idea why. When I execute orxFontGen it doesn't find any.
Maybe try a different font to rule out the TTF as a problem?
P.S. Have you looked at this tutorial yet: http://orx-project.org/wiki/en/orx/tutorials/standalone. It shows examples of localization for different languages, so it might be of interest to you.
Thanks acksys for the support and sorry for the late answers!
So as you found out, the Display section doesn't care much for fonts. Fonts are declared in their own separate section and are linked to texts.
So there isn't any way to override the default function. However one can do something like that:
As for the character list, the idea was to use on the command line all the files that contains the text you're going to display, the tool would then collect all the characters for you and extract them from the .ttf. This was mostly for Chinese-like alphabets that containt tens of thousands of glyphs.
Using a self made character list file works too and is probably more handy for smaller alphabets such as latin and cyrillic.
Lastly, if you have the cyrillic characters in your .tff and in the text file you provie to orxfontgen, you shouldn't have any trouble.
Just verify that all the character files you give are encoded in UTF-8, that's the only unicode encoding supported by orx.
But I still can't extract cyrillic characters from any .ttf file I have.
Here is a text from .log file:
[2012-02-12 16:34:16] <LOG> (ProcessFontParams() - srcorxFontGen.c:462) [FONT] Using font 'font1.ttf'.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:248) [LOAD] Invalid character code point '0xFFFFFFFF', skipping.
[2012-02-12 16:34:16] <LOG> (ParseTextFile() - srcorxFontGen.c:271) [LOAD] 'input_chars.txt': added 23 characters.
[2012-02-12 16:34:16] <LOG> (ProcessInputParams() - srcorxFontGen.c:301) [LOAD] 'input_chars.txt': SUCCESS.
[2012-02-12 16:34:16] <LOG> (Init() - srcorxFontGen.c:622) [MODE] Output mode set to non-monospace.
[2012-02-12 16:34:16] <LOG> (Init() - srcorxFontGen.c:639) [PACKING] Characters will be packed.
[2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:726) [OUTPUT] No output name specified, defaulting to 'orxFont'.
[2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:829) [PROCESS] Calculated character size: 9 x 20.
[2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:830) [PROCESS] Calculated character spacing: 2 x 2.
[2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:831) [PROCESS] Calculated texture size: 42 x 110.
[2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:1006) [PROCESS] 23 glyphs generated in 'orxFont.tga'.
[2012-02-12 16:34:16] <LOG> (Run() - srcorxFontGen.c:1015) [SAVE] 'orxFont.ini': SUCCESS.
Would you mind sending us the file? (input_chars.txt)
EDIT: And the .ttf file as well, this way we can try the full export process.