1. Hey! Guest! The 32nd GMC Jam will take place between Feb 22nd, 12:00 UTC (Friday noon) and Feb 25th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 Sprite font messed up after moving project file

Discussion in 'Programming' started by Geoff Jones, Dec 23, 2018.

  1. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Hello all,

    After moving my project folder to a new location, the spacing between the font in-game is messed up. I literally only moved the project file, nothing else has changed. The issue is repeatable. an example below: (I'm using a sprite font.)

    Any ideas?

    Cheers

    code:
    Code:
    global.smallfont= font_add_sprite_ext(s_fnt_small, "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890~=,.!?><[]'{}:;$@#&|_-+*()[]^ ", true, -1)
    
    messed up
    font 1.PNG

    correct
    font 2.PNG
     
  2. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    549
    Looks like there is space between the letters. Try re-importing the image into the font sprite?
     
  3. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Thanks, but didnt work... This is weird.
     
  4. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    549
    Why did you move it? Bring it back maybe? Could be because of the main drive and sandbox folders.
     
  5. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    I reinstalled windows on a new fresh hdd. I still have the old installation of windows on the old drive. Going back to that drive and it works, but the new drive it doesn't.
    Opening the project from the location on the old drive doesn't work either... I can't see any logical reason as to why this isn't working.
     
  6. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    549
    It's just GM, can get bugged/altered easily. Try changing -1 to 0 or editing the image.
     
    Geoff Jones likes this.
  7. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
  8. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Fixed it by copying all of the files from the user/roaming/gamemaketstudio2 from the old drive to the new one... No idea why that fixed it, but I'm glad it did...
     
  9. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Now it';s back to not working....
    I've narrowed it down to somethgin in the C:\Users\Geoff\AppData\Roaming\GameMakerStudio2\Cache\GMS2CACHE\Code_of_th_2B4998_BFEFAC74\Code of the Savage\default\TexturePageEntries folder
     
  10. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
  11. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    549
    Clean the cache, also you can duplicate the sprite and try the new id/name.
     
  12. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    I made an entirely new blank project with nothing but the front. So its blank project, new sprite, new names and it still wont work. What seems to be happening, is it's not clipping all of the blank space around the font:
    I made sure that the empty area around the sprite is %100 empty and not some silly 1% black colour.

    Code:
    font=font_add_sprite_ext(s_font, "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890~=,.!?><[]'{}:;$@#&|_-+*()[]^ ", true, -1)
    
    here is what a "...." should look like, and how it always worked before this mess happened.
    dot-correct.png

    here is what it looks like now:
    dot-incorrect.png

    Here is the font sprite:
    upload_2018-12-26_19-56-53.png
     
  13. Morendral

    Morendral Member

    Joined:
    Jun 27, 2016
    Posts:
    345
    Maybe try changing the sep from -1 to 0 in the code. It looks like a spacing issue, and that looks to be the most likely culprit to me
     
  14. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
  15. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Thanks but its not that. It's set to -1 so that the black outline around each character overlaps.
     
  16. Morendral

    Morendral Member

    Joined:
    Jun 27, 2016
    Posts:
    345
    I understand that, I'm suggesting playing with the value to see if it changes the outcome.
     
  17. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Oh yeah, I've played with the value. it does change the spacing between letters. The issue is that proportional set to true, doesn't seem to be clipping all of the blank space correctly.
     
  18. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    mar_cuz likes this.
  19. mar_cuz

    mar_cuz Member

    Joined:
    Dec 15, 2016
    Posts:
    211
    In the image editor try the magic selection tool for all the empty space around the letters and delete it this has solved some similar issues for me
     
    Geoff Jones likes this.
  20. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Did that already, no go :( Plus im using the exact same image file that has always worked before.
     
  21. mar_cuz

    mar_cuz Member

    Joined:
    Dec 15, 2016
    Posts:
    211
    Have you tried centering all the letters in each square of the sprite or turning all letters into individual frames?
     
  22. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Yes, I've tried having them centred, oriented left, and right. They are individual frames of 1 sprite.
     
  23. mar_cuz

    mar_cuz Member

    Joined:
    Dec 15, 2016
    Posts:
    211
    Sorry if I'm asking obvious questions but have you tried changing the sprite origin?
     
  24. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Yeah no diff :)
     
  25. YanBG

    YanBG Member

    Joined:
    Jun 25, 2016
    Posts:
    549
    Yeah i'd go with "fixing" the image, cut and re-position all letters to connect eachother, so there is no space to their right.
    Edit: oh wait, you have the space because a symbol on the lower rows.
    I'm with 1.4, but could have been a GM update you didn't have before or change to the YoYo code that didn't affect you before for whatever reason. When talking about very huge projects and software i'm not surprised when stuff like this happens.
    Imagine the source code of a AAA game and new team joins to change only a button in MP, which leads to whole servers shutting down.
     
    Geoff Jones likes this.
  26. Jack Bennett

    Jack Bennett Member

    Joined:
    Dec 8, 2018
    Posts:
    20
    Is the font fully dependant on the image, or are you defining the space in code as well? If it's the image, then you might just need to get rid of the space in between the letters. I don't know why it's just suddenly broken though :confused:
     
  27. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Yeah, I've submitted a bug report. That's all I can narrow it down to. I've ruled out everything else. Even created yet another blank project with a single character font that is 1 pixel wide, and it still adds a 1 pixel buffer on either side of the character.
    It'd still be great if someone running 2.x can try my test project and let me what they get. https://www.dropbox.com/s/9lh6km9wqy7bv6b/font test.rar?dl=0
     
  28. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    I'm defining the space by setting the font as a proportional font. I can't get rid of the space on all the letters, because not all the letters are the same width. Otherwise, that would work.
     
  29. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    OK, its 100% a bug. Went back a couple of IDE version and it works as it should. Thanks for your responses!
     
    Jack Bennett likes this.
  30. SaKo

    SaKo Member

    Joined:
    Dec 15, 2017
    Posts:
    2
    Sorry for bringing this thread back but I'm having the exact same problem and it's frustrating. No issues at all previously but some update a few months ago introduced the bug. Hope this gets fixed soon.
     
  31. Geoff Jones

    Geoff Jones Member

    Joined:
    Aug 20, 2016
    Posts:
    482
    Go back to a previous version in the meantime. The bug has apparently been fixed and will be in the next version.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice