Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
Tag: WoW API docs
No edit summary
Tag: WoW API docs
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{widget}} {{tocright}}
 
{{widget}} {{tocright}}
<onlyinclude>{{api|t=o|Font}} (inherits from {{api|t=o|FontInstance}})</onlyinclude>
+
<onlyinclude><includeonly><div style="font-size:smaller; float:right;">{{Edit|UIOBJECT Font|Edit Font}}</div></includeonly>{{api|t=o|Font}} (inherits from {{api|t=o|FontInstance}}) is a font object assignable to any text-containing widget. Created with {{api|CreateFont()}}, {{api|t=x|Font}}, and {{api|t=x|FontFamily}}.</onlyinclude>
   
 
The Font object is the only type of object that is not attached to a parent widget; indeed, its purpose is to be shared between other objects that share font characteristics. In this way, changes to the Font object will update the text appearance of all text objects that have it set as their Font using {{api|t=w|FontInstance:SetFontObject}}(). This allows a coder to maintain a consistent appearance between UI elements, as well as simplifying the resources and work required to update multiple text-based UI elements.
 
The Font object is the only type of object that is not attached to a parent widget; indeed, its purpose is to be shared between other objects that share font characteristics. In this way, changes to the Font object will update the text appearance of all text objects that have it set as their Font using {{api|t=w|FontInstance:SetFontObject}}(). This allows a coder to maintain a consistent appearance between UI elements, as well as simplifying the resources and work required to update multiple text-based UI elements.
 
== Construction ==
 
; In Lua
 
:* {{api|CreateFont(name)}} - Creates a new font object with a globally accessible name.
 
 
; In XML
 
:* {{api|t=x|Font}} - Defines a font object.
 
:* {{api|t=x|FontFamily}} - Defines a localization-dependent font object (compatibility for different character sets).
 
   
 
; Templates
 
; Templates
:* <code class="plainlinks">[https://www.townlong-yak.com/framexml/live/Fonts.xml FrameXML/Fonts.xml]</code> defines limited localization-dependent character sets, intended only for inheriting into other Fonts.
+
: <code>FrameXML/Fonts.xml</code> defines limited localization-dependent character sets, intended only for inheriting into other Fonts. {{elinks-api/Inline|tly-go=Fonts.xml|git-path=FrameXML/Fonts.xml}}
:* <code class="plainlinks">[https://www.townlong-yak.com/framexml/live/SharedFontStyles.xml FrameXML/SharedFontStyles.xml]</code> defines the traditional game fonts.
+
: <code>SharedXML/SharedFontStyles.xml</code> defines the traditional game fonts. {{elinks-api/Inline|tly-go=SharedFontStyles.xml|git-path=SharedXML/SharedFontStyles.xml}}
:* <code class="plainlinks">[https://www.townlong-yak.com/framexml/live/FontStyles.xml FrameXML/FontStyles.xml]</code> defines additional fonts for certain use cases.
+
: <code>FrameXML/FontStyles.xml</code> defines additional fonts for certain use cases. {{elinks-api/Inline|tly-go=FontStyles.xml|git-path=FrameXML/FontStyles.xml}}
   
 
== Defined Methods ==
 
== Defined Methods ==
Line 27: Line 19:
 
== Patch changes ==
 
== Patch changes ==
 
*{{Patch 1.10.0|note=Implemented by the new concrete type {{api|t=o|Font}}.<ref>{{ref web|author=[[Iriel]]|url=http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=286547&p=#post286547|archiveurl=http://blue.cardplace.com/cache/wow-interface-customization/286547.htm|title=Upcoming 1.10 Changes - Concise List|date=20051228}}</ref>}}
 
*{{Patch 1.10.0|note=Implemented by the new concrete type {{api|t=o|Font}}.<ref>{{ref web|author=[[Iriel]]|url=http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=286547&p=#post286547|archiveurl=http://blue.cardplace.com/cache/wow-interface-customization/286547.htm|title=Upcoming 1.10 Changes - Concise List|date=20051228}}</ref>}}
 
== External links ==
 
<!-- Please read https://wow.gamepedia.com/Wowpedia:External_links_policy before adding new links. -->
 
{{Elinks-api|nogit=|wowprog=http://wowprogramming.com/docs/widgets/Font.html}}
 
   
 
== References ==
 
== References ==

Revision as of 16:38, 25 May 2022

Font (inherits from FontInstance) is a font object assignable to any text-containing widget. Created with CreateFont(), <Font>, and <FontFamily>.

The Font object is the only type of object that is not attached to a parent widget; indeed, its purpose is to be shared between other objects that share font characteristics. In this way, changes to the Font object will update the text appearance of all text objects that have it set as their Font using FontInstance:SetFontObject(). This allows a coder to maintain a consistent appearance between UI elements, as well as simplifying the resources and work required to update multiple text-based UI elements.

Templates
FrameXML/Fonts.xml defines limited localization-dependent character sets, intended only for inheriting into other Fonts. {FontsFrameXML/Fonts}
SharedXML/SharedFontStyles.xml defines the traditional game fonts. {SharedFontStylesSharedXML/SharedFontStyles}
FrameXML/FontStyles.xml defines additional fonts for certain use cases. {FontStylesFrameXML/FontStyles}

Defined Methods

Font:CopyFontObject(otherFont) - Set this Font's attributes to be a copy of the otherFont font object's.
Font:GetAlpha()
Font:SetAlpha(alpha)

Patch changes

References