Not really something fancy, but still quite useful - especially when dealing with getTextWidth()/getTextHeight().
PHP Code:
function getFontZoom() return int(profile.fontSize/16) @ "." @ ((profile.fontSize%16)/16).substring(2);
Example:
PHP Code:
new GuiTextCtrl("MyGuiTextCtrl") {
useOwnProfile = true;
profile.fontSize = 31;
temp.size = getFontZoom(profile.fontSize);
text = "[" @ temp.size @ "]";
x = getTextWidth(temp.size, profile.fontFace, profile.fontStyle, text);
y = getTextHeight(temp.size, profile.fontFace, profile.fontStyle);
}
function getFontZoom(size) return int(size/16) @ "." @ ((size%16)/16).substring(2);
Work's pixel perfectly!
