Jump to content

Phaser 2.1.3 not displaying special characters (å, ä, ö etc.)


claycr4ne
 Share

Recommended Posts

Hello all,

To start with, I'm still using Phaser versions 2.1.x in my game projects as for some reason Phaser 2.2.x doesn't display anything at all when started on Nokia Lumia (Mobile IE). In any case, I came across this problem today to which I need some help.

 

In my game I'm using special characters such as å, ä and ö in Text objects. In addition to this, I'm using Helsinki webfont. These special characters are displayed nicely without any errors using Phaser 2.1.2. Today, however, I wanted to add fadeTo-method to my background music and for this I needed to upgrade my Phaser to version 2.1.3. Doing this upgrade unfortunately made all my special characters appear like this:

å -> a
ä -> a
ö -> o

Is there anything I can do to get these characters displayed like they did with Phaser 2.1.2? I really need both special characters and fadeTo -methods in my game, so I'd appreciate your help.

Thanks!
- Marko

Link to comment
Share on other sites

Problem is in PIXI.Text. It calculates text height with rendering character "M" (capital M and it's not configurable), and it probably is not enough to cover those umlaut dots. You probably could patch that part of code or do some workaround as I did. It's a bit silly workaround:

 

Add line feed to text (\n) to make it larger. Still not good, so offset with lineSpacing 10 or something fitting. You need to readjust the text position as it goes a bit off, but atleast text displays correctly.

Link to comment
Share on other sites

  • 3 weeks later...

Problem is in PIXI.Text. It calculates text height with rendering character "M" (capital M and it's not configurable), and it probably is not enough to cover those umlaut dots. You probably could patch that part of code or do some workaround as I did. It's a bit silly workaround:

 

Add line feed to text (\n) to make it larger. Still not good, so offset with lineSpacing 10 or something fitting. You need to readjust the text position as it goes a bit off, but atleast text displays correctly.

Oh, I hadn't thought that that could be the reason. Always learning something new.. This was really helpful, thank you!

Link to comment
Share on other sites

Is it only on this 1 device with phaser V2.2.x that you have problems and that it's ok on other devices with higher Phaser versions?

 

As a quick test, could you try just using the system 'Arial' font, it will handle pretty much anything you want - if that works then check your webfont contains the characters you require.

 

I use V2.2.x and 2.3.x with these characters without problem.

Link to comment
Share on other sites

  • 2 months later...

Getting back to old thread.

 

I suspect it's just depending font. You probably need try try with Arial and capital ÄÖÅ if it's an issue. In anycase, I have not tested with the new Phaser.Text if it's fixing this problem. I saw this in the issues (the padding property should "do" the same trick with better results):

 

https://github.com/photonstorm/phaser/issues/1518

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...