{"id":3770,"date":"2016-03-25T22:36:38","date_gmt":"2016-03-25T12:36:38","guid":{"rendered":"http:\/\/www.vectorstorm.org\/?p=3770"},"modified":"2016-04-14T20:28:18","modified_gmt":"2016-04-14T10:28:18","slug":"unicode","status":"publish","type":"post","link":"https:\/\/www.vectorstorm.com.au\/2016\/03\/25\/unicode\/","title":{"rendered":"Unicode"},"content":{"rendered":"

\"Unicode2\"<\/p>\n

So I spent about twenty minutes last week, and added Unicode support to the VectorStorm engine’s font system.\u00a0 I’d been put off from doing it before, in part because I know from experience how complicated it can be to deal with Unicode-encoded text, and in part because I was worried about how many big changes it would require in the VectorStorm codebase.<\/p>\n

But it turned out to be pretty easy;\u00a0 it required less than two dozen lines of new\/modified code, in total.\u00a0 Why was I worried about doing this, again?<\/p>\n

Key to making this work was discovering an open-source library utfcpp<\/a>, which made extracting code points (roughly, individual glyphs) from a UTF-8 string a breeze.\u00a0 I’d been dreading trying to integrate a heavy library like ICU into the VectorStorm engine, and then wrestling it into agreeing to work across all the game’s different platforms.. but luckily, I didn’t have to!<\/p>\n

Now, VectorStorm still doesn’t come with a bitmap font, and the built-in vector font still doesn’t support Unicode at all;\u00a0 so for Unicode support, you need to create your own using BMFont<\/a> (or any of the many other tools which create BMFont-format data files).\u00a0 But we now do support drawing UTF-8 text, if your font contains the needed characters.<\/p>\n

For example, in MMORPG Tycoon 2, we now support all the glyphs from latin1 and latin1-extended, which I believe is all you need for the standard English\/French\/Italian\/German\/Spanish languages.\u00a0 And the system itself would support any other languages, if I was only to add the extra glyphs to the game’s font.<\/p>\n

I’m still not certain to what extent I’m going to localise the game into non-English languages;\u00a0 I’d very much like to do that, but I’m worried about all the procedural text in the game;\u00a0 things like the generated game names, character names, town names, and so forth;\u00a0 a lot of effort has gone into making vaguely plausible names in English, and I’m not sure if the systems I’m using to do it in English will work, if translated into (for example) Spanish.<\/p>\n

I guess this will definitely be something I need to chat with marketing people about, before launching the Greenlight campaign!\u00a0 I’d like to have my story straight and a strategy in mind, in terms of what languages the game will support upon release!<\/p>\n","protected":false},"excerpt":{"rendered":"

So I spent about twenty minutes last week, and added Unicode support to the VectorStorm engine’s font system.\u00a0 I’d been put off from doing it before, in part because I know from experience how complicated it can be to deal with Unicode-encoded text, and in part because I was worried about how many big changes…<\/p>\n","protected":false},"author":1,"featured_media":3781,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[4,3],"tags":[],"jetpack_featured_media_url":"https:\/\/www.vectorstorm.com.au\/wp-content\/uploads\/2016\/03\/Unicode2-300x75-1.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/so9WK-unicode","_links":{"self":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/3770"}],"collection":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/comments?post=3770"}],"version-history":[{"count":1,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/3770\/revisions"}],"predecessor-version":[{"id":3774,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/posts\/3770\/revisions\/3774"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media\/3781"}],"wp:attachment":[{"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/media?parent=3770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/categories?post=3770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vectorstorm.com.au\/wp-json\/wp\/v2\/tags?post=3770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}