SpriteFont ignoring spacing/kerning setting for yen (¥) symbol

Not favoritedFavorited Favorited 0 favourites
  • 10 posts
From the Asset Store
Spaces Ambience contains 102 Sounds: 53 track and 49 sounds
  • I am making an updated version of my Tiny Sprite Font, but I notices that the yen (¥) symbol is not affected by the kerning (spacing reduction / spacing data).

    I tried to set it both with actions and in the Spacing Data properties of the SpriteFont. Also I have tried to use large and half size yen symbols, but in all those cases the spacing is ignored and the character is printed at full space.

    Adding backslash \ in front as for the case of " and \ when setting the space properties, does not work too.

    Anyone run into this already? Otherwise I need to bother Ashley again about the SpriteFont.

    As from the screenshot there is a space, but it should be connected as all the others.

    Thank you.

  • It’s working for me.

    I added a sprite font, added the yen to the character set, then drew it in on the image. Then the set character width action worked fine.

    Example:

    dropbox.com/scl/fi/owlta99xjl1kd5f761sbr/spritefont_spacing_test.c3p

  • Thank you R0J0hound for checking it out. I thought to have read that you left the community, so I'm glad to see you are still active here!

    It's great that it's not an issue with Construct, but it's only my side. I tried to copy your Yen character on my project, but it's still not working, so it's not the type of character the issue.

    Spacing is set correctly like in your sample project, so I don't really understand what the issue is at this point.

  • Tried again to replace all the yen symbols, and weird enough I found out that delete didn't work, first time I thought the window was not focused, so I tried it again in all the other places where I have the symbol and basically I have to delete it twice!

    It's like there is an invisible space after the yen, so I delete the invisible space, the cursor is next to the yen and nothing seems to happen, then when deleting again, the yen symbol finally go. I then pasted your yen and it worked fine.

    I guess the problem is that I didn't type the yen from my keyboard, but always copied from the Internet and despite having copied it from several websites, it looks like every one have an invisible space after the yen.

    Well, that seems sorted out.

    By the way, how did you typed your symbol? I am on Linux, so I might not be able to type it in the same way as you, but at least this could be of help for others in the future.

    Thank you again for your time and help!

  • Sorry, to add more info, but I tried again after that the program works fine and deleting the ¥‎ symbol seems again to have the issue of the spacing. It's working, but when deleting there is always the invisible space, so I guess it's something that we need to be careful about. Basically if you just select the yen and delete it instead of positioning the cursor on the right of the symbol and deleting it twice, the invisible space will be still there and will mess up things.

    I tested also on a text editor and it's happening there too.

    That's a weird thing.

    So I went again back on everything. I select the ¥ starting from the left and moving one space to the right, then copied it. I went through all the yen symbols again, delete all from right (twice), then copy the ¥ selected from left to right and finally it seems to have got ridden of all the invisible space.

    Wow that's was a really weird stuff that made me lose a couple of hours for nothing last night!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I just have a normal English keyboard so I used the window accessory “character map”, searched for yen and copied the character from there. But I imagine I could have copied it from anywhere and it would be fine?

    You could use \u{a5} instead of ¥ if the text input accepts escaped sequences.

    If you can consistently reproduce it then it would make it simple to make a bug report. But sounds very odd if something as simple as typing and deleting characters causes issues.

  • I tried with CTRL + SHIFT + U to insert a5 and it typed correctly the yen symbol ¥. Thanks I learn a new thing, by the way. I am still new with Linux.

    The problem seems gone so far. I did only a few more tests and it was fine, so I am not sure if something was wrong because initially I copied from the Internet the symbol or something wrong was on with my computer.

    Funny thing is that later I had to create the .capx file for C2 to add with the SpriteFont for kerning. I didn't want to dig out the old laptop with Windows, so I run C2 on Linux (it doesn't do the preview and doesn't export, but I can save the program). The interesting thing is that there, both the $ and the ¥ symbols had still the invisible space, but there was a one pixel line on the right of both of them, to indicate that there was the invisible (or just 0 pixel wide) space. C3 and even the text editor I have here (Kate), did not show the same red line next to those symbols. Actually the line is red only when editing the text, in the action line it's grayish.

    Not sure if you can see it from the image, but the lines are there both in the action and editing. By the way, C2 runs with Wine. Badly, but it runs.

  • The lines may just be an artifact of the text renderer on Linux or in wine or something.

    To see if that’s an actual character you could open it in c3 and run a len() on that to see if it’s counted as a character. Theres probably other ways to check.

    Typing text is a fundamental feature of edit controls and really it’s controlled by the operating system that the browser and then construct uses. If it is adding extra characters it’s something outside of construct most likely.

  • I run the len expression and yes, the spaces are counted so "$‎¥‎" is actually long 4.

    Typing the ¥ directly from keyboard key combo doesn't create the issue. So again, it's not Construct the issue, but where the character was copied and pasted from.

    I guess we can settle it down, at least we are sure that the issue doesn't come from the engine itself :-)

    Thank you again for taking time to look into it!

  • That's strange for sure. Actually those hidden characters are in that "$‎¥‎" you posted. Using js I'm getting a length of 4 with that and the unicode value of each value is (gotten with the js method .charCodeAt(n)):

    36, 8206, 165, 8206

    36 is $ and 165 is ¥.

    So what is that 8206 (or in hex 0x200E) value? After searching a bit it might be this:

    "Control Character left to right mark"

    en.wikipedia.org/wiki/Implicit_directional_marks

    It's used to switch ordering from "right to left" languages to "left to right".

    Still it's not clear to me why that's added. In your posts it's after the ¥ and $ in quotes in your last post and only after one ¥ in your fourth post. It's not after your other uses of that symbol.

    One way to quickly check for invisible characters is with the browser console. When you type in in a quoted string the invisible characters are shown as circles you can hover the mouse over to see what they are.

    Alarmingly there is a lot of invisible characters.

    invisible-characters.com

    Guess you could bring this up as a suggestion to have a way to show hidden characters in construct to aid with debugging.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)