|
LoadFont | |||
LoadFont Filename$, FontIndex, [Size=0], [StyleFlag=0], [Format=-1] | |||
Parameters: Filename$ = The Filename of the font you wish to load FontIndex = The index identifier of this font [Size=0] = The size of this font [StyleFlag=0] = Style flags Bold, Italics, Underline [Format=-1] = The format of this font |
|||
Returns: NONE | |||
LoadFont can load either standard windows font (true type or bitmap), or PlayBASIC's very own CRF (Compressed Raster Font) format. Compressed Raster Fonts (CRF's for short) were 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 Alpha Channel support (Anti Aliasing). You can convert fonts to CRF format both internally (MakeBitmapFont) or by using the PlayFONT tool (See PlayBASIC Forums/Web Site). [ StyleFlags ] 0 = Normal style [ Format Flags ] -1 = True Type (default) Using the format parameter you can get PlayBASIC load a windows font and convert to one another format while loading. FACTS: * By default, PlayBASIC loads the "Courier New" as font #1. Since this is a windows font, you shouldn't rely upon the appearance of this font across different editions of the Windows. If this is important to you then we recommend converting your required font to CRF format (See SaveFont or use PlayFont) , which will be identical on all systems. * Not all windows fonts can be loaded! * If you try and load that doesn't exist, or can't be loaded. Windows will automatically attempt to find a closest match as it can. This 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/AFX formatted surfaces. * PlayBASIC CRF fonts can be rendered to any surface format and depth and support alpha channel. * CRF fonts can be loaded from memory (rather than from disc) by replacing the filename with the address and & character.. eg LoadFont "&"+Str$(AddressInMemory), Index, Size,Flags They can also be automatically loaded from memory when attached as a resource. See #AddResource Mini Tutorial: - Loading a Windows Font This example displays a message in the default font, then loads a second Windows font as the current font and displays a second message.
This example would output.
Mini Tutorial: - Loading a Compressed Raster Font (.CRF format) This example displays a message in the default font, then loads a second Windows font as the current font and displays a second message. Unlike Windows fonts, compressed raster fonts can be located anywhere, so you should give the LoadFont command the full location and filename of the file. The Size and Style parameters aren't relavent when loading CRF's.
|
|||
Example Source: Download This Example
|
Related Info: | CreateBitmapFont | CreateFXFont | DeleteFont | GetFontStatus | GetFreeFont | LoadNewFont | MakeBitmapFont | PrepareFXFont : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |