Jump to content

Swedish characters


Roland
 Share

Recommended Posts

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?

AV MX Linux

Link to comment
Share on other sites

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.

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

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. :D

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

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. biggrin.png

Anything that can be tested?

AV MX Linux

Link to comment
Share on other sites

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.

  • Upvote 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...