Thread Tools Display Modes
01-18-23, 09:37 AM   #1
Theolos
A Deviate Faerie Dragon
Join Date: Aug 2016
Posts: 11
Fonts won't load

Hej!

With the new WotLK-Patch my UI is a desaster... there are a lot of things not working but one of most important one are my fonts...

Can someone tell me why this code wouldn't work anymore? Maybe it isn't something big and can be adjusted fast
Lua Code:
  1. --[[
  2.     modules\misc\fonts.lua
  3.     Basically overrides a crapload of UI fonts to the 'Primary' UI font set in config.
  4.  
  5.     This code is a mixture of my own, Phanx, Tekkub and gmFonts.
  6.  
  7.     Seriously, literally zero credit to me for finding all these font definitions.
  8. ]]
  9. ImpUI_Fonts = ImpUI:NewModule('ImpUI_Fonts', 'AceEvent-3.0');
  10.  
  11. -- Get Locale
  12. local L = LibStub('AceLocale-3.0'):GetLocale('ImprovedBlizzardUI');
  13.  
  14. -- Local Variables
  15. local OSD;
  16.  
  17. -- Local Functions
  18.  
  19. --[[
  20.     Updates a font object and forces it to the specified parameters.
  21.    
  22.     @ return void
  23. ]]
  24. local function SetFont(obj, font, size, style, r, g, b, sr, sg, sb, sox, soy)  
  25.     if (obj == nil) then return end
  26.    
  27.     obj:SetFont(font, size, style)
  28.     if sr and sg and sb then obj:SetShadowColor(sr, sg, sb) end
  29.     if sox and soy then obj:SetShadowOffset(sox, soy) end
  30.     if r and g and b then obj:SetTextColor(r, g, b)
  31.     elseif r then obj:SetAlpha(r) end
  32. end
  33.  
  34. --[[
  35.     Goes through and actually updates as many Blizzard fonts as I'm aware of.
  36.    
  37.     @ return void
  38. ]]
  39. local function UpdateFonts()
  40.     local primaryFont = LSM:Fetch('font', ImpUI.db.profile.primaryInterfaceFont);
  41.  
  42.     UNIT_NAME_FONT     = primaryFont;
  43.     DAMAGE_TEXT_FONT   = primaryFont;
  44.     STANDARD_TEXT_FONT = primaryFont;
  45.     NAMEPLATE_FONT     = primaryFont;
  46.    
  47.     SetFont(AchievementFont_Small,              primaryFont, 11);
  48.     SetFont(FriendsFont_Large,                  primaryFont, 14, nil, nil, nil, nil, 0, 0, 0, 1, -1);
  49.     SetFont(FriendsFont_Normal,                 primaryFont, 12, nil, nil, nil, nil, 0, 0, 0, 1, -1);
  50.     SetFont(FriendsFont_Small,                  primaryFont, 10, nil, nil, nil, nil, 0, 0, 0, 1, -1);
  51.     SetFont(FriendsFont_UserText,               primaryFont, 11, nil, nil, nil, nil, 0, 0, 0, 1, -1);
  52.     SetFont(GameTooltipHeader,                  primaryFont, 14, 'OUTLINE');
  53.     SetFont(GameFont_Gigantic,                  primaryFont, 31, nil, nil, nil, nil, 0, 0, 0, 1, -1);
  54.     SetFont(GameNormalNumberFont,               primaryFont, 10);
  55.     SetFont(InvoiceFont_Med,                    primaryFont, 12, nil, 0.15, 0.09, 0.04);
  56.     SetFont(InvoiceFont_Small,                  primaryFont, 10, nil, 0.15, 0.09, 0.04);
  57.     SetFont(MailFont_Large,                     primaryFont, 14, nil, 0.15, 0.09, 0.04, 0.54, 0.4, 0.1, 1, -1);
  58.     SetFont(NumberFont_OutlineThick_Mono_Small, primaryFont, 12, 'OUTLINE');
  59.     SetFont(NumberFont_Outline_Huge,            primaryFont, 29, 'THICKOUTLINE', 30);
  60.     SetFont(NumberFont_Outline_Large,           primaryFont, 16, 'OUTLINE');
  61.     SetFont(NumberFont_Outline_Med,             primaryFont, 14, 'OUTLINE');
  62.     SetFont(NumberFont_Shadow_Med,              primaryFont, 13);
  63.     SetFont(NumberFont_Shadow_Small,            primaryFont, 11);
  64.     SetFont(QuestFont_Shadow_Small,             primaryFont, 15);
  65.     SetFont(QuestFont_Large,                    primaryFont, 15);
  66.     SetFont(QuestFont_Shadow_Huge,              primaryFont, 18, nil, nil, nil, nil, 0.54, 0.4, 0.1);
  67.     SetFont(QuestFont_Super_Huge,               primaryFont, 23);
  68.     SetFont(ReputationDetailFont,               primaryFont, 11, nil, nil, nil, nil, 0, 0, 0, 1, -1);
  69.     SetFont(SpellFont_Small,                    primaryFont, 10);
  70.     SetFont(SystemFont_InverseShadow_Small,     primaryFont, 10);
  71.     SetFont(SystemFont_Large,                   primaryFont, 16);
  72.     SetFont(SystemFont_Med1,                    primaryFont, 12);
  73.     SetFont(SystemFont_Med2,                    primaryFont, 13, nil, 0.15, 0.09, 0.04);
  74.     SetFont(SystemFont_Med3,                    primaryFont, 14);
  75.     SetFont(SystemFont_OutlineThick_Huge2,      primaryFont, 21, 'THICKOUTLINE');
  76.     SetFont(SystemFont_OutlineThick_Huge4,      primaryFont, 26, 'THICKOUTLINE');
  77.     SetFont(SystemFont_OutlineThick_WTF,        primaryFont, 30, 'THICKOUTLINE', nil, nil, nil, 0, 0, 0, 1, -1);
  78.     SetFont(SystemFont_Outline_Small,           primaryFont, 12, 'OUTLINE');
  79.     SetFont(SystemFont_Shadow_Huge1,            primaryFont, 19);
  80.     SetFont(SystemFont_Shadow_Huge3,            primaryFont, 24);
  81.     SetFont(SystemFont_Shadow_Large,            primaryFont, 16);
  82.     SetFont(SystemFont_Shadow_Med1,             primaryFont, 12);
  83.     SetFont(SystemFont_Shadow_Med2,             primaryFont, 13);
  84.     SetFont(SystemFont_Shadow_Med3,             primaryFont, 14);
  85.     SetFont(SystemFont_Shadow_Outline_Huge2,    primaryFont, 21, 'OUTLINE');
  86.     SetFont(SystemFont_Shadow_Small,            primaryFont, 10);
  87.     SetFont(SystemFont_Small,                   primaryFont, 11);
  88.     SetFont(SystemFont_Tiny,                    primaryFont, 10);
  89.     SetFont(Tooltip_Med,                        primaryFont, 12);
  90.     SetFont(Tooltip_Small,                      primaryFont, 11);
  91.     SetFont(WhiteNormalNumberFont,              primaryFont, 10);
  92.     SetFont(BossEmoteNormalHuge,                primaryFont, 26, 'THICKOUTLINE');
  93.     SetFont(CombatTextFont,                     primaryFont, 25);
  94.     SetFont(ErrorFont,                          primaryFont, 15, nil, 60);
  95.     SetFont(QuestFontNormalSmall,               primaryFont, 12, nil, nil, nil, nil, 0.54, 0.4, 0.1);
  96.     SetFont(WorldMapTextFont,                   primaryFont, 30, 'THICKOUTLINE',  40, nil, nil, 0, 0, 0, 1, -1);
  97.     SetFont(ChatBubbleFont,                     primaryFont, 12);
  98.     SetFont(CoreAbilityFont,                    primaryFont, 31);
  99.     SetFont(DestinyFontHuge,                    primaryFont, 31);
  100.     SetFont(DestinyFontLarge,                   primaryFont, 17);
  101.     SetFont(Game18Font,                         primaryFont, 17);
  102.     SetFont(Game24Font,                         primaryFont, 23);
  103.     SetFont(Game27Font,                         primaryFont, 26);
  104.     SetFont(Game30Font,                         primaryFont, 29);
  105.     SetFont(Game32Font,                         primaryFont, 31);
  106.     SetFont(NumberFont_GameNormal,              primaryFont, 9);
  107.     SetFont(NumberFont_Normal_Med,              primaryFont, 13);
  108.     SetFont(NumberFont_GameNormal,              primaryFont, 12);
  109.     SetFont(QuestFont_Enormous,                 primaryFont, 29);
  110.     SetFont(QuestFont_Huge,                     primaryFont, 18);
  111.     SetFont(QuestFont_Super_Huge_Outline,       primaryFont, 23, 'OUTLINE');
  112.     SetFont(SplashHeaderFont,                   primaryFont, 23);
  113.     SetFont(SystemFont_Huge1,                   primaryFont, 19);
  114.     SetFont(SystemFont_Huge1_Outline,           primaryFont, 19, 'OUTLINE');
  115.     SetFont(SystemFont_Outline,                 primaryFont, 12, 'OUTLINE');
  116.     SetFont(SystemFont_Shadow_Huge2,            primaryFont, 23);
  117.     SetFont(SystemFont_Shadow_Large2,           primaryFont, 18);
  118.     SetFont(SystemFont_Shadow_Large_Outline,    primaryFont, 16, 'OUTLINE');
  119.     SetFont(SystemFont_Shadow_Med1_Outline,     primaryFont, 11, 'OUTLINE');
  120.     SetFont(SystemFont_Shadow_Small2,           primaryFont, 10);
  121.     SetFont(SystemFont_Small2,                  primaryFont, 11);
  122.    
  123.     if (Helpers.IsRetail()) then
  124.         for _,butt in pairs(PaperDollTitlesPane.buttons) do butt.text:SetFontObject(GameFontHighlightSmallLeft); end
  125.     end
  126. end
  127.  
  128. --[[
  129.     Fires when the Primary Interface Font config option changes.
  130.    
  131.     @ return void
  132. ]]
  133. function ImpUI_Fonts:PrimaryFontUpdated()
  134.     local warning = L['A /reload may be required after updating the primary font!'];
  135.  
  136.     ImpUI:Print(warning);
  137.  
  138.     OSD:AddMessage( warning, ImpUI.db.profile.primaryInterfaceFont, 22, 1, 1, 0, 5.0 );
  139.  
  140.     UpdateFonts();
  141. end
  142.  
  143. --[[
  144.     Fires when the module is Initialised.
  145.    
  146.     @ return void
  147. ]]
  148. function ImpUI_Fonts:OnInitialize()
  149. end
  150.  
  151. --[[
  152.     Fires when the module is Enabled. Set up frames, events etc here.
  153.    
  154.     @ return void
  155. ]]
  156. function ImpUI_Fonts:OnEnable()
  157.     OSD = ImpUI:GetModule('ImpUI_OSD');
  158.  
  159.     UpdateFonts();
  160. end
  161.  
  162. --[[
  163.     Clean up behind ourselves if needed.
  164.    
  165.     @ return void
  166. ]]
  167. function ImpUI_Fonts:OnDisable()
  168. end

I got this from ImprovedBlizzardUI. Yeah an old addon and maybe the problem goes deeper than just the font module but I just give it a try...

Already tried replacing my systemfont by creating an "Fonts" folder in _classic_ and name the font "FRIZQT__.ttf" but this also doesn't seem to work :-/

thank you very much for your time!
  Reply With Quote
01-18-23, 09:55 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,813
It's more likely because SetFont requires a style or at least an empty string ("") as the third argument.

Code:
obj:SetFont(font, size, style or "")
There may be other instances that require changing.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-18-23, 01:00 PM   #3
Theolos
A Deviate Faerie Dragon
Join Date: Aug 2016
Posts: 11
Originally Posted by Fizzlemizz View Post
It's more likely because SetFont requires a style or at least an empty string ("") as the third argument.

Code:
obj:SetFont(font, size, style or "")
There may be other instances that require changing.
first I want to thank you very much for your time! it actually worked ... once ... and now I get the following error message. I know I am asking for too much but it would be really great if I could get the fonts to work again... they are such a crucial part of the feeling :-|

1x ...aceImprovedBlizzardUI/modules/misc/fonts.lua:31: bad argument #1 to 'SetAlpha' (Usage: self:SetAlpha(alpha))
[string "=[C]"]: in function `SetAlpha'
[string "@ImprovedBlizzardUI/modules/misc/fonts.lua"]:31: in function <...aceImprovedBlizzardUI/modules/misc/fonts.lua:24>
[string "@ImprovedBlizzardUI/modules/misc/fonts.lua"]:59: in function <...aceImprovedBlizzardUI/modules/misc/fonts.lua:39>
[string "@ImprovedBlizzardUI/modules/misc/fonts.lua"]:159: in function <...aceImprovedBlizzardUI/modules/misc/fonts.lua:156>
[string "=[C]"]: ?
[string "@ImprovedBlizzardUI/Libs/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:70: in function <...edBlizzardUI/Libs/Ace3/AceAddon-3.0/AceAddon-3.0.lua:65>
[string "@ImprovedBlizzardUI/Libs/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:527: in function `EnableAddon'
[string "@ImprovedBlizzardUI/Libs/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:540: in function `EnableAddon'
[string "@ImprovedBlizzardUI/Libs/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:630: in function <...edBlizzardUI/Libs/Ace3/AceAddon-3.0/AceAddon-3.0.lua:615>
  Reply With Quote
01-18-23, 01:38 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,813
At a guess you could try changing line 59 from
Code:
SetFont(NumberFont_Outline_Huge,            primaryFont, 29, 'THICKOUTLINE', 30)
to
Code:
SetFont(NumberFont_Outline_Huge,            primaryFont, 29, 'THICKOUTLINE')
SetAlpha values go from 0 to 1 so I'm not sure what the 30 is supposed to represent other than a typo that was previously ignored.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-18-23, 02:53 PM   #5
Theolos
A Deviate Faerie Dragon
Join Date: Aug 2016
Posts: 11
Originally Posted by Fizzlemizz View Post
At a guess you could try changing line 59 from
Code:
SetFont(NumberFont_Outline_Huge,            primaryFont, 29, 'THICKOUTLINE', 30)
to
Code:
SetFont(NumberFont_Outline_Huge,            primaryFont, 29, 'THICKOUTLINE')
SetAlpha values go from 0 to 1 so I'm not sure what the 30 is supposed to represent other than a typo that was previously ignored.
OKAY! The fonts are back in the game, thank you so much! idk why but my inventorynumbers are missing their outline
I was able to detect line 61 as the one for the inventory numbers and after trying different approaches I wasn't able to give them a outline, only changing the font size but not their color or give them a shadow/outline



we are so close to perfection!!^^ sorry for being so bold and offering nothing in exchange for your help! I really tried it myself but .. I can't do it.
  Reply With Quote
01-18-23, 04:09 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,813
Try changing

Code:
'THICKOUTLINE'
to
Code:
'OUTLINE, THICK'
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-19-23, 05:49 AM   #7
Theolos
A Deviate Faerie Dragon
Join Date: Aug 2016
Posts: 11
Originally Posted by Fizzlemizz View Post
Try changing

Code:
'THICKOUTLINE'
to
Code:
'OUTLINE, THICK'
didn't work, sadly. maybe SetOutlineColor is missing? so I would have to define a color for the outline?

EDIT: Deleted all WTF-Files and only activtated that addon but it doesn't work sadly
EDIT2: Ok, now I at least know the reason for SetAlpha-Error before... "Region:SetAlpha now only accepts values between 0 and 1 inclusive."

Last edited by Theolos : 01-19-23 at 06:56 AM.
  Reply With Quote
01-19-23, 09:04 AM   #8
Theolos
A Deviate Faerie Dragon
Join Date: Aug 2016
Posts: 11
Finally...the war is over

Ok, I finally got the solution! Thanks to u/PyramidClub from Reddit. By replacing
Code:
obj:SetFont(font, size, style)
with
Code:
obj:SetFont(font, size, '')
the local setFont function ignored all parameters and set the style to ""

by adding a check to make sure it is not nil, I just had to add
Code:
style = style or ''
just wanted to close the topic which costed me hours and hours by this post :-)

thank you again for your help, Fizzlemizz and have a nice day!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Fonts won't load

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