WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   SetFont size help please (https://www.wowinterface.com/forums/showthread.php?t=48781)

glupikreten 01-09-14 03:45 AM

SetFont size help please
 
Hi,

I have
customFrame.text = customFrame:CreateFontString(nil, "BACKGROUND", "PVPInfoTextFont");
customFrame.text:SetFont("Fonts\\DAMAGE.ttf",22,"OUTLINE");

Why is 22 font size the biggest i can go in this case? If i put into 48 size remains 22... if i put 20 it scales down a bit as expected.

As you can see i'm not good at lua at all... so if anyone have any advice how to make font bigger ...


************************************
Whole frame
************************************
customFrame=CreateFrame("Frame");
customFrame:ClearAllPoints();
customFrame:SetHeight(30);
customFrame:SetWidth(300);
customFrame:SetScript("OnUpdate", customFrame_OnUpdate);
customFrame:Hide();
customFrame.text = customFrame:CreateFontString(nil, "BACKGROUND", "PVPInfoTextFont");
customFrame.text:SetFont("Fonts\\DAMAGE.ttf",22,"OUTLINE");
customFrame.text:SetAllPoints();
customFrame:SetPoint("CENTER", 0, 250);
customFrameTime = 0;
customFrame:EnableMouse(false)
customFrame:SetMovable(false)

Wimpface 01-09-14 03:49 AM

Code:

customFrame.text = customFrame:CreateFontString(nil, "BACKGROUND", "PVPInfoTextFont");
Try without the red part, does that work? I'm fairly sure the third argument of CreateFontString is just so you don't have to set a font etc. manually, instead it'll inherit the style of an already existing template.

I'm not 100% sure about this, but this is what I gathered from when I was messing around with DailyChecklist.

EDIT: Some more reading on fontstrings
http://wowprogramming.com/docs/widge...eateFontString
http://wowprogramming.com/docs/widgets/FontString
http://wowprogramming.com/docs/widgets/FontInstance

glupikreten 01-09-14 04:02 AM

Tried... no joy :)

Phanx 01-09-14 04:30 AM

There is a maximum absolute size at which WoW will render a font string. For most fonts, this maximum absolute size (in pixels) is reached at a font size (I guess it's points?) of 30-32. If your font is topping out at 22, it's probably oddly designed, with lots of whitespace around each character. Without seeing the actual font file you are using though, I can't say for sure whether that is the problem, but a value of 48 or 9000 will have the same visual effect as a value of 32 even for a "normal" font.

@Wimpface:
Calling SetFont overrides any base font object you set, either by passing a font object to CreateFontstring, or by calling SetFontObject explicitly. Once SetFont is called, your fontstring is no longer considered to "have" a font object (though GetFontObject might still return something) and changes to the font object will no longer propigate to your fontstring, though any properties (like shadows) you don't override will be retained. So, passing a font object to CreateFontstring is not the cause of OP's problem.

Wimpface 01-09-14 06:36 AM

Really? How come I had to remove that argument from the addon I was tinkering with in order for me to use SetFont?

glupikreten 01-09-14 08:30 AM

maybe i could do this instead then to get bigger "font"

customFrame.texture = customFrame:CreateTexture();
customFrame.texture:SetAllPoints();

if customFrame.text == 1 then
customFrame:SetTexture("image1.tga",false);
elseif customFrame.text == 2 then
customFrame:SetTexture("image2.tga",false);
elseif customFrame.text == 3 then
customFrame:SetTexture("image2.tga",false);
end

where image1,2,3.tga would be images of 48 font size?

Phanx 01-09-14 05:20 PM

Quote:

Originally Posted by Wimpface (Post 289427)
Really? How come I had to remove that argument from the addon I was tinkering with in order for me to use SetFont?

Without seeing your code there is absolutely nothing I can tell you, other than that you can use SetFont after setting font object, but not vice versa (you cannot set a font object after using SetFont).

Quote:

Originally Posted by glupikreten (Post 289429)
maybe i could do this instead then to get bigger "font" ... where image1,2,3.tga would be images of 48 font size?

Yes, that approach has been taken by some addons to get bigger "text".


All times are GMT -6. The time now is 09:17 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI