Bug Issue: Font size calculation - Engine Version 9480

Pages: 1


  • Level 3 Stencyler
August 03, 2017, 08:36:48 am
Since non legacy version is released I've noticed something wrong with writings. Now I'm exploring the issue and discover that: function Font.font.getTextWidth has an issue regarding the real space assigned to a Text. It seems assign more space than really occupied and it's really boring if you try to align text right.

To achieve this result I create a new Bitmap with height and width calculated from Font and Text then write text on Bitmap using Script.drawTextOnImage function. Bitmap is OxFF000000 coloured and attached you can see the result.

Function Font.font.getTextWidth and Font.getHeight has different results on Android and on Flash. Flash version put more extra space than Android one.

Attached image explanatation:
1 . Font generated with new stencyl version
2. Near Same Font at dot 1 generated with old stencyl version
3. Different font with numbers
4. Another different font with numbers to try to understand if there's a tie from typing and additional space
5. Font generated from image. No issue.
« Last Edit: August 03, 2017, 08:38:10 am by RedEvo »

New attachment added by RedEvo - August 03, 2017, 08:37:15 am


  • Level 3 Stencyler
August 03, 2017, 10:28:40 am
Life it's strange. Using Font.font.getWidth(text,-2) solve the issue for all fonts but create an issue for image fonts. They results short.

Issue updated by Justin - February 01, 2018, 05:35:16 pm
  • Tags added: 3.5 NP


  • Master Stencyler
  • *
February 19, 2018, 11:26:30 am
These font issues are likely caused by changes made a while ago to fix the font line bug and also blur not working.  Those changes were made in 3.4 so I wonder if that extra spacing is even needed any more.  I'll take a look at the font code again and see if I can reduce the added spacing while also making sure the fonts look the same at every scale.  Hopefully I can also change the default engine spacing back to 0 as changing it to -2 has caused some issues.
  • Status changed from New to Assigned
  • Issue Assigned from (none) to rob1221


  • Master Stencyler
  • *
February 20, 2018, 07:53:40 am
Default font spacing in the engine is back to 0 in b9744 so this problem should be fixed.  Some adjustments may have to be made for existing games, and modifying existing fonts will also change their character spacing (fonts generated from the toolset).
  • Status changed from Assigned to Resolved
  • Tags removed: 3.5 NP

Pages: 1


  • Reported
    August 03, 2017, 08:36:48 am
  • Updated
    February 20, 2018, 07:53:40 am

  • View Status
  • Type
  • Status
  • Priority
  • Version
    3.5.0 beta 1
  • Fixed in
  • Assigned to
  • Category



* Fonts.PNG (229.77 kB, 558x376 - viewed 104 times.)