Kerning font width

Previous topic - Next topic

matchy

Now with extra strength PRINT kerning option, GETFONTSIZE now means GETMAXFONTSIZE  :D. What's a quick way to get total variable string pixel length?  :-[
Code (glbasic) Select

FUNCTION print_center: text$,text_x,text_y //,kerning_on
LOCAL print_x,print_y,max_font_width,max_font_height

GETFONTSIZE max_font_width,max_font_height // temp: set global
print_x=text_x-INTEGER(LEN(text$)*max_font_width/2)
print_y=text_y-INTEGER(max_font_height/2)
PRINT text$,print_x,print_y //,kerning_on
ENDFUNCTION

MrTAToad

LEN(text$,TRUE) ?

matchy

#2
Oh :D

Actually, the original FALSE returns the character count, where TRUE returns the total pixel width. This is good!

MrTAToad