|Site sponsored by IGEL|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[directfb-dev] Internationalization and the DirectFB API
Hello! Please bear over with me, as I have not yet tried to run any of the demos in DirectFB (yet), but when reading on the API there are some questions that I just can't wait to ask.... :-) In the event struct, there is a 16 bit field for the unicode value of a key press event. Has there been any consideration for upping this field to 32 bit to make it more future proof? And: What is the preferred way of shipping text strings to the guts of DirectFB in terms of internationalization? I'm no expert on unicode, but it seems like the standard is heading towards more glyphs than can be represented in 16 bits. In unicode lingo, I think they refer to a glyph through its "code point" value, which is basically a 32 bit integer. In order to handle more than 65536 code points using 16 bit unicode, something called "surrogates" has been invented. Surrogates are a few thousand 16 bit unicode values which, when paired, gives a code point in the range of 0x10000 -> 0x10ffff (e.g. more than a million code points in total at the expense of 2048 16 bit unicode values). This scheme will work, although it will be a little more tricky to count the number of glyphs in a string of 16 bit unicode values, but it solves a problem. But delivering 2 events, each one a surrogate, for a single glyph sounds like a complicated API to me.. When I looked into and contributed some on a similar project called "microwindows" some time ago, the challenges of internationalization made me make the following conclusions: 1) Single key events should be 32 bit unicode code points 2) Strings delivered for rendering should be UTF-8, 32 bit code points, 16 bit unicode, or codepaged 8-bit like latin-1 etc. If one could standardize on UTF-8, I think the world would be a better place by far, but there are probably too many applications out there that would be simpler to port with the additional 16 bit unicode and 8 bit codepage. When manipulating text (e.g. a text editor), the 32 bit codepoint API could be usefull. Anyone who would like to comment on this or point me in the right direction? Your project looks fresh, innovative and promising, and I wish you the best of luck with it! Best regards, Morten Rolland -- Info: To unsubscribe send a mail to email@example.com with "unsubscribe directfb-dev" as subject.