Fnt load

From Bennu Wiki
Revision as of 00:04, 21 July 2012 by Kloppix (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Definition

INT fnt_load ( <STRING filename>, [ <POINTER id>] )

Loads a FNT file into memory as a font. A font is usually with the extension .fnt.

The previous name load_fnt() is deprecated.

Parameters

STRING filename - The filename of the FNT file that you wish to load (including extension and possible path).
POINTER id - Optional parameter, for loading a font in the background.

Returns

INT : graphID

-2 - Waiting for the file to be loaded, see notes.
-1 - There was an error loading the file.
>=0 - The graphID of the newly created font.


the following applies for versions prior rc282:

INT : FontID

-1 - Error: file does not exist.
0 - Filename could not be obtained from the specified string (doesn't happen usually).
>0 - The FontID.

Errors

Format not recognized - The format of the specified file could not be recognized.


Notes

The optional parameter id was introduced in version rc282 and allows you to load resources in the background. It used with the Offset operator. See example below:

      load_fnt("archivo_gordo.fnt", &idfnt);
      while(idfnt==-2)
            say("Big File Loading ....");
            frame;
      end
      if(idfnt==-1)
          say("Something went wrong!!");
          exit(); // o return
      end

      say("Big file loaded ok!!");


Mod_map
Globals None
Imported:
FullscreenGraphmodeM7ScalemodeScaleresolutionScaleresolutionaspectratioScaleresolutionorientation
Constants BCLEARCHARSETCP850CHARSETISO8859GANIMATIONSPEEDGANIMATIONSTEPGANIMATIONSTEPSGCENTERXGCENTERYGDEPTHGFRAMESGHEIGHTGPITCHGWIDEGWIDTHGXCENTERGYCENTERNFBFIXEDWIDTHNFBVARIABLEWIDTH
Imported:
BABLENDBALPHABHMIRRORBNOCOLORKEYBSBLENDBTRANSLUCENTBVMIRRORDOUBLEBUFFERHWSURFACEM1024X768M1280X1024M320X200M320X240M320X400M360X240M376X282M400X300M512X384M640X400M640X480M800X600MODE16BITSMODE16BPPMODE2XSCALEMODE8BITSMODE8BPPMODEDOUBLEBUFFERMODEFRAMELESSMODEFULLSCREENMODEHARDWAREMODEMODALMODEWAITVSYNCMODEWINDOW
Functions Bdfload()Centerset()Colorfind()Colorsget()Colorsset()Fade()Fadeoff()Fadeon()Fntload()Fntnew()Fntsave()Fntunload()Fpgadd()Fpgdel()Fpgexists()Fpgload()Fpgnew()Fpgsave()Fpgunload()Getpixel()Glyphget()Glyphset()Graphicinfo()Graphicset()Mapblockcopy()Mapbuffer()Mapclear()Mapclone()Mapdel()Mapexists()Mapgetpixel()Mapinfo()Mapinfoget()Mapinfoset()Mapload()Mapname()Mapnew()Mapput()Mapputpixel()Mapsave()Mapsetname()Mapunload()Mapxput()Mapxputnp()Palclone()Paldel()Palget()Palload()Palmapassign()Palmapgetid()Palmapremove()Palnew()Palrefresh()Palsave()Palset()Palunload()Paletteconvert()Paletteroll()Pcxload()Pngload()Pngsave()Pointget()Pointset()Putpixel()Rgb()Rgbget()Rgba()Rgbaget()