View Single Post
11-09-14, 06:43 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
However, this likely will not affect Bartender's buttons, because it doesn't just inherit from a font object; it also explicitly sets a font:

Code:
	-- adjust hotkey style for better readability
	button.HotKey:SetFont(button.HotKey:GetFont(), 13, "OUTLINE")
	button.HotKey:SetVertexColor(0.75, 0.75, 0.75)

	-- adjust count/stack size
	button.Count:SetFont(button.Count:GetFont(), 16, "OUTLINE")
I use the following code to "fix" the fonts on Bartender buttons:

Code:
local LAB = LibStub("LibActionButton-1.0", true)
if LAB then
	-- Bartender4
	LAB.RegisterCallback("FixFonts", "OnButtonCreated", function(_, self)
		--print("OnButtonCreated", self:GetName())
		local scale = self:GetParent():GetScale()
		local hotkey = _G[self:GetName() .. "HotKey"]
		if hotkey then
			local font, size = NumberFontNormal:GetFont()
			hotkey:SetFont(font, size / scale, "OUTLINE")
		end
		local count = _G[self:GetName() .. "Count"]
		if count then
			local font, size = NumberFontNormal:GetFont()
			count:SetFont(font, size / scale, "OUTLINE")
		end
		local macro = _G[self:GetName() .. "Name"]
		if macro then
			local font, size = GameFontHighlight:GetFont()
			macro:SetFont(font, size / scale, "OUTLINE")
		end
	end)
end
My primary aim is to scale down the fonts, because I've scaled up my buttons a lot, but you could easily adjust the SetFont lines to do whatever you want.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote