local _, addon = ...

local FontPath = "Interface\\AddOns\\CzechQuests\\Assets\\Fonts\\"

local TestFont = UIParent:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
TestFont:SetPoint("TOP", UIParent, "BOTTOM", 0, -64);

local function CreateCzechFont(frame, name, size, flags, style)
    local font = frame:CreateFontString(nil, "OVERLAY", style)
    font:SetTextColor(0, 0, 0, 1)
    font:SetJustifyH("LEFT")
    font:SetWidth(frame:GetWidth())
    font:SetWordWrap(true)
    font:SetFont(FontPath ..name, size, flags or "")
    return font
end
addon.API.CreateCzechFont = CreateCzechFont

local function UpdateCzechFont(FontString, name, size)
    if not FontString then
        return
    end
    local _, currentSize, flags = FontString:GetFont()
    FontString:SetFont(FontPath .. name, size or currentSize, flags)
end
addon.API.UpdateCzechFont = UpdateCzechFont

local function GetFontContainer()
    local container = Settings.CreateControlTextContainer()
    container:Add("morpheus_cz.ttf", "Morpheus (cz)")
    container:Add("frizquadratatt_cz.ttf", "Friz Quadrata TT (cz)")
    container:Add("quicksand.ttf", "Quicksand")
    container:Add("oxanium.ttf", "Oxanium")
    container:Add("caveat.ttf", "Caveat")
    return container:GetData()
end
addon.API.GetFontContainer = GetFontContainer