FindFont
FontIndex = FindFont(FontName$, Size, Style, Type)
 
Parameters:

    FontName$ = The Filename of the font you want to search for
    Size = The size your searching for
    Style = The Style your searching for
    Type = The type of font it should be (1=windows, 2 bitmap)
Returns:

    FontIndex = The index of the font matching your find font request
 

      FindFont will locate a change the size of loaded font.



FACTS:


      * none



Mini Tutorial:


      This simple example loads the windows Arial font in as font 2. Then using FontFont it searching for the index of this loaded font and displays if it was found or not.


  
; Load the "Arial" font as font 2, of size 24, in the normal style
  LoadFont "Arial",2,24,0
  
; Find if there's a windows Arial font loaded, of size 24, style 0 ?
  FontIndex=FindFont("Arial",24,0,1)
  
; Display a message based on the serach request
  If FontIndex=0
     Print "Font Not Found"
  Else
     Print "A matching font was found at index:"+Str$(FontIndex)
  EndIf
  
; Set Font 2 at the current font.
  SetFont FontIndex
  
; Display a message is font 2.
  Text 0,100,"This text is displayed in the Arial font size 24"
  
; Display the screen and wait for a key to be pressed
  Sync
  WaitKey
  


This example would output.

  
  A matching font was found at index:2
  This Text is displayed in the Arial font size 24
  

 
Related Info: CreateBitmapFont | GetCurrentFont | GetFreeFont | LoadFont | LoadNewFont :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com