Question on fonts

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Texel

Question on fonts

Post by Texel »

How to make in irrlicht-game Cyrillics(Russian) font?
Lantis

Post by Lantis »

You must modify IrrFontTool.cpp and recompile for it.

Write your email here and im can send you modified source
code of IrrFontTool for support national languages.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

How about posting the code here? It would stop this question being asked again.
Texel

Post by Texel »

I already finished IrrFontTool.cpp and he successfully deduced(removed) in a format .bmp Russian font, but during game instead of Russian letters the squares are shown.

P.S. The text is translated the interpreter.

texel@rambler.ru
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

Post by Serg Nechaeff »

Texel, please, as soon as you are done post the solution somewhere, I really need it!
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

Post by Serg Nechaeff »

Lantis wrote:You must modify IrrFontTool.cpp and recompile for it.

Write your email here and im can send you modified source
code of IrrFontTool for support national languages.
Lantis, please, can you email the copy of your IrrFontTool.cpp as well?? nechaeff@byxon.com
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Tyn wrote:How about posting the code here? It would stop this question being asked again.
Serg wrote:Lantis, please, can you email the copy of your IrrFontTool.cpp as well??
A point well made :mrgreen:
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

Post by Serg Nechaeff »

true! :)
but I couldn't make irrlicht work with russian fonts :(
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

Post by Serg Nechaeff »

ok! I've changed the code in irrfonttool and I can get a big texture of 1600 symbol, but how do I change the engine to make it read and display the font?????? please give me a hint!
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

The answer

Post by Serg Nechaeff »

In order to make it work with russian (and probably other languages) you gotta change some code:

in IrrFontTools:

Code: Select all

	HFONT font = CreateFont(
			-MulDiv(fontSize, GetDeviceCaps(dc, LOGPIXELSY), 72),
			0,
			0,
			0,
			bold ? FW_BOLD : 0,
			italic,
			0,
			0,
			RUSSIAN_CHARSET,
			0,
			0,
			ANTIALIASED_QUALITY,
			0,
			str);

Code: Select all

			case IDC_BUTTON1:
				copyFontToClipBoard(hwndDlg, 1600);
				return TRUE;

In IrrLichtl, in CGUIFont.cpp:

Code: Select all

//! constructor
CGUIFont::CGUIFont(video::IVideoDriver* driver)
: Driver(driver), Positions(1601), Texture(0), WrongCharacter(0)
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Code: Select all

ANTIALIASED_QUALITY
Has anyone tried messing with this to get better font quality?
Serg Nechaeff
Posts: 162
Joined: Wed Nov 26, 2003 5:24 pm
Location: Europe

Post by Serg Nechaeff »

Why I have really strange letters in editbox? The captions are ok in all elements.

Has anyone tried messing with this to get better font quality?
I have, with no success though...
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

Is it possible to set the antialising quality in Irrlicht and not in the IrrFontTools? That would be a lot faster for me.
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

I think it is something Niko put in when he does implement it, however I haven't seen any way of getting AA fonts.
hyjoin

support Chinese (or China) in irrlicht fonts?

Post by hyjoin »

support Chinese (or China) in irrlicht fonts?
Post Reply