On Nov 3, 2011, at 2:42 PM, Carsten Neumann wrote: > Hello Patrick, > > On 11/02/2011 01:33 PM, Patrick Hartling wrote: >> On Nov 1, 2011, at 7:01 PM, Carsten Neumann wrote:
>>>> * Full Unicode support using UTF-8 as the input encoding—unless >>>> ICU4C or something equivalent were added as a dependency. I do not >>>> want to get into the mess of wchar_t and std::wstring as that has >>>> not worked out well for me in the past. This will most likely >>>> require multi-font support to allow for fallbacks when a needed >>>> glyph is not supplied by the primary font in use. >>> >>> AFAIK you can just feed a UTF-8 string to the OpenSG font functions and >>> as long as there are appropriate glyphs in the font it will work. I >>> don't think there is any fallback atm, but that would be an interesting >>> addition. >> >> That was my understanding as well, but I have not been able to make it work. >> I can only get code points in the range 0x20 to 0x7E (ASCII) to render >> correctly. One thing that I have run up against is that I cannot determine >> what encoding is produced by utf8Char2Unicode() in >> Source/System/Text/OSGTextFace.cpp. It looks like it might be UTF-16, but >> that would mean that this implementation does not support code points beyond >> 0xFFFF. It can't be treated as UTF-32 on Windows because wchar_t is only 16 >> bits wide on that platform. This makes it very difficult to know how to >> interact with the various text-related objects except through the use of >> UTF-8. Perhaps I am just spoiled because I have gotten used to ICU4C dealing >> with encoding details in our code. That said, the FTGL demo program was able >> to display whatever I threw at it with no special effort, and that was a big >> selling point for me. > > See TextTXFParam::setCharacters(), it selects which character glyphs are > stored in the texture. I have no idea what I was doing wrong before, but now I cannot make it fail. I still don't think it will work for code points beyond 0xFFFF on Windows, but I need to find a font with glyphs beyond that range for further testing. -Patrick -- Patrick L. Hartling Senior Software Engineer, Priority 5 http://www.priority5.com/ The information transmitted in this communication is intended only for the person or entity to which it is addressed and contains proprietary material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please destroy any copies, contact the sender and delete the material from any computer. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users