Irrlicht i18n (Unicode, FreeType, etc.)
Hi,
thanks for the revision.
It almost worked this time, there are only few errors left.
I'm sorry I don't know how to remove there errors.
Here is the new log:
http://dl.free.fr/eAUEawc64
thanks for the revision.
It almost worked this time, there are only few errors left.
I'm sorry I don't know how to remove there errors.
Here is the new log:
http://dl.free.fr/eAUEawc64
Okay, try this version now:
http://irrlicht.pastebin.com/juRFFdBW
http://irrlicht.pastebin.com/juRFFdBW
CGUITTFont was updated to fix some issues found when loading msgothic.ttc. The problem is that some fonts like MS Gothic don't include a grayscale version of the font. The class would then try to load the monochrome bitmap like a grayscale bitmap and create a huge mess of things.
The new version will properly query the glyph to determine that pixel format the bitmap is stored in, then use the appropriate loading routine.
The new version will properly query the glyph to determine that pixel format the bitmap is stored in, then use the appropriate loading routine.
Really great job This is very usefull stuff. Only one issue is rendering method of TT fonts. Each sign require set new texture (draw2DImage method) what cause performance drop.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Yes, that is really unfortunate. FreeType returns a separate glyph image for each character. The current implementation will create a new texture for each glyph image, then draw each texture one at a time.Nadro wrote:Really great job This is very usefull stuff. Only one issue is rendering method of TT fonts. Each sign require set new texture (draw2DImage method) what cause performance drop.
The main issue is how to solve it. I've thought about changing the gui classes to render the font to a texture whenever the text changes, and using that texture as a sort of cache. That would definitely speed things up, but it won't work on devices that don't support RTT, and it would require re-writes of most of the GUI classes.
Another solution is to try to turn each TrueType font into a font bitmap file. When it loads glyphs, it draws it into a large texture. Then it could use sprite batches like the current font implementation. It would be a little complicated to code, though, as there are over a million possible glyphs in unicode, and you would also run into texture size problems. When each glyph is used, they would have to be added after the last glyph you added. This would result in a lookup for each character to identify the texture page it is on (you may need more than one texture because of texture size limits) and the position of the character. Then you would have to figure out the placement of each character in the string and batch draw each page one at a time.
Can you think of any other possible methods to improve the speed? Those are currently the only two I can think of.
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm
Are you saying that CFileSystem.patch and CXMLReaderImpl.patch are not merging for you? I made the patches around Irrlicht version 1.7.tinhtoitrangtay wrote:This is woking perfectly now! But i can't merge to Irrlicht. I have merge to code Irrlicht it don't work. You can patch for irrlicht support FreeType. Thanks
All of the files in the OP are designed to be compiled with Irrlicht, except for CGUITTFont. That class is designed to be compiled with your project. It does not have the necessary files to be compiled into Irrlicht. This allows you to use it with a pre-compiled copy of Irrlicht.
just wanted to try it but irrUString.h doesn't compile.
Code: Select all
..\..\Libs\irrlicht-1.7.1\include\irrUString.h||In member function `irr::core::ustring16<TAlloc>& irr::core::ustring16<TAlloc>::replace(irr::uchar32_t, irr::uchar32_t)':|
..\..\Libs\irrlicht-1.7.1\include\irrUString.h|1892|error: expected `;' before "a"|
..\..\Libs\irrlicht-1.7.1\include\irrUString.h|1893|error: `a' was not declared in this scope|
||=== Build finished: 2 errors, 3 warnings ===|
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Which compiler are you using?Sudi wrote:just wanted to try it but irrUString.h doesn't compile.Code: Select all
..\..\Libs\irrlicht-1.7.1\include\irrUString.h||In member function `irr::core::ustring16<TAlloc>& irr::core::ustring16<TAlloc>::replace(irr::uchar32_t, irr::uchar32_t)':| ..\..\Libs\irrlicht-1.7.1\include\irrUString.h|1892|error: expected `;' before "a"| ..\..\Libs\irrlicht-1.7.1\include\irrUString.h|1893|error: `a' was not declared in this scope| ||=== Build finished: 2 errors, 3 warnings ===|
In the meantime, try this:
Possibly fixed irrUString.h.
Well now, that is embarrassing. I had changed the name of those constants in irrUString.h and forgot to fix CXMLWriterUTF8. I guess I deserve it for not recompiling Irrlicht in a while. I've uploaded a fixed version.
CXMLWriterUTF8.zip
CXMLWriterUTF8.zip