Is there a command that will return the width & height of the currently set font?
:zzz:
GETFONTSIZE sx##, sy##
And also use LEN (remember kern flag) to see how wide a line of text will be for the currently set font.
Cheers
Crivens,
What do you mean by "remember kern flag" how does this impact me?
There are three possible combinations with the LEN command :
length%=LEN(text$) - Returns number of characters in text$
length%=LEN(text$,FALSE) - Returns the non-proportional text width of text$ using the current font
length%=LEN(text$,TRUE) - Returns the proportional text width of text$ using the current font
No - the LEN(text$, FALSE) will also return the number of characters.
Quote from: Kitty Hello on 2012-Jan-12
No - the LEN(text$, FALSE) will also return the number of characters.
Apparently not :
DEBUG LEN("Test",FALSE)
Returns a value of 32
With a proper font, the following :
DEBUG LEN("Test",FALSE)+"\n"
DEBUG LEN("Test",TRUE)+"\n"
DEBUG LEN("Test")+"\n"
returns :
76
28
4
cool. So the manual needs better specifications. So cool.
You want the box?
vertical information is GETFONTSIZE fx, fy // use fy.
Or did I misunderstand the question?
I was going to say. That's what I do. GETFONTSIZE for height, and LEN (with appropriate kern flag) for width. Full stop nothing more to say.
Cheers
Quote from: Kitty Hello on 2012-Jan-12
cool. So the manual needs better specifications. So cool.
That's the reason that I proposed another function for get text size, like TEXTLEN(). Not mixing string functions with graphic functions. But don't change this now. :)