Roland Posted February 16, 2017 Share Posted February 16, 2017 My code supports the game in different languages (actually English and Swedish for now, but its quite easy to add more languages). Switching language works just fine. However Ascii-characters above 0x7F are not rendered correctly or not at all. Is the any workaround or fix for this (C++)? Question for Josh? Will Leadwerks be able to deal with extended character sets in the future? Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted February 16, 2017 Share Posted February 16, 2017 I've never been able to get a straight answer from anyone on how to actually do this. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
martyj Posted February 16, 2017 Share Posted February 16, 2017 @Josh, how are you rendering strings in Opengl? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 16, 2017 Share Posted February 16, 2017 Well, you need the DrawText() command to accept the string you want to draw, so a wstring might be needed (but probably not for Swedish), and you need the font loading string to include those characters, which is currently an internal value: if (family==Font::English) { familychars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=!@#$%^&*()_+[]\\{}|;':\",./<>? `~"; } It might be possible to let the user input a loading string (and change that English constant into the string above, but it still won't work with anything that requires more than 256 letters. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 17, 2017 Share Posted February 17, 2017 Of course the font also has to have those letters. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Roland Posted February 17, 2017 Author Share Posted February 17, 2017 Okay. So at the moment its not possible then (my font has the Swedish åäöÅÄÖ). å (0xe5) ä (0xe4) ö (0xf6) Å (0xc5) Ä (0xc4) Ö (0xd6) Thanks for the answer http://www.asciitabell.se/ Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted February 17, 2017 Share Posted February 17, 2017 I've added a new Font::Load() command that will accept any string of characters as the glyphs to pull from the font. However, I do not exactly know how this will work. It's all kind of strange to me, being a native English speaker everything else seems like some weird exception. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Einlander Posted February 17, 2017 Share Posted February 17, 2017 Is there a reason to not simply convert all strings to wstring to allow utf8 in the fonts that allow them? Or have a global font settings that will take the restrictions off for those who know the risks? Maybe you might gain some customers using logogram based writing systems. Quote Link to comment Share on other sites More sharing options...
Roland Posted February 17, 2017 Author Share Posted February 17, 2017 I've added a new Font::Load() command that will accept any string of characters as the glyphs to pull from the font. However, I do not exactly know how this will work. It's all kind of strange to me, being a native English speaker everything else seems like some weird exception. Anything that can be tested? Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 17, 2017 Share Posted February 17, 2017 I will be honest: I fully expected to see 3d models of Swedish people when I clicked on this topic. Really wondered how you would have captured the essence of a swedish person. 3 Quote Link to comment Share on other sites More sharing options...
Roland Posted February 17, 2017 Author Share Posted February 17, 2017 I will be honest: I fully expected to see 3d models of Swedish people when I clicked on this topic. Really wondered how you would have captured the essence of a swedish person. Hahaha.. sorry for that Here is a fully normal Swede ... (me?) 5 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted February 17, 2017 Share Posted February 17, 2017 We do have some characters on this board. Some are Swedish. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
shadmar Posted February 17, 2017 Share Posted February 17, 2017 I know several swedish jokes 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Roland Posted February 17, 2017 Author Share Posted February 17, 2017 As this now has gone wild I can learn you two Swedish words that are really really easy Island = ö Small river = å Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
sjg Posted February 17, 2017 Share Posted February 17, 2017 I had a similar thing where I wanted to display Cyrillic characters, and in the end I rolled my own bitmap font and used the DrawImage function to get them to the screen. Granted, it wasn't cheap (in that there was a bit of an FPS hit), but it did what it said on the tin. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.