Skip to content

Commit

Permalink
fix: some font objects do not follow the 'FontOutline' option
Browse files Browse the repository at this point in the history
  • Loading branch information
ffainy committed Jun 22, 2022
1 parent 92d1f97 commit c6d84ba
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gui/extra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function GUI:CreateScroll(parent, width, height, text, noBg)
end

if text then
F.CreateFS(scroll, C.Assets.Font.Regular, 12, 'OUTLINE', text, nil, true, 'TOPLEFT', 5, 20)
F.CreateFS(scroll, C.Assets.Font.Regular, 12, true, text, nil, true, 'TOPLEFT', 5, 20)
end

if not noBg then
Expand Down
10 changes: 6 additions & 4 deletions gui/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ local function CreateTab(parent, i, name)
tab.icon:SetTexture(iconsList[i])
F.ReskinIcon(tab.icon)

tab.text = F.CreateFS(tab, C.Assets.Font.Bold, 13, nil, name, nil, true)
local outline = _G.FREE_ADB.FontOutline
tab.text = F.CreateFS(tab, C.Assets.Font.Bold, 13, outline, name, nil, outline or 'THICK')
tab.text:SetPoint('LEFT', tab.icon, 'RIGHT', 6, 0)

tab:HookScript('OnEnter', Tab_OnEnter)
Expand Down Expand Up @@ -269,6 +270,7 @@ end

local function CreateOption(i)
local parent, offset = guiPage[i].child, 20
local outline = _G.FREE_ADB.FontOutline

for _, option in pairs(GUI.OptionsList[i]) do
local optType, key, value, name, horizon, data, callback, tip = unpack(option)
Expand All @@ -289,7 +291,7 @@ local function CreateOption(i)
cb.__name = name
cb.__callback = callback

cb.label = F.CreateFS(cb, C.Assets.Font.Regular, 12, nil, name, nil, true)
cb.label = F.CreateFS(cb, C.Assets.Font.Regular, 12, outline, name, nil, outline or 'THICK')
cb.label:SetPoint('LEFT', cb, 'RIGHT', 4, 0)

cb:SetChecked(UpdateValue(key, value))
Expand Down Expand Up @@ -322,7 +324,7 @@ local function CreateOption(i)
eb.__callback = callback
eb.__default = (key == 'ACCOUNT' and C.AccountSettings[value]) or C.CharacterSettings[key][value]

eb.label = F.CreateFS(eb, C.Assets.Font.Regular, 11, nil, name, nil, true, 'CENTER', 0, 20)
eb.label = F.CreateFS(eb, C.Assets.Font.Regular, 11, outline, name, nil, outline or 'THICK', 'CENTER', 0, 20)
eb:SetText(UpdateValue(key, value))

eb:HookScript('OnEscapePressed', Editbox_OnEscapePressed)
Expand Down Expand Up @@ -391,7 +393,7 @@ local function CreateOption(i)
end
end

dd.label = F.CreateFS(dd, C.Assets.Font.Regular, 11, nil, name, nil, true)
dd.label = F.CreateFS(dd, C.Assets.Font.Regular, 11, outline, name, nil, outline or 'THICK')
dd.label:SetPoint('BOTTOM', dd, 'TOP', 0, 4)
if tip then
dd.title = name
Expand Down
7 changes: 4 additions & 3 deletions modules/chat/copy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ function CHAT:ChatCopy_OnClick()
if not frame:IsShown() then
local chatframe = _G.SELECTED_DOCK_FRAME
local _, fontSize = chatframe:GetFont()
_G.FCF_SetChatWindowFontSize(chatframe, chatframe, 0.01)
FCF_SetChatWindowFontSize(chatframe, chatframe, 0.01)
frame:Show()

local lineCt = CHAT.GetChatLines(chatframe)
local text = table.concat(lines, '\n', 1, lineCt)
_G.FCF_SetChatWindowFontSize(chatframe, chatframe, fontSize)
FCF_SetChatWindowFontSize(chatframe, chatframe, fontSize)
editBox:SetText(text)
else
frame:Hide()
Expand Down Expand Up @@ -78,7 +78,8 @@ function CHAT:ChatCopy_Create()
editBox:SetMaxLetters(99999)
editBox:EnableMouse(true)
editBox:SetAutoFocus(false)
editBox:SetFont(C.Assets.Font.Regular, 12)
local outline = _G.FREE_ADB.FontOutline
editBox:SetFont(C.Assets.Font.Regular, 12, outline, '', nil, outline or 'THICK')
editBox:SetWidth(scrollArea:GetWidth())
editBox:SetHeight(scrollArea:GetHeight())
editBox:SetScript('OnEscapePressed', function()
Expand Down
3 changes: 2 additions & 1 deletion modules/infobar/infobar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ function INFOBAR:RegisterNewBlock(name, position, width, noFade)
block:SetBackdropColor(0, 0, 0, 0)
block:SetBackdropBorderColor(0, 0, 0, 0)

block.text = F.CreateFS(block, C.Assets.Font.Condensed, 11, nil, '', nil, true, 'CENTER', 0, 0)
local outline = _G.FREE_ADB.FontOutline
block.text = F.CreateFS(block, C.Assets.Font.Condensed, 11, outline, '', nil, outline or 'THICK', 'CENTER', 0, 0)
block.position = position

if C.DB.Infobar.Mouseover and not noFade then
Expand Down
16 changes: 10 additions & 6 deletions modules/inventory/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ function INVENTORY:CreateMoneyFrame()
moneyFrame:SetSize(140, 26)

local tag = self:SpawnPlugin('TagDisplay', '[money] [currencies]', moneyFrame)
F:SetFS(tag, C.Assets.Font.Condensed, 12, nil, '', nil, true)
local outline = _G.FREE_ADB.FontOutline
F:SetFS(tag, C.Assets.Font.Bold, 12, outline, '', nil, outline or 'THICK')
tag:SetPoint('TOPLEFT', 0, -4)
end

Expand Down Expand Up @@ -535,7 +536,8 @@ function INVENTORY:CreateFreeSlots()
slot.__name = name

local tag = self:SpawnPlugin('TagDisplay', '[space]', slot)
F:SetFS(tag, C.Assets.Font.Condensed, 11, nil, '', 'CLASS', true)
local outline = _G.FREE_ADB.FontOutline
F:SetFS(tag, C.Assets.Font.Bold, 11, outline, '', 'CLASS', outline or 'THICK')
tag:SetPoint('BOTTOMRIGHT', -2, 2)
tag.__name = name
slot.tag = tag
Expand Down Expand Up @@ -914,7 +916,8 @@ function INVENTORY:OnLogin()

self.Icon:SetInside()
self.Icon:SetTexCoord(unpack(C.TEX_COORD))
F:SetFS(self.Count, C.Assets.Font.Condensed, 11, true, '', nil, true, 'BOTTOMRIGHT', -2, 2)
local outline = _G.FREE_ADB.FontOutline
F:SetFS(self.Count, C.Assets.Font.Bold, 11, outline, '', nil, outline or 'THICK', 'BOTTOMRIGHT', -2, 2)
self.Cooldown:SetInside()
self.IconOverlay:SetInside()
self.IconOverlay2:SetInside()
Expand All @@ -938,8 +941,8 @@ function INVENTORY:OnLogin()
self.Quest:SetSize(24, 24)
self.Quest:SetPoint('TOPLEFT', -2, -2)

self.iLvl = F.CreateFS(self, C.Assets.Font.Condensed, 11, true, '', nil, true, 'BOTTOMRIGHT', -2, 2)
self.BindType = F.CreateFS(self, C.Assets.Font.Condensed, 11, true, '', nil, true, 'TOPLEFT', 2, -2)
self.iLvl = F.CreateFS(self, C.Assets.Font.Bold, 11, outline, '', nil, outline or 'THICK', 'BOTTOMRIGHT', -2, 2)
self.BindType = F.CreateFS(self, C.Assets.Font.Bold, 11, outline, '', nil, outline or 'THICK', 'TOPLEFT', 2, -2)

local flash = self:CreateTexture(nil, 'ARTWORK')
flash:SetTexture('Interface\\Cooldown\\star4')
Expand Down Expand Up @@ -1251,8 +1254,9 @@ function INVENTORY:OnLogin()
label = GetCustomGroupTitle(settings.Index)
end

local outline = _G.FREE_ADB.FontOutline
if label then
self.label = F.CreateFS(self, C.Assets.Font.Condensed, 11, nil, label, nil, true, 'TOPLEFT', 5, -4)
self.label = F.CreateFS(self, C.Assets.Font.Bold, 11, outline, label, nil, outline or 'THICK', 'TOPLEFT', 5, -4)
return
end

Expand Down
4 changes: 3 additions & 1 deletion modules/tooltip/style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ function TOOLTIP:ReskinTooltip()
end

local function RestyleFont(obj, font, size)
obj:SetFont(font, size)
local outline = _G.FREE_ADB.FontOutline

obj:SetFont(font, size, outline and 'OUTLINE')
obj:SetShadowColor(0, 0, 0, 1)
obj:SetShadowOffset(1, -1)
end
Expand Down

0 comments on commit c6d84ba

Please sign in to comment.