|
LoadNewFont | ||
FontIndex = LoadNewFont(Filename$, [Size=0], [StyleFlag =0], [Format =-1] The format of this font) | ||
Parameters: Filename$ = The Filename of the font you wish to load [Size=0] = The size of this font [StyleFlag =0] = Style flags Bold, Italics, Underline [Format =-1] The format of this font |
||
Returns: FontIndex = The index identifier of this font |
||
The LoadNewFont function can load either standard windows font (true type or bitmap), or PlayBasic's very own CRF (Compressed Raster Font) format. Compressed Raster Fonts we're added to PlayBasic V1.64 as a global font solution. CRF's are a form of bitmap font, that can be drawn onto any surface and include support for Alpha Channel (Anti Aliasing). You can convert fonts to CRF format both internally (MakeBitmapFont) or by using the PlayFONT tool (See PlayBasic.com for Free PlayBASIC tools/forums). [ StyleFlags ] 0 = Normal style [ Format ] -1 = Windows True Type (default) FACTS: * By default all PlayBASIC programs use the "Courier New" as font #1. * Not all Windows fonts can be loaded! * If you try and load a windows font doesn't exist, or can't be loaded. The default font will be loaded in it's place. * Windows True Type/Bitmaps Fonts will be automatically converted to a CRF when drawing text to FX surfaces. * CRF fonts can be loaded from memory (rather than from disc) by replacing the filename with the address and & character.. eg Index=LoadNewFont( "&"+Str$(AddressInMemory), Size,Flags) They can also be automatically loaded from memory when attached as a resource. See #AddResource Mini Tutorial: This example displays a message in the default font, then loads a second font as the current font and displays a second message.
This example would output.
|
Related Info: | CreateBitmapFont | CreateFXFont | DeleteFont | GetFontStatus | LoadFont | MakeBitmapFont | NewBitmapFont | PrepareFXFont : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |