Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Text is cut off if I use spaces in CreateText?

Author
Message
bigtunacan
9
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 22nd Feb 2016 23:38 Edited at: 22nd Feb 2016 23:42
Does CreateText not support the space character? When I create text without spaces it displays correctly; when I create text with spaces everything after the first space is cut off.

The following code displays "Smarty" on the screen and " Pants" gets cut off.


The following code displays "SmartyPants since there is no space.


Tried this again, but using the default font and it works correctly with default fonts, but not with custom fonts. It could be an issue with custom font file being bad. Has anyone else tested custom fonts exported from bmGlyph?
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 23rd Feb 2016 00:34
Post up your fonts subimages.txt file. The <SPACE> character in ASCII is character 32. Since you are on a Mac, perhaps this have gotten confused with another character (or just plain left out) in your font converter program.

Ideally your font subimages.txt file should look something like this:

---
32:247:255:25:51
33:550:153:10:51
34:467:0:19:51
(snipped for saving some space)
125:488:204:18:51
126:272:255:25:51
127:537:51:14:51
---

This covers all characters from space via numbers and lower and upper case A-Z plus a few other characters. With extended characters, it would run right up to character 255 in the ASCII set, which would add characters with umlauts for the nordic, german, french and spanish languages, amongst others.

The gist of it is, the setFontImage() command need the subimage.txt file to run from 32 to 127. If yours start later than 32, say at 48 (character 0), then if you try and use any characters between 32 and 47 in the ASCII set, AppGameKit will cut your text from that point onwards.

Here is a handy little ASCII chart for all standard characters:

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Feb 2016 09:26 Edited at: 23rd Feb 2016 09:27
What characterset are you using? It's possible if you're using a different characterset on your machine that it's replacing chr( 32 ) (space) with a different character which is corrupting the rest of the string somehow?
bigtunacan
9
Years of Service
User Offline
Joined: 24th Jul 2015
Location:
Posted: 23rd Feb 2016 14:07
I'm working with the developer of bmGlyph on this issue. The output format of their file is reducing the space character in a manner that is not compatible with AGK.
dooz
19
Years of Service
User Offline
Joined: 22nd Sep 2005
Location:
Posted: 3rd Mar 2016 10:24
Hi, I'm having the same issue. I am also seeing strange vertical positioning of lowercase letters, i.e. a 'g' for example, have the bottom sitting level with the bottom of other characters, rather than hanging below.

Good luck, I have bmGlyph too - great tool!
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Mar 2016 12:04
Maybe your text it longer than default max with? I think this could be the case if you are using the percentage system because it's pixel based and percentage is 100x100. Try using this command:

SetTextMaxWidth( iTextIndex, width )
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 3rd Mar 2016 23:11
Isn't there a box text command that can wrap text if it gets too long?
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2016 09:48 Edited at: 4th Mar 2016 09:48
Quote: "Isn't there a box text command that can wrap text if it gets too long?"

That's what SetTextMaxWidth is for. Otherwise I think you have to use an edit box.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Mar 2016 13:25
Ahhh, maybe i was thinking of a boxtext function of my own creation then..

Login to post a reply

Server time is: 2024-11-25 10:55:35
Your offset time is: 2024-11-25 10:55:35