View Single Post
06-28-19, 02:36 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
I would suggest setting the FontString in XML to inherit from an ingame font initially, then change it from Lua when your config loads using Fontstring:SetFont().

Alternatively, you can try your luck with CreateFont() and inheriting it in your XML.
Lua Code:
  1. local NorFont=CreateFont("EKPlates_NorFont");-- This is the global name we'll use when inheriting this font
  2. NorFont:CopyFontObject("GameFontHightlightSmall");--    Initiate to an ingame font
  3. NorFont:SetFont("Interface\\AddOns\\EKPlates\\media\\font.ttf",12,"OUTLINE");-- Set our custom font
XML Code:
  1. <FontString parentKey="value" inherits="EKPlates_NorFont" justifyH="CENTER">

Note: Last time I tried creating fonts in Lua, there was a bug where the font couldn't be used even after using Font:SetFont() unless I initially inherited from an ingame font first.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 06-28-19 at 02:50 PM.
  Reply With Quote