• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Fonts cut off

DukeSoft

Member
Hey there,

I'm working on a little "phone" within my game, and I'm drawing some fonts in there, on a surface.

Somehow the small letters seem to be cut off. I think @TheSnidr had this issue with some GUI scaling, but I'm not even scaling anything.

Anyone know whats up? (You can see it at the time, it should be 13:41, and the "Connected". Looks like 1 line of pixels is removed :/

upload_2017-7-3_18-1-38.png
 
This can happen if you're stretching your render target inwards after drawing to it, pixel clipping seems entirely random in GM, it doesn't seem to use any sort of interpolation on scaling.
 

DukeSoft

Member
Well, as I said, I'm not doing that. This is a clean game, made a room, made it 1280x720, put object in. No stretching / resizing in any way. :(

EDIT: If it were the render target stretching I shouldn't see it happen if I'm not drawing on the surface, and if it was the application surface I should see the interpolation happen differently if it rotates. It doesn't It really looks like its just the font.
 

FrostyCat

Redemption Seeker
Sometimes the IDE's font glyph cropper does a bad job and clips off part of the character. Go into the project's directory, find the font directory and look at the font's texture sheet. Is the missing part also missing there?
 

Fern

Member
Sometimes the IDE's font glyph cropper does a bad job and clips off part of the character. Go into the project's directory, find the font directory and look at the font's texture sheet. Is the missing part also missing there?
I've had the same issue as Duke. It isn't texture page related. It has to do with some changes they made to fonts. For a while fonts were completely disgusting and broken (unreadable may I add), I'm assuming this is a residual issue. I'd recommend filing this as a bug.
 

rwkay

GameMaker Staff
GameMaker Dev.
Have you resized the application_surface at all?? Please check that it is the size you think it should be.

We have seen this recently and it turned out that the application_surface was set to a much lower size than expected and it meant that the GUI layer was being scaled awkwardly.

Russell
 
Last edited:

DukeSoft

Member
Thanks for the replies guys. I have not scaled any surfaces initially. The room was set to 1280x720.

Drawing the sprites + text the regular way gives the same effect as drawing on a surface, and then drawing that the regular way.

I've tried adding the surface_resize() on the application_surface and display_gui_set_size() in the create event of the object, with the 1280x720 parameters, but to no avail. I'll see if I can reproduce this and upload the project file.
 

DukeSoft

Member
Found the solution!

I was drawing my text like this;
Code:
draw_set_color(c_black);
draw_rectangle(screenx1, screeny1, screenx2, screeny1+13, 0);
draw_set_color(c_white);
draw_set_font(fnt_phone_small);
draw_text(screenx1+4+13, screeny1+2, "Closizon");
draw_sprite(spr_connection, image_index, screenx1+2, screeny1);
draw_set_halign(fa_center);
draw_text(screenx1+(screenx2-screenx1)/2, screeny1+2, "13:41");
Kind of the same for the "connected" one.

Then I figured it was probably because of rounding issues in the /2 part. So, rounding up those positions of drawing fixed my troubles;
Code:
draw_set_color(c_black);
draw_rectangle(screenx1, screeny1, screenx2, screeny1+13, 0);
draw_set_color(c_white);
draw_set_font(fnt_phone_small);
draw_text(screenx1+4+13, screeny1+2, "Closizon");
draw_sprite(spr_connection, image_index, screenx1+2, screeny1);
draw_set_halign(fa_center);
draw_text(screenx1+round((screenx2-screenx1)/2), screeny1+2, "13:41");
upload_2017-7-5_19-33-5.png
 
Top