View Single Post
10-28-16, 03:56 PM   #8
Voyager
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 22
Originally Posted by Miiru View Post
You could try this (not tested)

Lua Code:
  1. ....

You can make an addon out of the code with http://addon.bool.no/. There may be some fonts missing though
Thanks for that. Modified it a bit and tested it, setting the font itself seemed unnecessary.

Lua Code:
  1. local function FixFontShadow(obj)
  2.     local x, y = obj:GetShadowOffset()
  3.     if y > -2 and y < 0 then
  4.         obj:SetShadowOffset(x, -2)
  5.     end
  6. end
  7. local f = CreateFrame("Frame")
  8. f:RegisterEvent("PLAYER_LOGIN")
  9. f:SetScript("OnEvent", function()
  10.     f:UnregisterEvent("PLAYER_LOGIN")
  11.  
  12.     FixFontShadow(ChatFontNormal)
  13.     FixFontShadow(NumberFont_Shadow_Med)
  14.     FixFontShadow(AchievementFont_Small)
  15.     FixFontShadow(NumberFont_OutlineThick_Mono_Small)
  16.     FixFontShadow(NumberFont_Outline_Huge)
  17.     FixFontShadow(NumberFont_Outline_Large)
  18.     FixFontShadow(NumberFont_Outline_Med)
  19.     FixFontShadow(NumberFont_Shadow_Small)
  20.     FixFontShadow(SystemFont_InverseShadow_Small)
  21.     FixFontShadow(SystemFont_Large)
  22.     FixFontShadow(SystemFont_Med1)
  23.     FixFontShadow(SystemFont_Med2)
  24.     FixFontShadow(SystemFont_Med3)
  25.     FixFontShadow(SystemFont_OutlineThick_Huge2)
  26.     FixFontShadow(SystemFont_OutlineThick_Huge4)
  27.     FixFontShadow(SystemFont_OutlineThick_WTF)
  28.     FixFontShadow(SystemFont_Outline_Small)
  29.     FixFontShadow(SystemFont_Shadow_Huge1)
  30.     FixFontShadow(SystemFont_Shadow_Huge3)
  31.     FixFontShadow(SystemFont_Shadow_Large)
  32.     FixFontShadow(SystemFont_Shadow_Med1)
  33.     FixFontShadow(SystemFont_Shadow_Med3)
  34.     FixFontShadow(SystemFont_Shadow_Outline_Huge2)
  35.     FixFontShadow(SystemFont_Shadow_Small)
  36.     FixFontShadow(SystemFont_Small)
  37.     FixFontShadow(SystemFont_Tiny)
  38.     FixFontShadow(ReputationDetailFont)
  39.     FixFontShadow(ItemTextFontNormal)
  40.     FixFontShadow(DialogButtonNormalText)
  41.     FixFontShadow(InvoiceTextFontNormal)
  42.     FixFontShadow(InvoiceTextFontSmall)
  43.     FixFontShadow(MailTextFontNormal)
  44.     FixFontShadow(GameFontHighlightSmall)
  45.     FixFontShadow(GameFontNormalSmall)
  46.     FixFontShadow(GameFontNormalSmall2)
  47.     FixFontShadow(GameFontDisableSmall)
  48.     FixFontShadow(GameFontNormalHuge)
  49.     FixFontShadow(GameFontNormalLarge)
  50.     FixFontShadow(GameFontHighlight)
  51.     FixFontShadow(GameFontDisable)
  52.     FixFontShadow(GameFontNormal)
  53.     FixFontShadow(GameFontBlackMedium)
  54.     FixFontShadow(GameFontHighlightMedium)
  55.     FixFontShadow(SubSpellFont)
  56.     FixFontShadow(NumberFontNormalSmall)
  57.     FixFontShadow(NumberFontNormal)
  58.     FixFontShadow(NumberFontNormalLarge)
  59.     FixFontShadow(NumberFontNormalHuge)
  60.     FixFontShadow(WorldMapTextFont)
  61.     FixFontShadow(MovieSubtitleFont)
  62.     FixFontShadow(AchievementPointsFont)
  63.     FixFontShadow(AchievementPointsFontSmall)
  64.     FixFontShadow(AchievementDateFont)
  65.     FixFontShadow(AchievementCriteriaFont)
  66.     FixFontShadow(AchievementDescriptionFont)
  67.     FixFontShadow(FriendsFont_Large)
  68.     FixFontShadow(FriendsFont_Normal)
  69.     FixFontShadow(FriendsFont_Small)
  70.     FixFontShadow(FriendsFont_UserText)
  71.     FixFontShadow(GameTooltipHeaderText)
  72.     FixFontShadow(GameTooltipText)
  73.     FixFontShadow(GameTooltipTextSmall)
  74.     FixFontShadow(ZoneTextString)
  75.     FixFontShadow(SubZoneTextString)
  76.     FixFontShadow(PVPInfoTextString)
  77.     FixFontShadow(PVPArenaTextString)
  78.     FixFontShadow(CombatTextFont)
  79.     FixFontShadow(BackpackTokenFrameToken1Count)
  80.     FixFontShadow(BackpackTokenFrameToken2Count)
  81.     FixFontShadow(BackpackTokenFrameToken3Count)
  82.     FixFontShadow(QuestFontHighlight)
  83.     FixFontShadow(QuestFontNormalSmall)
  84.     FixFontShadow(QuestTitleFont)
  85.     FixFontShadow(QuestFont)
  86.     FixFontShadow(QuestFont_Large)
  87.     FixFontShadow(QuestTitleFontBlackShadow)
  88.     FixFontShadow(QuestFont_Super_Huge)
  89.     FixFontShadow(HelpFrameKnowledgebaseNavBarHomeButtonText)
  90.     FixFontShadow(GameFont_Gigantic)
  91.     FixFontShadow(CoreAbilityFont)
  92.     FixFontShadow(DestinyFontHuge)
  93.     FixFontShadow(DestinyFontLarge)
  94.     FixFontShadow(InvoiceFont_Small)
  95.     FixFontShadow(InvoiceFont_Med)
  96.     FixFontShadow(MailFont_Large)
  97.     FixFontShadow(QuestFont_Shadow_Small)
  98.     FixFontShadow(QuestFont_Shadow_Huge)
  99.     FixFontShadow(QuestFont_Huge)
  100.     FixFontShadow(QuestFont_Enormous)
  101.     FixFontShadow(SpellFont_Small)
  102.     FixFontShadow(SystemFont_Huge1)
  103.     FixFontShadow(SystemFont_OutlineThick_WTF)
  104.     FixFontShadow(SystemFont_OutlineThick_Huge2)
  105.     FixFontShadow(SystemFont_OutlineThick_Huge4)
  106.     FixFontShadow(SystemFont_Outline)
  107.     FixFontShadow(SystemFont_Shadow_Large_Outline)
  108.     FixFontShadow(SystemFont_Shadow_Large2)
  109.     FixFontShadow(SystemFont_Shadow_Med2)
  110.     FixFontShadow(SystemFont_Shadow_Huge2)
  111.     FixFontShadow(SystemFont_Small2)
  112.     FixFontShadow(Tooltip_Med)
  113.     FixFontShadow(Tooltip_Small)
  114.     -----
  115.     FixFontShadow(GameFontNormalMed3)
  116.     FixFontShadow(GameFontNormalHuge2)
  117.     FixFontShadow(GameFontNormalLarge2)
  118.     FixFontShadow(Game30Font)
  119.     FixFontShadow(Game24Font)
  120.     FixFontShadow(Game20Font)
  121.     FixFontShadow(Game18Font)
  122.     FixFontShadow(Fancy24Font) -- e.g. Weekly best @ ChallengesFrame
  123.     FixFontShadow(Fancy16Font)         
  124.     FixFontShadow(Fancy48Font)
  125.     FixFontShadow(Fancy22Font) -- e.g. TalkingHeadFrame TitleFont
  126.     FixFontShadow(Fancy32Font)
  127.     FixFontShadow(SystemFont_LargeNamePlate)
  128.     FixFontShadow(SystemFont_NamePlate)
  129.     FixFontShadow(SystemFont_LargeNamePlateFixed)
  130.     FixFontShadow(SystemFont_NamePlateFixed)
  131.     FixFontShadow(WhiteNormalNumberFont)    -- font shown at tradeskill skillbars
  132.     FixFontShadow(PVPInfoTextFont)
  133.     FixFontShadow(ChatFrame1EditBox)    -- chateditbox input text
  134.     FixFontShadow(ChatFrame1EditBoxHeader)  -- chateditbox say/whisper/guild text
  135.     FixFontShadow(GameTooltipHeader)    -- dungeon journal suggestion font
  136.  
  137.     f:SetScript("OnEvent", nil) -- not sure if this helps saving memory
  138.     f = nil -- not sure if this helps saving memory
  139. end)
  140.  
  141. -- some addon fontstrings need this
  142. local proto = getmetatable(f:CreateFontString()).__index
  143. hooksecurefunc(proto, "SetShadowOffset", function(self, x, y)
  144.     if y > -2 and y < 0 then
  145.         self:SetShadowOffset(x, -2)
  146.     end
  147. end)
  148. hooksecurefunc(proto, "SetFontObject", function(self, ...)
  149.     self:SetShadowOffset(self:GetShadowOffset())
  150. end)

Last edited by Voyager : 10-28-16 at 08:15 PM. Reason: Added code to fix some custom addon fonts that were ignored