Tag: WoW API docs |
No edit summary Tag: WoW API docs |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | {{widget}} |
+ | {{widget}} {{tocright}} |
− | <onlyinclude><includeonly><div style="font-size:smaller; float:right;">{{Edit|UIOBJECT Font|Edit Font}}</div></includeonly> |
+ | <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> |
− | {{api|t=o|Font}} objects define a common text appearance assignable using {{api|t=w|FontInstance:SetFontObject(fontObject)}}. |
||
− | </onlyinclude> |
||
− | == Class Hierarchy == |
||
− | As a template, {{api|t=o|Font}} is a unique kind of {{api|t=o|FontInstance}} that does ''not'' extend {{api|t=o|UIObject}}. |
||
+ | 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. |
||
− | * {{api|t=o|FontInstance}} |
||
− | ** '''Font''' |
||
− | |||
− | == 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>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>SharedXML/SharedFontStyles.xml</code> defines the traditional game fonts. {{elinks-api/Inline|tly-go=SharedFontStyles.xml|git-path=SharedXML/SharedFontStyles.xml}} |
− | : |
+ | : <code>FrameXML/FontStyles.xml</code> defines additional fonts for certain use cases. {{elinks-api/Inline|tly-go=FontStyles.xml|git-path=FrameXML/FontStyles.xml}} |
− | == Methods == |
+ | == Defined Methods == |
<onlyinclude> |
<onlyinclude> |
||
{{#switch:{{{t|widgetmethod}}}|w|wm|widgetmethod= |
{{#switch:{{{t|widgetmethod}}}|w|wm|widgetmethod= |
||
− | {{api|t=o|Font}} has all the methods of {{api|t=o|FontInstance}}, plus the following: |
||
: {{api|Font:CopyFontObject(otherFont)}} - Set this Font's attributes to be a copy of the otherFont font object's. |
: {{api|Font:CopyFontObject(otherFont)}} - Set this Font's attributes to be a copy of the otherFont font object's. |
||
: {{api|Font:GetAlpha()}} |
: {{api|Font:GetAlpha()}} |
||
Line 35: | Line 21: | ||
== References == |
== References == |
||
− | {{Reflist}} |
Revision as of 16:38, 25 May 2022
The API is no longer being updated here until further notice. |
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. {, }SharedXML/SharedFontStyles.xml
defines the traditional game fonts. {, }FrameXML/FontStyles.xml
defines additional fonts for certain use cases. {, }
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
- Patch 1.10.0 (2006-03-28): Implemented by the new concrete type Font.[1]
References
- ^ Iriel 2005-12-28. Upcoming 1.10 Changes - Concise List. Archived from the original