Thread Tools Display Modes
12-11-13, 04:40 PM   #1
BillieJackFu
A Fallenroot Satyr
 
BillieJackFu's Avatar
Join Date: Jun 2009
Posts: 28
Fontain (Code Fix)

Alright, I've been using an outdated Addon called Fontain for years now with no issue, but 5.4.2 has finally broke the addon. The project is dead and I'm hoping someone can fix the code that seems to be throwing the error. I have snipped the code out and it has something to do with metatables and I'm not a programmer

Code:
	for k, v in pairs(_G) do
		-- pcall needed to protect against tables with metatables.
		if type(v) == "table" then
			local meta = getmetatable(v)
			if meta and meta.__index and type(meta.__index) == "table" and meta.__index.GetFont and v:GetObjectType() == "Font" then
				tinsert(fontList, v)
			end
		end
	end
If there is another addon out there where I can edit every font in the UI, I'll take that route, but I haven't been able to find one. Fontain is the single font addon which makes my UI unique.
  Reply With Quote
12-11-13, 05:01 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I use tekticles with some minor modifications. I have no idea why you would need metatables to change fonts... o_O
__________________
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
12-11-13, 05:13 PM   #3
BillieJackFu
A Fallenroot Satyr
 
BillieJackFu's Avatar
Join Date: Jun 2009
Posts: 28
I'm trying to figure out why any Font addon that worked has been abandoned, I really like the functionality of Fontain, it allows for different profiles etc. Oh well looks like I'm going the \<Wow Directory>\Fonts\ route from here forward.
  Reply With Quote
12-11-13, 05:24 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Putting files in a Fonts folder will work, but it won't let you change the sizes; that's why I use tekticles, to make fonts bigger across the board without scaling up the whole UI. If that's not a feature you care about, though, and you just want to change the font itself, then there's not really a reason to use an addon.
__________________
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
12-11-13, 05:27 PM   #5
BillieJackFu
A Fallenroot Satyr
 
BillieJackFu's Avatar
Join Date: Jun 2009
Posts: 28
The problem is, that fonts are pretty broad.

I want:

Player Names > x Font
Quest Log > y Font
Tooltips > z Font

But when using just a Fonts folder, x, y, z are all the same font. That's why I liked Fontain so much and it was based off Tektickles (with permission) as stated in the Fontain.lua
  Reply With Quote
12-11-13, 05:38 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, you can certainly do that with tekticles. It doesn't have in-game configuration, but the code is pretty self-explanatory. For example, I do use the same font for everything, but I only use regular and bold variations, no italics, and I don't use the font that comes with tekticles, so I changed the font definitions at the top to read:

Code:
local NORMAL     = [[Interface\AddOns\PhanxMedia\font\DejaWeb.ttf]]
local BOLD       = [[Interface\AddOns\PhanxMedia\font\DejaWeb-Bold.ttf]]
local BOLDITALIC = BOLD
local ITALIC     = NORMAL
local NUMBER     = BOLD
If you wanted to use, say, ThisFont for player names, and ThatFont in tooltips, you could set the normal font to ThisFont, and add another variable for your second font:

Code:
local ALTERNATE      = "Interface\\AddOns\\MyFonts\\ThatFont.ttf"
local ALTERNATE_BOLD = "Interface\\AddOns\\MyFonts\\ThatFont.ttf"
... and then pass that for all the tooltip fonts:

Code:
	SetFont(Tooltip_Med,                        ALTERNATE, 13)
	SetFont(Tooltip_Small,                 ALTERNATE_BOLD, 12)
__________________
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
12-11-13, 05:44 PM   #7
BillieJackFu
A Fallenroot Satyr
 
BillieJackFu's Avatar
Join Date: Jun 2009
Posts: 28
I'm not a programmer, I mean I can find things that break addons, but if I could create my own font addon, I would do it. The only programming experience I have is with Visual Basic.NET and that was in college. So you're speaking a foreign language right now.

Oh I see, find the corresponding SetFont in tekticles.lua and change it to what I want.

Last edited by BillieJackFu : 12-11-13 at 05:53 PM.
  Reply With Quote
12-11-13, 06:07 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Yep. Most (though not all) of the game's font objects are sensibly named. If there's a particular font you're trying to change and you're not sure which one it is, describe where it's shown in the UI and I'll try to figure it out for you.
__________________
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
12-11-13, 06:17 PM   #9
BillieJackFu
A Fallenroot Satyr
 
BillieJackFu's Avatar
Join Date: Jun 2009
Posts: 28
Well ALTERNATE / ALTERNATE_BOLD isn't working, tooltips for Ara Guild / Friends keeps using my normal font selection.

Quest isn't using the alternates I setup either:


Last edited by BillieJackFu : 12-11-13 at 06:20 PM.
  Reply With Quote
12-11-13, 08:18 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Most likely those particular addons are not using the appropriate font objects (eg. Ara / Guild Friends is not using the tooltip-specific font objects for its custom tooltip, and is probably using something like GameFontNormal instead). You'd have to either edit the addon's code, or add some extra code in tekticles to hook into the addon and fix it from outside.
__________________
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
12-12-13, 06:57 AM   #11
BillieJackFu
A Fallenroot Satyr
 
BillieJackFu's Avatar
Join Date: Jun 2009
Posts: 28
Originally Posted by Phanx View Post
Most likely those particular addons are not using the appropriate font objects (eg. Ara / Guild Friends is not using the tooltip-specific font objects for its custom tooltip, and is probably using something like GameFontNormal instead). You'd have to either edit the addon's code, or add some extra code in tekticles to hook into the addon and fix it from outside.
So the code that Ara Guild Friends has is

Code:
local baseFont = GameFontNormal:GetFont()
How do I set it as something different? Do I edit it in Ara Guild Friends or in tekticles?

Or would this work...

Code:
local baseFont = "Interface\\AddOns\\BJF_Fonts\\ap.ttf"
Or something similar to that. (BJF_Fonts) is the folder where I have stored my fonts.

Last edited by BillieJackFu : 12-12-13 at 07:04 AM.
  Reply With Quote
12-12-13, 06:37 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Based on that, it looks like the problem is that Ara Guild Friends isn't actually using the GameFontNormal font object -- it's just copying whatever properties the font object had when it loaded. This means that if the properties of the font object get changed later (eg. when tekticles loads) Ara Guild Friends doesn't get the memo.

The change you posted (hardcoding the font path) should work.

Also, you can combine both methods -- put the fonts you want to use in most places in a Fonts folder -- and then use tekticles (or whatever) to change the other fonts and sizes. This will at least make all your addons use a font you like without code edits.
__________________
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

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Fontain (Code Fix)


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