Difference between revisions of "Font Functions"

From Archaic Pixels
Jump to: navigation, search
(Created page with "** FONT FUNCTIONS ** -------------------- set_font_color(char fg, char bg); Set the default font foreground and background colors (colors range from 0 to 15...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
** FONT FUNCTIONS **
+
{{:HuC Function Style}}
 
+
=Font Functions=
--------------------
+
 
+
 
+
 
+
  set_font_color(char fg, char bg);
+
 
+
 
+
  
 +
== set_font_color ==
 +
{|
 +
|-
 +
! [color=green]void[/color] set_font_color([color=red]char[/color] fg, [color=red]char[/color] bg);
 +
|-
 +
|
 
       Set the default font foreground and background colors
 
       Set the default font foreground and background colors
 
 
       (colors range from 0 to 15). Changes won't take effect
 
       (colors range from 0 to 15). Changes won't take effect
 
 
       immediately, you must re-load the font by calling
 
       immediately, you must re-load the font by calling
 
 
       load_default_font().
 
       load_default_font().
 +
|}
  
  
 
+
== set_font_pal ==
  set_font_pal(char pal);
+
{|
 
+
|-
 
+
! [color=green]void[/color] set_font_pal([color=red]char[/color] pal);
 
+
|-
 +
|
 
       Set the font palette index (0-15).
 
       Set the font palette index (0-15).
 +
|}
  
  
 
+
== set_font_addr ==
  set_font_addr(int vaddr);
+
{|
 
+
|-
 
+
! [color=green]void[/color] set_font_addr([color=blue]int[/color] vaddr);
 
+
|-
 +
|
 
       Set the font address in video memory.
 
       Set the font address in video memory.
  
 
       Use this function to change the current font;
 
       Use this function to change the current font;
 
 
       to use several font on the same screen, or when
 
       to use several font on the same screen, or when
 
 
       you load yourself a font and need to tell the
 
       you load yourself a font and need to tell the
 
 
       library where it is.
 
       library where it is.
 +
|}
  
  
 
+
== get_font_pal ==
  get_font_pal();
+
{|
 
+
|-
 
+
! ??? get_font_pal([color=green]void[/color]);
 
+
|-
 +
|
 
       Return the current font palette index.
 
       Return the current font palette index.
 +
|}
  
  
 
+
== get_font_addr ==
  get_font_addr();
+
{|
 
+
|-
 
+
! ??? get_font_addr([color=green]void[/color]);
 
+
|-
 +
|
 
       Return the current font address in video memory.
 
       Return the current font address in video memory.
 +
|}
  
  
 
+
== load_default_font ==
  load_default_font();
+
{|
 
+
|-
  load_default_font(char num);
+
! [color=green]void[/color] load_default_font([color=green]void[/color]);
 
+
|-
  load_default_font(char num, int vaddr);
+
! [color=green]void[/color] load_default_font([color=red]char[/color] num);
 
+
|-
 
+
! [color=green]void[/color] load_default_font([color=red]char[/color] num, [color=blue]int[/color] vaddr);
 
+
|-
 +
|
 
       Load a default font in video memory. Without parameters
 
       Load a default font in video memory. Without parameters
 
 
       the first default font is loaded just above the
 
       the first default font is loaded just above the
 
 
       BAT in video memory; usualy it's address 0x800.
 
       BAT in video memory; usualy it's address 0x800.
  
 
       Otherwise you can select the font number, and eventualy
 
       Otherwise you can select the font number, and eventualy
 
 
       the address in video memory.
 
       the address in video memory.
  
 
       In its current implementation the library support only
 
       In its current implementation the library support only
 
 
       one default font, but in the future more fonts could
 
       one default font, but in the future more fonts could
 
 
       be available.
 
       be available.
 +
|}
  
  
 
+
== load_font ==
  load_font(char *font, char nb_char);
+
{|
 
+
|-
  load_font(char *font, char nb_char, int vaddr);
+
! [color=green]void[/color] load_font([color=red]char[/color] *font, [color=red]char[/color] nb_[color=red]char[/color]);
 
+
|-
 
+
! [color=green]void[/color] load_font([color=red]char[/color] *font, [color=red]char[/color] nb_[color=red]char[/color], [color=blue]int[/color] vaddr);
 
+
|-
 +
|
 
       Load a custom font in video memory. Used together
 
       Load a custom font in video memory. Used together
 
 
       with the #incchr directive it will allow you to load
 
       with the #incchr directive it will allow you to load
 
 
       a font from a PCX file. Note that custom fonts are
 
       a font from a PCX file. Note that custom fonts are
 
 
       colored fonts, so they won't be affected by any
 
       colored fonts, so they won't be affected by any
 
 
       previous call to set_font_color().
 
       previous call to set_font_color().
  
 
       The number of character to load range from 0 to 224,
 
       The number of character to load range from 0 to 224,
 
 
       ASCII characters 0 to 31 are never used, and can't
 
       ASCII characters 0 to 31 are never used, and can't
 
 
       be defined, you must start your font at the space
 
       be defined, you must start your font at the space
 
 
       character, which is ASCII code 32.
 
       character, which is ASCII code 32.
  
 
       If you don't implicitely give a video memory address,
 
       If you don't implicitely give a video memory address,
 
 
       the function will load your font just above
 
       the function will load your font just above
 
 
       the BAT (usualy it's address 0x800).
 
       the BAT (usualy it's address 0x800).
 +
|}

Latest revision as of 12:34, 13 September 2010

Font Functions

set_font_color

void set_font_color(char fg, char bg);
     Set the default font foreground and background colors
     (colors range from 0 to 15). Changes won't take effect
     immediately, you must re-load the font by calling
     load_default_font().


set_font_pal

void set_font_pal(char pal);
     Set the font palette index (0-15).


set_font_addr

void set_font_addr(int vaddr);
     Set the font address in video memory.
     Use this function to change the current font;
     to use several font on the same screen, or when
     you load yourself a font and need to tell the
     library where it is.


get_font_pal

 ??? get_font_pal(void);
     Return the current font palette index.


get_font_addr

 ??? get_font_addr(void);
     Return the current font address in video memory.


load_default_font

void load_default_font(void);
void load_default_font(char num);
void load_default_font(char num, int vaddr);
     Load a default font in video memory. Without parameters
     the first default font is loaded just above the
     BAT in video memory; usualy it's address 0x800.
     Otherwise you can select the font number, and eventualy
     the address in video memory.
     In its current implementation the library support only
     one default font, but in the future more fonts could
     be available.


load_font

void load_font(char *font, char nb_char);
void load_font(char *font, char nb_char, int vaddr);
     Load a custom font in video memory. Used together
     with the #incchr directive it will allow you to load
     a font from a PCX file. Note that custom fonts are
     colored fonts, so they won't be affected by any
     previous call to set_font_color().
     The number of character to load range from 0 to 224,
     ASCII characters 0 to 31 are never used, and can't
     be defined, you must start your font at the space
     character, which is ASCII code 32.
     If you don't implicitely give a video memory address,
     the function will load your font just above
     the BAT (usualy it's address 0x800).