02-26-11, 10:20 AM | #1 |
GameFontBlack
Is there any way to change this font? color? :<
i've tryed and not working Code:
for _, font in pairs({ _G["GameFontBlack"], }) do font:SetFont('Fonts\\ARIALN.ttf', 14, 'THINOUTLINE') font:SetTextColor(1, 1, 1) end |
|
02-26-11, 11:43 AM | #2 |
Is this snippet part of something? What is _G["GameFontBlack"]? Are you sure it contains FontString objects?
Does Code:
for _, font in pairs({ _G["GameFontBlack"], }) do print(font:GetTextColor(1, 1, 1)) end You can't recolor black textures. If the fonts textures are black font:SetTextColor(1, 1, 1) won't work. But the fonts path is 'Fonts\\ARIALN.ttf' - which is imho a wow standard font. So this can't be the problem. |
|
02-26-11, 03:37 PM | #3 | |
|
||
02-26-11, 03:43 PM | #4 |
GameFontBlack isn't a Font it's a FontStyle.
|
|
02-26-11, 03:52 PM | #5 |
Right. You'll have to change anything that uses GameFontBlack.
|
|
02-26-11, 05:40 PM | #6 |
Try this.
lua Code:
__________________
|
|
02-26-11, 06:40 PM | #7 | |
|
||
02-27-11, 02:47 AM | #8 | |
That's how I replace fonts in my UI: lua Code:
You'd need to replace media.font[...] references (name / filepath pairs) and AddCallback with your own PLAYER_LOGIN event handler. Last edited by hankthetank : 02-27-11 at 10:30 AM. |
||
hankthetank |
View Public Profile |
Find More Posts by hankthetank |
02-27-11, 08:54 AM | #9 |
I've wrestled with the same issue as the OP. The FontObjects used in some of the Quest Log & Acheivements pane text (GameFontBlack, SystemFont_Small, QuestFont) will respond to all of the SetFont arguments, but do not respond to SetTextColor. This results in the unhappy, and mostly illegible, dark text with dark outline.
To my understanding, SetTextColor doesn't override anything; it only affects text not being colored by something else. I've being poking around the FrameXML files for what might be coloring SystemFont_Small text dark brown. My workaround in the meantime is to remove the outline flag from the dark colored FontObjects. I use the method sacrife posted above, from Tukui, which lets you use different settings per object: Lua Code:
BTW, are "OUTLINE" & "THINOUTLINE" the same thing, and if so have they always been? |
|
02-27-11, 09:45 AM | #10 | |
@ hank haven't tried it yet, so ^^ |
||
02-27-11, 10:14 AM | #11 |
If a FontString inherits from a font set by SetFontObject() and overrides, say the color via SetFontColor() I'm pretty sure that your changes to the FontObject's color won't affect the FontString. Maybe that's the reason or the FontString uses inline color codes (|c.....|r)
Last edited by hankthetank : 02-27-11 at 10:25 AM. |
|
hankthetank |
View Public Profile |
Find More Posts by hankthetank |
02-27-11, 10:23 AM | #12 |
02-27-11, 10:49 AM | #13 |
02-27-11, 10:54 AM | #14 |
The code does work. Not sure what you're talking about.
|
|
02-27-11, 11:09 AM | #15 |
Nop, it didnt :<
|
|
02-27-11, 12:06 PM | #16 |
If you mean recolor doesn't work, I know. As I said these FontObjects don't appear to respond SetTextColor.
In your case the quest text color is yellow, and appears to be a lesser strata than its parent window. Is the addon that retextures the window also coloring the text? Here's mine w/code I posted: |
|
02-27-11, 01:52 PM | #17 | |
It appears the text is set up for "Parchment" material by default and makes a call to GetMaterialTextColors() to get new colors if a different material is to be used.
Here are the related XML objects and Lua code you should look at for making that specific modification. QuestInfo.xml:282 xml Code:
QuestInfo.lua:29 lua Code:
__________________
WoWInterface AddOns
|
||
02-27-11, 04:07 PM | #18 | |
local QuestInfo_Display = function(template, parentFrame, acceptButton, material) QuestInfoDescriptionText:SetTextColor(1, 1, 1) QuestInfoObjectivesText:SetTextColor(1, 1, 1) QuestInfoGroupSize:SetTextColor(1, 1, 1) QuestInfoRewardText:SetTextColor(1, 1, 1) QuestInfoTitleHeader:SetTextColor(0.95, 0.95, 0) QuestInfoDescriptionHeader:SetTextColor(0.95, 0.95, 0) QuestInfoObjectivesHeader:SetTextColor(0.95, 0.95, 0) QuestInfoRewardsHeader:SetTextColor(0.95, 0.95, 0) QuestInfoItemChooseText:SetTextColor(1, 1, 1) QuestInfoItemReceiveText:SetTextColor(1, 1, 1) QuestInfoSpellLearnText:SetTextColor(1, 1, 1) QuestInfoXPFrameReceiveText:SetTextColor(1, 1, 1) end hooksecurefunc('QuestInfo_Display', QuestInfo_Display) worked perfect. |
||
02-27-11, 05:54 PM | #19 |
I tried it too and it works! I wonder if other font colors are set with a secure function?
@hankthetank: your font object "getter" is awesome...had no idea it could be done that way. I haven't used it yet to set my fonts, but was able to pull a huge list of font objects with: lua Code:
ty! |
|
02-27-11, 08:44 PM | #20 | |
Nothing indicates that it's secure code. You should be able to just replace if you want to.
Perhaps just set the text color the way you want it and recode the function so it doesn't bother with it, something like this lua Code:
__________________
WoWInterface AddOns
|
||
WoWInterface » Developer Discussions » Lua/XML Help » GameFontBlack |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|