LibIconFonts
This is a library for World of Warcraft that provides easy access to icon font glyphs. Font files are not included.
Currently supported icon fonts include:
API
lib:GetIconFont(fontName)
Parameters
fontName - The registered name of an icon font. (string)
Returns
icons - List of unicode characters indexed by name. (table)
Note: The names for each character is determined by the individual icon font set, excluding any redundant prefix.
lib:RegisterIconFont(fontName, fontFunc)
Parameters
fontName - The name of an icon font. (string)
fontFunc - A function that returns a table containing a list of icons. (function)
Example usage:
``` local frame = _G.CreateFrame("Frame", nil, _G.UIParent, "BasicFrameTemplate") frame:SetSize(925, 600) frame:SetPoint("CENTER")
local fa = _G.LibStub("LibIconFonts-1.0"):GetIconFont("FontAwesome-4.7") local icon = frame:CreateFontString(nil, "ARTWORK") icon:SetFont([[path\to\fontawesome.ttf]], 16, "OUTLINE") icon:SetText(fa.microphone) icon:SetPoint("CENTER", frame) ```