TTFont: Difference between revisions
From GiderosMobile
No edit summary |
No edit summary |
||
| (15 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Supported platforms:''' android | <!-- GIDEROSOBJ:TTFont --> | ||
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | |||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
'''Inherits from:''' [[Special:MyLanguage/FontBase|FontBase]]<br/> | |||
=== Description === | === Description === | ||
The '''TTFont''' class is used to load true type fonts. It seems '''OTF fonts''' are also supported (at least on Windows). | |||
The | |||
=== Examples === | === Examples === | ||
''' | <syntaxhighlight lang="lua"> | ||
< | local font = TTFont.new("tahoma.ttf", 30) | ||
</syntaxhighlight> | |||
'''Otf''' | |||
<syntaxhighlight lang="lua"> | |||
local font = TTFont.new("fonts/FrankRuhlHofshi-Bold.otf", 40) | |||
local tf = TextField.new(font, "HELLO GIDEROS!") | |||
tf:setTextColor(0xc4c4c4) | |||
tf:setPosition(3*32, 3*32) | |||
stage:addChild(tf) | |||
</syntaxhighlight> | |||
=== See also === | |||
'''[[CompositeFont|CompositeFont]]''' | |||
{|- | {|- | ||
| style="width: 50%;"| | | style="width: 50%; vertical-align:top;"| | ||
=== Methods === | === Methods === | ||
[[TTFont.new]] | [[Special:MyLanguage/TTFont.new|TTFont.new]] ''creates a new TTFont object''<br/><!-- GIDEROSMTD:TTFont.new(filename,size,text,filtering,outlineSize) creates a new TTFont object --> | ||
| style="width: 50%;"| | |||
| style="width: 50%; vertical-align:top;"| | |||
=== Events === | === Events === | ||
=== Constants === | === Constants === | ||
|} | |} | ||
{{GIDEROS IMPORTANT LINKS}} | |||
Latest revision as of 23:01, 5 September 2026
Supported platforms: ![]()
![]()
![]()
![]()
![]()
![]()
![]()
Available since: Gideros 2011.6
Inherits from: FontBase
Description
The TTFont class is used to load true type fonts. It seems OTF fonts are also supported (at least on Windows).
Examples
local font = TTFont.new("tahoma.ttf", 30)
Otf
local font = TTFont.new("fonts/FrankRuhlHofshi-Bold.otf", 40)
local tf = TextField.new(font, "HELLO GIDEROS!")
tf:setTextColor(0xc4c4c4)
tf:setPosition(3*32, 3*32)
stage:addChild(tf)
See also
MethodsTTFont.new creates a new TTFont object |
EventsConstants |