Thread Tools Display Modes
05-17-16, 09:53 AM   #1
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Font Revision

Hey guys!

Changing Font-Objects using :SetFont() seems to not update the font file. I wonder if this is intended or being a bug due to the new font scale changes made...
__________________
 
05-17-16, 11:15 AM   #2
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
I tested Legible Mail (link in signature) and it seemed to work fine. Here's a snip of the fontObject:SetFont() call.

Lua Code:
  1. local fontObject = CreateFont("LegibleMail_Font")
  2. local isOK = fontObject:SetFont(LSM:Fetch("font", sdg.font), sdg.fontSize, "") 
  3.        
  4. OpenMailBodyText:SetFontObject(fontObject)      -- READING
  5. SendMailBodyEditBox:SetFontObject(fontObject)   -- WRITING
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
 
05-17-16, 12:35 PM   #3
galvin
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 265
Anyone know what the max size of a font is now?
 
05-17-16, 01:16 PM   #4
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Originally Posted by VincentSDSH View Post
I tested Legible Mail (link in signature) and it seemed to work fine.
Pre created xml font templates:
Code:
<Font name="MyGameFont_Small" font="Interface\AddOns\MyAddon\Media\Fonts\Gothic.ttf" outline="NONE" virtual="true">
	<FontHeight val="8"/>
	<Shadow>
		<Offset x="1" y="-1" />
		<Color r="0" g="0" b="0"/>
	</Shadow>
</Font>
<Font name="MyGameFont_Medium" font="Interface\AddOns\MyAddon\Media\Fonts\Gothic.ttf" outline="NONE" virtual="true">
	<FontHeight  val="10"/>
	<Shadow>
		<Offset x="1" y="-1" />
		<Color r="0" g="0" b="0"/>
	</Shadow>
</Font>

Applying the new font:
Lua Code:
  1. function SetUIFont()
  2.     local index = usedFont
  3.     local name, small, medium = unpack(FONTLIST[index])
  4.     local path = [[Interface\AddOns\MyAddon\Media\Fonts\]]..name
  5.  
  6.     -- change font
  7.     MyGameFont_Small:SetFont(path,small,"NONE")
  8.     MyGameFont_Medium:SetFont(path,medium,"NONE")
  9. end

Doesn't work, which is pretty weird...
__________________
 
05-17-16, 02:25 PM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
It's impossible to tell from your code whether you simply have the font path wrong because it's being dynamically created using resources outside of what's here.
 
05-17-16, 03:04 PM   #6
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Originally Posted by semlar View Post
It's impossible to tell from your code whether you simply have the font path wrong because it's being dynamically created using resources outside of what's here.
Double checked that, and the paths are correct!
Btw. the hardcoded xml font paths are working...

Tested some things...

Test Macro 1:
Lua Code:
  1. /run GameFontNormal:SetFont("Interface\\AddOns\\MyAddon\\Media\\Fonts\\Zero.ttf",10)
  2. -- same result

Test Macro 2:
Lua Code:
  1. /run GameFontNormal:SetFont("Fonts\\MORPHEUS.ttf",10)
  2. -- does work

Using Macro 2 and than Macro 1 afterwards = changed it back to which font it was before...(I guess "Fonts\FRIZQT__.TTF")

This is pretty weird & seems to be bug...
__________________

Last edited by syncrow : 05-17-16 at 03:44 PM.
 
05-17-16, 03:22 PM   #7
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Originally Posted by galvin View Post
Anyone know what the max size of a font is now?
I was able to adjust the mailbox font to 64. Setting the number larger didn't produce a change. I don't know if that's a limitation in the mailbox tough.
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail

Last edited by VincentSDSH : 05-20-16 at 10:46 PM.
 
05-17-16, 06:21 PM   #8
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
I have a very vague memory of some issue involving changing fonts from ages ago. Need to do it early in the UI loading process, perhaps?
__________________
Grab your sword and fight the Horde!
 
05-19-16, 08:08 AM   #9
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 63
Custom font files are broken in the current Beta Build. Its supposed to be fixed in the next one or so, so if your problems are only appearing with new fonts placed in addons, then wait for that to be resolved.
 
05-19-16, 08:24 AM   #10
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I could set the combat text to a custom font at least
Not sure if it's different from just using :SetFont
Code:
DAMAGE_TEXT_FONT = "Interface\\AddOns\\AnyFont\\font.ttf"
 
05-19-16, 08:44 AM   #11
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Originally Posted by Nevcairiel View Post
Custom font files are broken in the current Beta Build. Its supposed to be fixed in the next one or so, so if your problems are only appearing with new fonts placed in addons, then wait for that to be resolved.
I thought that too, cause it just works fine on live, so we have to wait for that... =)

Originally Posted by Ketho View Post
I could set the combat text to a custom font at least
Not sure if it's different from just using :SetFont
Maybe because the combat text inherits the font path from that global variable?
__________________

Last edited by syncrow : 05-19-16 at 08:46 AM.
 
05-20-16, 12:19 AM   #12
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 63
External sounds work again in the latest build, however external fonts are still broken.
Hopefully next time.
 
05-20-16, 01:53 AM   #13
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
Originally Posted by galvin View Post
Anyone know what the max size of a font is now?
It's either 1000px or 1200px. I tested it at Semlar's insistence back in the very first alpha build where scripts were still enabled.
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
 
05-20-16, 09:46 AM   #14
Gethe
RealUI Developer
 
Gethe's Avatar
Premium Member
Featured
Join Date: Sep 2008
Posts: 942
From what I can tell, the new max is 256.
__________________
Knowledge = Power; Be OP

 
05-26-16, 09:19 PM   #15
ceylina
A Wyrmkin Dreamwalker
Join Date: Oct 2014
Posts: 50
Fonts seem to be working with the latest build
 
05-28-16, 01:49 AM   #16
Nevcairiel
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 63
Indeed, my UI isn't all screwy anymore when I enable some AddOns!
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Font Revision

Thread Tools
Display Modes

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