Quantcast
WoWInterface - View Single Post - Unable to use SetFontObject on a custom .ttf font
View Single Post
05-12-20, 08:20 AM   #1
jezzi23
A Murloc Raider
Join Date: Apr 2020
Posts: 4
Unable to use SetFontObject on a custom .ttf font

I have this really simple problem that I just can't seem to figure out...

I'm trying to use a custom font for my addon. As an example, I'll try to use arial.ttf, which exists at the wow base directory, and in every directory along the way to my addon directory, e.g. "Interface\\AddOns\\MY_ADDON_NAME\\fonts\\arial.ttf"

font_str = UIParent:CreateFontString(nil, "OVERLAY")
font_str:SetFontObject("arial.ttf"); -- try to find it at wow base directory
font_str:SetText("TEST");
font_str:SetPoint("TOP", 0, -30);

I have tried looking for it in the addon directory as well but it never works and I get "<unnamed>:SetFontObject(): Couldn't find font named arial.ttf".

What is going on here? : (

EDIT: This is Wow Classic

Last edited by jezzi23 : 05-12-20 at 08:31 AM.
  Reply With Quote