Stencyl 3.4.0 is now out. Get it now!

Bug Issue: Font size calculation - Engine Version 9480


Pages: 1

RedEvo

  • Subscriber - Stencyl Studio
  • *
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


RedEvo

  • Subscriber - Stencyl Studio
  • *
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.


Pages: 1

Details

  • Reported
    August 03, 2017, 08:36:48 am
  • Updated
    August 03, 2017, 10:28:40 am

  • View Status
    Public
  • Type
    Bug
  • Status
    New
  • Priority
    Normal
  • Version
    3.5.0 beta 1
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Engine

Tags


Attachments


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