FontString question

FontString:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE, MONOCHROME")

That’s from the wiki and I’m seeing that I have to provide a path to the font I want relative to WoW.

SOMETHING has provided the Diablo font in my game, but I can’t find out which one or where that font is located relative to WoW.

Help?

Something using LibSharedMedia-3.0 most likely.

Ah. I’ll go hunting.

Thanks.

No *.ttf files in there.

/run local LSM = LibStub("LibSharedMedia-3.0")for k, v in pairs(LSM:List("font")) do print(k, v) end

the .ttf extension won’t be there because these are the registered font names, not paths.

This is why I hate ACE3.

It’s a completely different API overlaying the Blizzard one and the devs that support it are elitist a-holes. Can’t get a question answered there to save my life. All I ever get is some variant of “it was hard to write, it should be hard to figure out” (usually delivered as “look at the wiki”).

So if I want access to Diablo I need to put it in my own font folder.

I can do that, I had hoped to just piggyback on theirs, but I’m not doing anything that requires that nonsense.

It’s not Ace.

Once you know a name you can

/run local LSM = LibStub("LibSharedMedia-3.0") print(LSM:Fetch("font", "Bazooka"))

to get the path. (Replace “Bazooka” with the registered name)

So, what’s the PATH NAME to Diablo - I see “12” which isn’t a path name. :slight_smile:

Oh, run that.

Odd. It’s not called Diablo.ttf.

It’s called Avqest.ttf

If I don’t have an addon that registers a Diablo font with LSM, I can’t tell you.

If we have different addons registering the same font, the paths might be different.

No wonder I couldn’t find the darned thing.

Blizzard provides a mechanism for doing this that only 2 addons I have are using. The rest use some ACE3 magic.

Black magic. :slight_smile:

LSM is not Blizzard or Ace but a common library for sharing different media across addons.

Virtually every ACE3-built addon includes it and it shares a number of developers and contributers. It has a GITHub entry as an external, not a common, addon.

It may not have the ACE3 name on it, but it’s definitely part of that universe.

http://www.wowace.com/wiki/LibStub

WoWAce (now part of CurseForge/whoeverownsitnow) is one of the original addon download sites, not just for Acexxx

I realize that, Fizzy. What I’m saying is that it’s not a “common” addon in the sense that it’s part of the set of Blizzard Addons.

It’s part of that Ace3 universe in that I’ve virtually never seen it outside of Ace3 usage.

It’s effectively an overlayed API with poor documentation (written “Linux” style wherein only those who don’t need to read it in the first place can understand it and asking questions just gets you referred to the documentation without a hint of actually answering the questions). I absolutely refuse to release an addon that depends on Ace3 being there.

I’m struggling to make the wiki example with a font I added myself.

From my addon, the path in my *.toc is

Media\Fonts\diablo.ttf

In the fontstring:SetFont() function the paths I’ve tried are…

_retail_\\Interface\\AddOns\\BGE Spec and Class Text\\Media\\Fonts\\diablo.ttf
and
Interface\\AddOns\\BGE Spec and Class Text\\Media\\Fonts\\diablo.ttf
and
BGE Spec and Class Text\\Media\\Fonts\\diablo.ttf
and
Media\\Fonts\\diablo.ttf

…none of which worked. I’m getting an error opening the font file.

Have you re-started since adding the font?

What’s your addons actual folder name?

xxx:SetFont("Interface/Addons/youraddonfolder/Media/diablo.ttf", 12)

What’s the error…

o[frameNumber].Text:SetFont("_retail_\\Interface\\AddOns\\BGE Spec and Class Text\\Media\\Fonts\\Avqest.ttf", 11, "OUTLINE")

I had to swap out to another font, or I tried another font just to test this. This is a KNOWN good font here.

I’m getting this error…

3x BGE Spec and Class Text\Media\Fonts\Avqest.ttf(1): error: not well-formed (invalid token)

Not the most descriptive error message I’ve ever seen. Sort of the equivalent of the Pink Floyd line, “Wrong! Do it again!” Hahahahaha. :slight_smile:

Remove the _retail_\\

All relative paths start at Interface

6x BGE Spec and Class Text\Media\Fonts\Avqest.ttf(1): error: not well-formed (invalid token)

Oh, wow. That is NOT what the Wiki says.

I’ll look at that.

I should have added … for addons.
I’ve also not tried an addon folder with spaces in the name so…

It makes sense, but the wiki clearly says relative to World of Warcraft.

I am not updating it. I did a solid 18 months of updating it before Fanboy or whatever bought it and wiped all user content dating back several years and started over.

So relative to AddOns or relative to AddOns or is it Interface I start with?

font 
    String - path to the font file, relative to the WoW base directory.

From the Wiki.

The error message is clearly correctly pathing. I would think that means that spaces there are okay as they’re valid characters in a path name.

The Wiki entry might still be pre _version_ addition
The “game” root for visibility is each _version_\\ folder . Relative paths start below that so:

xxx:SetFont("Fonts/Some.ttf", 12), the ttf file would be in
_version_\\Fonts\\