I often find that addons using Ace (like Skada and Shadowed Unit Frames, for example) end up using fonts that have a drop shadow that cannot be turned off, even though there is no mention in the addon itself of adding a shadow to the chosen font.
Is this something in the Ace code? Can it be changed? I'd prefer to not use a drop shadow by default.
it is up to the addon authors to add config for this (has nothing to do with Ace itself)
Why am I getting drop shadows without the individual addons declaring it, then? None of the addons themselves show any code to indicate the addition of drop shadows.
are you talking about the config displaying shadow in the text or the actual addon frame
the config is controlled by Ace everything else is controlled by the addon or another lib the addon is using. best thing to do is contact the author of the addon you want to change and ask them whats going on or if they are willing to add a config for this
also is it a shadow or an outline that you want to remove (2 very different things) (most addons add an outline since it makes the text show up on most backgrounds)
WoW puts shadows on font strings by default. In order to get rid of the shadow, an addon has to explicitly set the shadow offset to 0 after creating the font string.
Here are three screenshots illustrating what I mean:
Image one is of Shadowed Unit Frames, using a thin outline.
Image two is of the same line, but with the outline turned off. Note that the drop shadow still exists.
Image three of Skada's damage meters. The text reading "DPS" has an outline but no drop shadow, while the text below has both an outline and a drop shadow.
Again, in none of these addons can I actually find anywhere that adds a drop shadow to the fonts used. I'd understand if the addon was using a system font instance like GameFontNormal, but I see no reference to any system-defined font, either.
I'm sorry, but no, that's not the point. There is NOTHING in the addon code that declares shadows to be added, or picks a game font that uses a shadow by default. So, it has to be coming from somewhere else. It was already stated above that only certain selected fonts already come with a drop shadow. I've looked through Blizzard's XML files, and could even provide you with a specific list of the fonts that come with drop shadows.
All that to say, no one has definitively answered my question yet: where is the shadow coming from? When an addon uses SetFont, but does not select one of the game's default fonts (e.g. "GameFontNormal") to edit, is WoW auto-assigning a default game font that already contains a shadow?
3. It's not completely correct that BLizzard defaults all built in font strings to have Shadows. This file contains the base fonts that almost all default game fonts ultimately inherit from: http://wowprogramming.com/utils/xmlbrowser/test/FrameXML/Fonts.xml. So if you see a "Shadow" entry in there with values other than zero, then it does in fact default to have a drop shadow set.
So, if the font in question (not sure what all addons you're looking at) happen to inherit from one of these fonts that has the Shadow set, then the way to remove it is to manually call the API's mentioned above against the addons copy of the font (hopefully they are making copies!)
This is why we are saying that it's up to the addon developer to support this. The addon developer needs to explicitly call those API methods if they want to guarantee control over the shadows.
Just as an example, I use in one of my addons GameFontWhite. Here is it's definition as made by BLizzard:
Aha! This one by default has a drop shadow. If I want to disable the drop shadow and still use this font I'll need to explicitly call the API's mentioned above.
I hope this clears things up! If not, then probably something less obvious is going on inside the addon, ****OR**** some other addon is incorrectly modifying the drop shadows on the built in blizz fonts (it's entirely possible). Maybe try turning off all mods but the one you're messing around with and see if the problem goes away? At this point I am suspecting it could be another addon modifying the global font properties and not making a copy of it before modifying it.
Thanks, inthedrops. That was a thorough explanation. I've actually been looking around in Blizzard's XML files for a while now, and actually created my own addon that allows me to freely change font face, size, and style of every major Blizzard default font, so I did in fact already know how Blizzard created its font shadows.
The issue is that I can't see anywhere in the addons I'm using where the addon itself calls a specific Blizzard font to use as its template. As an example, here's Skada's code for assigning fonts, broken down to just the relevant parts:
function mod:ApplySettings(win)
local g = win.bargroup
local p = win.db
g:SetFont(media:Fetch('font', p.barfont), p.barfontsize,"OUTLINE")
end
Then later, the GUI config menu uses a dropdown to select the font, and slider for the font size. Nowhere is it mentioned what the font object should be, though. If that were the case, we should be able to find something like this in the code:
g:SetFontObject("GameFontWhite")
Nothing like that ever shows up, though. So, my assumption is that the addon defaults to some sort of font object if one isn't manually defined. My question is where that default font object is defined. From the feedback this post is getting so far, it sounds like Blizzard defines this, not Ace. I want confirmation on that, though, and I'd ideally also like the name of the default font object that is being used.
Now, you might say, why not just toss in the SetFontObject line into the addons like I have posted above? The answer for that is, "local g" as defined in the code above seems to be a widget that doesn't support the SetFontObject method. Any time I try to add the line, I end up getting an error message reading:
"attempt to call method 'SetFontObject' (a nil value)."
I'm sure there's a way around this, but I'm far too novice in LUA to be able to figure it out (hours of trying and failing is testament to that).
To answer your question, inthedrops: this is happening on a few different addons, but the two I'm primary concerned with are the two I have screenshots of above: Shadowed Unit Frames, and Skada Damage Meters.
The game fonts are referenced when creating the font string. You can still change the font later. The optional 3rd argument to frame:CreateFontstring() is there for you to inherit from a predefined font object.
Some may argue that others are better (and also free), but I like PSPad.
It's so much easier to find stuff in Blizzard's code (and other addons if need be) with the "Search=>Search/Replace in Files" option. It even lets me use regular expressions. :)
I often find that addons using Ace (like Skada and Shadowed Unit Frames, for example) end up using fonts that have a drop shadow that cannot be turned off, even though there is no mention in the addon itself of adding a shadow to the chosen font.
Is this something in the Ace code? Can it be changed? I'd prefer to not use a drop shadow by default.
Why am I getting drop shadows without the individual addons declaring it, then? None of the addons themselves show any code to indicate the addition of drop shadows.
the config is controlled by Ace everything else is controlled by the addon or another lib the addon is using. best thing to do is contact the author of the addon you want to change and ask them whats going on or if they are willing to add a config for this
also is it a shadow or an outline that you want to remove (2 very different things) (most addons add an outline since it makes the text show up on most backgrounds)
screenshots would help
Image one is of Shadowed Unit Frames, using a thin outline.
Image two is of the same line, but with the outline turned off. Note that the drop shadow still exists.
Image three of Skada's damage meters. The text reading "DPS" has an outline but no drop shadow, while the text below has both an outline and a drop shadow.
Again, in none of these addons can I actually find anywhere that adds a drop shadow to the fonts used. I'd understand if the addon was using a system font instance like GameFontNormal, but I see no reference to any system-defined font, either.
All that to say, no one has definitively answered my question yet: where is the shadow coming from? When an addon uses SetFont, but does not select one of the game's default fonts (e.g. "GameFontNormal") to edit, is WoW auto-assigning a default game font that already contains a shadow?
1. You're concerned with Shadows, not Outlines. They are two different things.
2. Therefore the API methods you're interested in are:
3. It's not completely correct that BLizzard defaults all built in font strings to have Shadows. This file contains the base fonts that almost all default game fonts ultimately inherit from: http://wowprogramming.com/utils/xmlbrowser/test/FrameXML/Fonts.xml. So if you see a "Shadow" entry in there with values other than zero, then it does in fact default to have a drop shadow set.
So, if the font in question (not sure what all addons you're looking at) happen to inherit from one of these fonts that has the Shadow set, then the way to remove it is to manually call the API's mentioned above against the addons copy of the font (hopefully they are making copies!)
This is why we are saying that it's up to the addon developer to support this. The addon developer needs to explicitly call those API methods if they want to guarantee control over the shadows.
Just as an example, I use in one of my addons GameFontWhite. Here is it's definition as made by BLizzard:
It inherits GameFontBlack:
Which inherits SystemFont_Med1:
Therefore, by default, GameFontWhite does NOT have a drop shadow. If we wanted to add the ability to change it, we'd use the API's mentioned.
On the other hand, I also use in my addon a default font called GameFontNormalSmall:
Which inherits SystemFont_Shadow_Small:
Aha! This one by default has a drop shadow. If I want to disable the drop shadow and still use this font I'll need to explicitly call the API's mentioned above.
I hope this clears things up! If not, then probably something less obvious is going on inside the addon, ****OR**** some other addon is incorrectly modifying the drop shadows on the built in blizz fonts (it's entirely possible). Maybe try turning off all mods but the one you're messing around with and see if the problem goes away? At this point I am suspecting it could be another addon modifying the global font properties and not making a copy of it before modifying it.
The issue is that I can't see anywhere in the addons I'm using where the addon itself calls a specific Blizzard font to use as its template. As an example, here's Skada's code for assigning fonts, broken down to just the relevant parts:
Then later, the GUI config menu uses a dropdown to select the font, and slider for the font size. Nowhere is it mentioned what the font object should be, though. If that were the case, we should be able to find something like this in the code:
Nothing like that ever shows up, though. So, my assumption is that the addon defaults to some sort of font object if one isn't manually defined. My question is where that default font object is defined. From the feedback this post is getting so far, it sounds like Blizzard defines this, not Ace. I want confirmation on that, though, and I'd ideally also like the name of the default font object that is being used.
Now, you might say, why not just toss in the SetFontObject line into the addons like I have posted above? The answer for that is, "local g" as defined in the code above seems to be a widget that doesn't support the SetFontObject method. Any time I try to add the line, I end up getting an error message reading:
"attempt to call method 'SetFontObject' (a nil value)."
I'm sure there's a way around this, but I'm far too novice in LUA to be able to figure it out (hours of trying and failing is testament to that).
To answer your question, inthedrops: this is happening on a few different addons, but the two I'm primary concerned with are the two I have screenshots of above: Shadowed Unit Frames, and Skada Damage Meters.
http://wowprogramming.com/docs/widgets/Frame/CreateFontString
File:
Skada\lib\SpecializedLibBars-1.0\SpecializedLibBars-1.0.lua
Line 1074:
self:CreateFontString(nil, "OVERLAY", "ChatFontNormal")
Line 1083:
self:CreateFontString(nil, "OVERLAY", "ChatFontNormal")
Get some kind of "search in files" utility.
PSPad is free and does just that. :)
Some may argue that others are better (and also free), but I like PSPad.
It's so much easier to find stuff in Blizzard's code (and other addons if need be) with the "Search=>Search/Replace in Files" option. It even lets me use regular expressions. :)
/cough
Sorry, I got a little carried away.