CuteAlien wrote:- No dependency on ustring (I don't think string-conversions should happen inside the font-class itself)
CuteAlien wrote:I expect the string to correspond already to the encoding requested from freetype when drawing is requested. Unless I'm missing something you can pass through utf-16 using wchar_t for example (just will waste 2 bytes on Linux). I think any kind of encoding conversions should already happen earlier - not when you want to draw the font. But maybe I'm missing something there - I didn't dig too deep into the ustring stuff for now as I just wanted to get it working with my game (which converts utf-8 to ucs-2 on loading and so I didn't want to risk to have another conversion in drawing).
SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts
Copyright (C) 2001-2013 Sam Lantinga <firstname.lastname@example.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
CuteAlien wrote:@hendu: Ah cool. Well, still not exactly compatible with zlib, but anyway - your report is as always helpful
I didn't notice that problem.
christianclavet wrote:HI, Learned more about the character encoding and just figured out that when I open XML files in UTF8 the string is still in UTF8 in memory and have to convert it to ANSI (The Irrlicht font system).
Can I use the irrUString.h classes to convert the UTF8 encoded string coming from IRRxml to something I could use directly with Irrlicht like core::stringw? (So it display accented character proper (latin1) with the default Irrlicht ANSI font? I found a hacky way to do it on windows, because I treat all characters that are more than one bytes and calculate an offset to get to latin 1. On windows it work, because the "char" is 2 bytes, But I think it's completely different on Linux (4 bytes and perhaps another endianess). So I was thinking to use the class to convert...
I see that I could use perhaps use it to save back in UTF8, (test.toUTF8()) but could I load (test.FromUTF8() for example?
Users browsing this forum: No registered users and 1 guest