Xonotic Forums

Full Version: using the Xolonium font
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hy,

i'm not sure if i'm in the rigth forum. So maybe a moderator has to move it. I'm writing a small query tool for Xonotic, like a gamebrowser. The informations i got back from the query are shown in listviews. I use the "fonts\xolonium-regular.otf" font and a selfmade ttf-font which replaces the glyphs of "conchars.jpg" to draw the player names. To do the utf8 stuff i used the code in "utf8lib.c".

Most playernames are shown the right way as in the game. But when the name is like Shy which is in hex "\xF0\x9F\x98\x83" i don't get the right symbol drawn. I checked the result when calling "getnchar_utf8_enabled", it is 0x0001f603. In the „xolonium-regular.otf“ file it is the right codepoint for the glyph. But how can i draw a WCHAR bigger then 0xffff. So what is the trick to draw this symbol right? I use DrawTextW(...) to do the itemdrawing in my listview.
This has not much to do with the font.

AFAIK, wchar is expected to be UTF-16 encoded.
In that case, characters beyond U+FFFF require two 16-bit code units.
See: https://en.wikipedia.org/wiki/UTF-16#U.2...U.2B10FFFF

Example character:
Unicode: 1F603
UTF-8: F0 9F 98 83
UTF-16: D83D DE03
Thank you very much! This was the solution, it works now.
I don't know what exactly your query tool is supposed to do, but I recently started a Xonotic launcher app (http://forums.xonotic.org/showthread.php?tid=6057) which queries the dp-masterserver for a server list. Depending on your goals, maybe we can join these two projects.

Let me know if you're interested
@Freddy

thx for your offer. My proggy is a dll plugin for Firefox. It is based on this code:

https://sourceforge.net/projects/q3plug/

or here

http://members.liwest.at/mb/q3plug/

I only added some code to show Xonotic servers. So the only improvements i did, was the name color drawing for xonotic, the rest was more or less allready in the code. So i think its not enough to join with your project, but thx anyway.