Sprite Font Spacing Format?

0 favourites
  • 9 posts
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • Just verifying something: the correct format for doing Sprite Font spacing seems to be:

    [

    [9, "Il"],[10, "i.,'("],[11, ";:!-)[\\/"],[12, "J]<>"],[14, "1"],[15, "j"],[16, "frt*"],[17, "?"],[18, "FLacs_\\"+="],[19, "ESehnz27"],[20, "NPUbdquv358$"],[21, "BCDHZop069"],[22, "Gky4#£"],[23, "KOQRTgx"],[24, "AVX€"],[25, "Y"],[27, "Mw&%"],[30, "m"],[31, "@"],[32, "W"]]

    I tried both of the below in the Spacing Data property of the Sprite Font object, however the spacing is not changing, I imagine it's the incorrect format.

    {"data": [[9, "Il"],[10, "i.,'("],[11, ";:!-)[\/"],[12, "J]<>"],[14, "1"],[15, "j"],[16, "frt*"],[17, "?"],[18, "FLacs_\"+="],[19, "ESehnz27"],[20, "NPUbdquv358$"],[21, "BCDHZop069"],[22, "Gky4#£"],[23, "KOQRTgx"],[24, "AVX€"],[25, "Y"],[27, "Mw&%"],[30, "m"],[31, "@"],[32, "W"]]}

    {""c2array"":true,""size"":[20,2,1],""data"":[[9, ""Il""],[10, ""i.,'(""],[11, "";:!-)[\/""],[12, ""J]<>""],[14, ""1""],[15, ""j""],[16, ""frt*""],[17, ""?""],[18, ""FLacs_\"+=""],[19, ""ESehnz27""],[20, ""NPUbdquv358$""],[21, ""BCDHZop069""],[22, ""Gky4#£""],[23, ""KOQRTgx""],[24, ""AVX€""],[25, ""Y""],[27, ""Mw&%""],[30, ""m""],[31, ""@""],[32, ""W""]]}

    i was referring to this blog post for info:

    [quote:1y3tzn14]Now there's a new 'Spacing data' property that accepts a JSON array of character widths. This is simply an array of a width in pixels, and a string of the characters with that width. For example [6, "il"] means the characters "i" and "l" will appear at six pixels wide instead of the default character width.

    https://www.scirra.com/blog/203/some-bo ... onstruct-3

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The top example is correct. It does work. If I create a default spritefont and use this data, the spacing does change (it's wrong of course), but it does change.

  • Thanks, experimenting with an appropriate font and it looks it now works.

    I hope folks update their assets to include this, would be even better if it could be embedded in the font data itself. Then the spacing could be loaded automatically. I wonder if there is enough space in PNG metadata to include a long string like this.

    Ashley thoughts?

  • sorry to resurrect this old post.. what is the default font that SpriteFont uses? and why isn't there Spacing data already defaulted for it?

    How can get Spacing data for the default SpriteFont font?

  • The default font is mono-spaced, so there is no width data required - it's all the same: 16. It's really not a good example for the spacing feature.

    This will generate the data for you.

  • The default font is mono-spaced, so there is no width data required - it's all the same: 16. It's really not a good example for the spacing feature.

    well, it's supposed to be, but it's not really. Capital 'I', 'T' and many others are not correctly aligned. I guess it's just a not-so-great font sprite.

    I'm teaching a class, and want to start them with SpriteFont instead of the Text object, but that's proving difficult since the default sprite font is not very aesthetically pleasing. And while the GiveYourFontsMonoSpace program is excellent, the workflow is a little too cumbersome for my students.

  • Did people successfully get C3 spacing data to work or do we need to go back to using arrays to arrange spacing?

    Pasting something like this into the Spacing Data field doesn't seem to work:

    [

    [9,"l:.0"],[10,1ijtI"],[12,"f"],[14,"23456789abcdeghkmnopqrsuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ"]]

  • You missed a quote in the '10' section. It works if you fix it.

  • blackhornet You're right. That did the trick! Can't believe I missed that.

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