Thread Tools Display Modes
01-10-15, 04:30 PM   #1
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
MacroFrameText:SetFont(FontPath, FontSize, FontFlags)

Anyone can help me change the macro text (in the macro UI edit box) to Courier New (or any monospaced font)?
I tried this:
http://us.battle.net/wow/en/forum/topic/10950425153
but it didnt work
i tried both
[[Interface\AddOns\MacroFrameFontImprover\cour.ttf]]
and
[[Interface\\AddOns\\MacroFrameFontImprover\\cour.ttf]]
(font file with that name on that folder)

Last edited by Banknorris : 01-10-15 at 04:36 PM.
  Reply With Quote
01-10-15, 04:38 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You don't escape backslashes inside of brackets, and you have to restart the client to get it to load the file you're referencing, but other than that if it isn't working then your path is probably wrong.

You should create your own font string in the middle of the screen and set it to your font to determine whether the game is loading your font, then if it is and the macro frame is displaying the incorrect font it means your SetFont is being overridden later.
  Reply With Quote
01-10-15, 04:51 PM   #3
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
Originally Posted by semlar View Post
You should create your own font string in the middle of the screen and set it to your font to determine whether the game is loading your font, then if it is and the macro frame is displaying the incorrect font it means your SetFont is being overridden later.
Hum, thanks but i have no idea what that means or how to do that, can you hold my hand please? I am not a real addon developer.

Is it possible game can't open ttf fonts?
How do I search for overwritting fonts? I searched on the Blizzard UI code and couldn't find the original SetFont code on either Blizzard_MacroUI.lua or Blizzard_MacroUI.xml

I double and triple checked paths, it is not it. It is not the wrong file name.

Also when i double click the font file it opens the usual interface showing several font sizes so apparently that is a valid font file (from windows viewpoint)

Anyway we all agree that any code should be displayed in monospace font so this is of universal interest right? :P

Last edited by Banknorris : 01-10-15 at 05:07 PM.
  Reply With Quote
01-10-15, 09:12 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Banknorris View Post
I searched on the Blizzard UI code and couldn't find the original SetFont code on either Blizzard_MacroUI.lua or Blizzard_MacroUI.xml
Line 181 of Blizzard_MacroUI.xml defines the font used as GameFontHighlightSmall.

Following the trail through SharedXML reveals it using Fonts\FRIZQT__.TTF.
__________________
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)
  Reply With Quote
01-11-15, 10:27 AM   #5
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
This solved for me, apparently you can't pass a LoadOnDemand addon as a LoadsWith parameter (at least that is my theory):

MacroFrameFontImprover.toc
Code:
## Interface: 60000
## Title: Macro Frame Font Improver
## Version: 1.00
## Author: Choonster
## Notes: Improves the font in the macro frame's editbox.

core.lua
core.lua
Code:
-- The font file to use, relative to the root WoW directory
local FontPath = [[Interface\AddOns\MacroFrameFontImprover\CourierNew.ttf]]

-- The font size to use
local FontSize = 12

-- The font flags to use. Any comma-delimited combination of "OUTLINE", "THICKOUTLINE" and "MONOCHROME". Leave empty for no flags.
local FontFlags = ""

-------------------
-- END OF CONFIG --
-------------------

local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent",function(self,event,...)
	if event=="ADDON_LOADED" and ...=="Blizzard_MacroUI" then
		MacroFrameText:SetFont(FontPath,FontSize,FontFlags)
		f:UnregisterEvent("ADDON_LOADED")
	end
end)
  Reply With Quote
01-11-15, 10:33 AM   #6
Choonstertwo
A Chromatic Dragonspawn
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 194
Originally Posted by Banknorris View Post
This solved for me, apparently you can't pass a LoadOnDemand addon as a LoadsWith parameter (at least that is my theory):
I just replied on the official forums, but I thought I'd reply here as well. The issue is probably that I was using LoadsWith instead of LoadWith (the correct tag).
  Reply With Quote
01-11-15, 10:57 AM   #7
Banknorris
A Chromatic Dragonspawn
 
Banknorris's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 153
I recommend
Inconsolata-Bold.ttf (which is monospaced and open source and free)
size 13
no flags

http://www.fontsc.com/font/inconsolata
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » MacroFrameText:SetFont(FontPath, FontSize, FontFlags)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off