Thread Tools Display Modes
11-09-14, 04:34 PM   #1
feraldrood
A Theradrim Guardian
 
feraldrood's Avatar
Join Date: Dec 2008
Posts: 62
Hotkey/stack text with bartender4

local nfns, font, size = NumberFontNormalSmall
font, size = NumberFontNormalSmall:GetFont()
nfns:SetFont("Fonts\\CharriotDeluxe.ttf", 8, "OUTLINE, MONOCHROME")
nfns:SetShadowColor(0, 0, 0, 0)

Using this code in every imaginable .lua file- even ones not pertaining to bartender (cleanhotkey)

Font for hot-key is still set to about size 10 and is not mono-chromed. The stack text isn't even the font I have specified let alone sizing. What am I doing wrong here?

If anyone is having any luck with monochrome/outline fonts for stack and hotkey in bartender, or any other addon
Tell me how you are doing it!!

also operating off of a freeui base, have messed with all the scripts in that, I was able to get the fonts rendered correctly when I enabled the bars. I am invested in keeping bartender however, so let me know if you have a fix for this.
  Reply With Quote
11-09-14, 06:30 PM   #2
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
If you look through FrameXML/ActionButtonTemplate.xml; you'll see
Hotkey text uses : NumberFontNormalSmallGray
Count text uses : NumberFontNormal
Macro name text uses: GameFontHighlightSmallOutline

If you then search the FrameXML/FontStyles.xml file, you'll find which fonts are inherited into those.

Hotkey -> NumberFontNormalSmallGray -> GameFontNormalSmall -> SystemFont_Shadow_Small ->Fonts\FRIZQT__.TTF
Count -> NumberFontNormal -> NumberFont_Outline_Med -> Fonts\ARIALN.TTF
Macro -> GameFontHighlightSmallOutline -> GameFontHighlightSmall -> GameFontNormalSmall -> SystemFont_Shadow_Small -> Fonts\FRIZQT__.TTF

Just wanted to comment on the long tracking list; this is insane, inherited on inherited and so on.

So what you do is:
Create an add-on with just a frame created that does this:
Lua Code:
  1. local frame = CreateFrame("Frame")
  2. frame:SetScript("OnEvent", function()
  3. SystemFont_Shadow_Small:SetFont("Fonts\\CharriotDeluxe.ttf", 8, "OUTLINE, MONOCHROME")
  4. NumberFont_Outline_Med:SetFont("Fonts\\CharriotDeluxe.ttf", 8, "OUTLINE, MONOCHROME")
  5. end)
  6.  
  7. frame:RegisterEvent("PLAYER_LOGIN")

This could help you.
http://addon.bool.no

Ps. Just quick half-asleep post, not even tested.
__________________
  Reply With Quote
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
11-09-14, 07:07 PM   #4
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Originally Posted by Phanx View Post
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:

[[snipp]]

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.
Thanks for correcting me
__________________
  Reply With Quote
11-09-14, 08:18 PM   #5
feraldrood
A Theradrim Guardian
 
feraldrood's Avatar
Join Date: Dec 2008
Posts: 62
Glorious!

thank you MoonWitch, and thanks for the revision Phanx, code is perfect.

Am such a noob with coding, the help is greatly appreciated.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Hotkey/stack text with bartender4

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off