PrepareFXFont
PrepareFXFont FontIndex
 
Parameters:

    FontIndex = The Index of the font you wish to convert
Returns: NONE
 

      PrepareFXFont converts an existing True Type or Bitmap font in FX bitmap font. FX fonts are useful if you wish to render text to image stored in the FX format.




FACTS:



      * Unlike TrueType or Bitmap font, FX fonts can be drawn to both Video and FX images.

      * When building an FX version of a font from a True Type font, PB will use the current INK colour for the resulting bitmap version.

      * Use FontMaskColour to change the transparent colour of the font

      * PrepareFXFont and MakeBitmapFont use the same conversion engine. Making PrepareFxFont ThisFont and MakeBitmapFont ThisFont,InkColour, 4 the same




Mini Tutorial:


      This example loads two copies of the windows true type Arial, build a FX font out of one and then attempts to render some messages to an Image in FX format.


  
  Print "Loading Fonts:"
  Sync
  
  
; Load the Windows True Type Font Arial (50 point)
  LoadFont "Arial",2,50,1
  
; Load another copy of Windows True Type Font Arial (25 point)
  LoadFont "Arial",3,25,1
  
; Prepare font 2 as FX bitmap format
  PrepareFxFont 2
  
  
  
; Create an Image in FX format (800*600)
  CreateFXImage 1,800,600
  
; Tell PB to direct all rendering to this image
  RenderToImage 1
  
; set font #2 as the current output font
  SetFont 2
  
; print this message in font #2 to the current output image
  Print "Drawing FX font to FX Image"
  
; set font #3 as the current output font
  SetFont 3
  Print "Drawing True Type Font to FX image Will not work !"
  
; tell PB to direct all drawing trowards the screem
  RenderToScreen
  DrawImage 1,0,0,false
  
  
  
; refresh the screen and wait for a key press
  Sync
  WaitKey
  
  




This example would output.

  
  See Example
  

 
Related Info: CreateBitmapFont | CreateFXFont | FontMaskColour | GetFontType | LoadFont | LoadNewFont | NewBitmapFont | SetFont :
 


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