local addonName, TOAST = ...

-- Private, deterministic TOAST font objects. Blizzard's GameFont* globals
-- are intentionally not reused: UI packs and font addons commonly mutate
-- those objects, which changes text metrics and can make fixed TOAST layouts
-- overflow on another client.
local FONT_PATH = "Interface\\AddOns\\TOAST\\media\\fonts\\BarlowCondensed-Bold.ttf"
TOAST.FONT_PATH = FONT_PATH

local NORMAL_COLOR = { 1.00, 0.82, 0.00, 1.00 }
local HIGHLIGHT_COLOR = { 1.00, 1.00, 1.00, 1.00 }

local function DefineFont(name, size, color)
    -- CreateFont requires a globally unique object name so XML/template-style
    -- FontString inheritance can resolve it. The objects themselves remain
    -- owned and configured here; no Blizzard font object is modified.
    local font = _G[name] or CreateFont(name)
    font:SetFont(FONT_PATH, size, "")
    font:SetTextColor(color[1], color[2], color[3], color[4])
    font:SetShadowColor(0, 0, 0, 1)
    font:SetShadowOffset(1, -1)
    return font
end

TOAST.Fonts = {
    Normal = DefineFont("TOASTFontNormal", 12, NORMAL_COLOR),
    Highlight = DefineFont("TOASTFontHighlight", 12, HIGHLIGHT_COLOR),
    NormalSmall = DefineFont("TOASTFontNormalSmall", 10, NORMAL_COLOR),
    HighlightSmall = DefineFont("TOASTFontHighlightSmall", 10, HIGHLIGHT_COLOR),
    NormalLarge = DefineFont("TOASTFontNormalLarge", 16, NORMAL_COLOR),
    NormalHuge = DefineFont("TOASTFontNormalHuge", 20, NORMAL_COLOR),
}
