# Font Library

## データ構造
struct | Glyph
| A Glyph struct. [詳細]
struct | GlyphBW
struct | PGF_Header
| A PGF_Header struct. [詳細]
struct | intraFont
| A Font struct. [詳細]
## マクロ定義
#define | INTRAFONT_ADVANCE_H 0x00000000
#define | INTRAFONT_ADVANCE_V 0x00000100
#define | INTRAFONT_ALIGN_LEFT 0x00000000
#define | INTRAFONT_ALIGN_CENTER 0x00000200
#define | INTRAFONT_ALIGN_RIGHT 0x00000400
#define | INTRAFONT_ALIGN_FULL 0x00000600
#define | INTRAFONT_SCROLL_LEFT 0x00002000
#define | INTRAFONT_SCROLL_SEESAW 0x00002200
#define | INTRAFONT_SCROLL_RIGHT 0x00002400
#define | INTRAFONT_SCROLL_THROUGH 0x00002600
#define | INTRAFONT_WIDTH_VAR 0x00000000
#define | INTRAFONT_WIDTH_FIX 0x00000800
#define | INTRAFONT_ACTIVE 0x00001000
#define | INTRAFONT_CACHE_MED 0x00000000
#define | INTRAFONT_CACHE_LARGE 0x00004000
#define | INTRAFONT_CACHE_ASCII 0x00008000
#define | INTRAFONT_CACHE_ALL 0x0000C000
#define | INTRAFONT_STRING_ASCII (0x00010000*CCC_CP000)
#define | INTRAFONT_STRING_CP437 (0x00010000*CCC_CP437)
#define | INTRAFONT_STRING_CP850 (0x00010000*CCC_CP850)
#define | INTRAFONT_STRING_CP866 (0x00010000*CCC_CP866)
#define | INTRAFONT_STRING_SJIS (0x00010000*CCC_CP932)
#define | INTRAFONT_STRING_GBK (0x00010000*CCC_CP936)
#define | INTRAFONT_STRING_KOR (0x00010000*CCC_CP949)
#define | INTRAFONT_STRING_BIG5 (0x00010000*CCC_CP950)
#define | INTRAFONT_STRING_CP1251 (0x00010000*CCC_CP1251)
#define | INTRAFONT_STRING_CP1252 (0x00010000*CCC_CP1252)
#define | INTRAFONT_STRING_UTF8 (0x00010000*CCC_CPUTF8)
#define | FILETYPE_PGF 0x00
#define | FILETYPE_BWFON 0x01
#define | PGF_BMP_H_ROWS 0x01
#define | PGF_BMP_V_ROWS 0x02
#define | PGF_BMP_OVERLAY 0x03
#define | PGF_NO_EXTRA1 0x04
#define | PGF_NO_EXTRA2 0x08
#define | PGF_NO_EXTRA3 0x10
#define | PGF_CHARGLYPH 0x20
#define | PGF_SHADOWGLYPH 0x40
#define | PGF_CACHED 0x80
#define | PGF_WIDTH_MASK 0x000000FF
#define | PGF_OPTIONS_MASK 0x00003FFF
#define | PGF_ALIGN_MASK 0x00000600
#define | PGF_SCROLL_MASK 0x00002600
#define | PGF_CACHE_MASK 0x0000C000
#define | PGF_STRING_MASK 0x00FF0000
## 関数
int | intraFontInit (void)
| Initialise the Font library.
void | intraFontShutdown (void)
| Shutdown the Font library.
intraFont * | intraFontLoad (const char *filename, unsigned int options)
| Load a pgf font.
void | intraFontUnload (intraFont *font)
| Free the specified font.
void | intraFontActivate (intraFont *font)
| Activate the specified font.
void | intraFontSetStyle (intraFont *font, float size, unsigned int color, unsigned int shadowColor, unsigned int options)
| Set font style.
void | intraFontSetEncoding (intraFont *font, unsigned int options)
| Set type of string encoding to be used in intraFontPrint[f].
void | intraFontSetAltFont (intraFont *font, intraFont *altFont)
| Set alternative font.
float | intraFontPrintUCS2 (intraFont *font, float x, float y, const unsigned short *text)
| Draw UCS-2 encoded text along the baseline starting at x, y.
float | intraFontPrintUCS2Ex (intraFont *font, float x, float y, const unsigned short *text, int length)
float | intraFontPrintColumnUCS2 (intraFont *font, float x, float y, float width, const unsigned short *text)
float | intraFontPrintColumnUCS2Ex (intraFont *font, float x, float y, float width, const unsigned short *text, int length)
float | intraFontPrint (intraFont *font, float x, float y, const char *text)
| Draw text along the baseline starting at x, y.
float | intraFontPrintEx (intraFont *font, float x, float y, const char *text, int length)
float | intraFontPrintColumn (intraFont *font, float x, float y, float width, const char *text)
float | intraFontPrintColumnEx (intraFont *font, float x, float y, float width, const char *text, int length)
float | intraFontPrintf (intraFont *font, float x, float y, const char *text,...)
| Draw text along the baseline starting at x, y (with formatting).
float | intraFontMeasureText (intraFont *font, const char *text)
| Measure a length of text if it were to be drawn.
float | intraFontMeasureTextEx (intraFont *font, const char *text, int length)
float | intraFontMeasureTextUCS2 (intraFont *font, const unsigned short *text)
| Measure a length of UCS-2 encoded text if it were to be drawn.
float | intraFontMeasureTextUCS2Ex (intraFont *font, const unsigned short *text, int length)

## マクロ定義

#define FILETYPE_BWFON 0x01

#define FILETYPE_PGF 0x00

覚え書き:
  The following definitions are used internally by intraFont and have no other relevance.

#define INTRAFONT_ACTIVE 0x00001000

#define INTRAFONT_ADVANCE_H 0x00000000

#define INTRAFONT_ADVANCE_V 0x00000100

#define INTRAFONT_ALIGN_CENTER 0x00000200

#define INTRAFONT_ALIGN_FULL 0x00000600

#define INTRAFONT_ALIGN_LEFT 0x00000000

#define INTRAFONT_ALIGN_RIGHT 0x00000400

#define INTRAFONT_CACHE_ALL 0x0000C000

#define INTRAFONT_CACHE_ASCII 0x00008000

#define INTRAFONT_CACHE_LARGE 0x00004000

#define INTRAFONT_CACHE_MED 0x00000000

#define INTRAFONT_SCROLL_LEFT 0x00002000

#define INTRAFONT_SCROLL_RIGHT 0x00002400

#define INTRAFONT_SCROLL_SEESAW 0x00002200

#define INTRAFONT_SCROLL_THROUGH 0x00002600

#define INTRAFONT_STRING_ASCII (0x00010000*CCC_CP000)

#define INTRAFONT_STRING_BIG5 (0x00010000*CCC_CP950)

#define INTRAFONT_STRING_CP1251 (0x00010000*CCC_CP1251)

#define INTRAFONT_STRING_CP1252 (0x00010000*CCC_CP1252)

#define INTRAFONT_STRING_CP437 (0x00010000*CCC_CP437)

#define INTRAFONT_STRING_CP850 (0x00010000*CCC_CP850)

#define INTRAFONT_STRING_CP866 (0x00010000*CCC_CP866)

#define INTRAFONT_STRING_GBK (0x00010000*CCC_CP936)

#define INTRAFONT_STRING_KOR (0x00010000*CCC_CP949)

#define INTRAFONT_STRING_SJIS (0x00010000*CCC_CP932)

#define INTRAFONT_STRING_UTF8 (0x00010000*CCC_CPUTF8)

#define INTRAFONT_WIDTH_FIX 0x00000800

#define INTRAFONT_WIDTH_VAR 0x00000000

#define PGF_ALIGN_MASK 0x00000600

#define PGF_BMP_H_ROWS 0x01

#define PGF_BMP_OVERLAY 0x03

#define PGF_BMP_V_ROWS 0x02

#define PGF_CACHE_MASK 0x0000C000

#define PGF_CACHED 0x80

#define PGF_CHARGLYPH 0x20

#define PGF_NO_EXTRA1 0x04

#define PGF_NO_EXTRA2 0x08

#define PGF_NO_EXTRA3 0x10

#define PGF_OPTIONS_MASK 0x00003FFF

#define PGF_SCROLL_MASK 0x00002600

#define PGF_SHADOWGLYPH 0x40

#define PGF_STRING_MASK 0x00FF0000

#define PGF_WIDTH_MASK 0x000000FF

## 関数

void intraFontActivate | ( | intraFont * | font | ) |

Activate the specified font.

引数:

  | font | - A valid intraFont

int intraFontInit | ( | void |  | ) |

Initialise the Font library.

戻り値:
  1 on success.

intraFont* intraFontLoad | ( | const char * | filename,
|  | unsigned int | options |
| ) |  |  |

Load a pgf font.

引数:

  | filename | - Path to the font
  | options | - INTRAFONT_XXX flags as defined above including flags related to CACHE (ored together)

戻り値:
  A intraFont struct

float intraFontMeasureText | ( | intraFont * | font,
|  | const char * | text |
| ) |  |  |

Measure a length of text if it were to be drawn.

引数:

  | font | - A valid intraFont
  | text | - Text to measure (ASCII & extended ASCII, S-JIS or UTF-8 encoded)
  | length | - char length of text to measure (...Ex version only)

戻り値:
  The total width of the text (until the first newline char)

float intraFontMeasureTextEx | ( | intraFont * | font,
|  | const char * | text,
|  | int | length |
| ) |  |  |

float intraFontMeasureTextUCS2 | ( | intraFont * | font,
|  | const unsigned short * | text |
| ) |  |  |

Measure a length of UCS-2 encoded text if it were to be drawn.

引数:

  | font | - A valid intraFont
  | text | - UCS-2 encoded text to measure
  | length | - char length of text to measure (...Ex version only)

戻り値:
  The total width of the text (until the first newline char)

float intraFontMeasureTextUCS2Ex | ( | intraFont * | font,
|  | const unsigned short * | text,
|  | int | length |
| ) |  |  |

float intraFontPrint | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | const char * | text |
| ) |  |  |

Draw text along the baseline starting at x, y.

引数:

  | font | - A valid intraFont
  | x | - X position on screen
  | y | - Y position on screen
  | width | - column width for automatic line breaking (intraFontPrintColumn... versions only)
  | text | - Text to draw (ASCII & extended ASCII, S-JIS or UTF-8 encoded)
  | length | - char length of text to draw (...Ex versions only)

戻り値:
  The x position after the last char

float intraFontPrintColumn | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | float | width,
|  | const char * | text |
| ) |  |  |

float intraFontPrintColumnEx | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | float | width,
|  | const char * | text,
|  | int | length |
| ) |  |  |

float intraFontPrintColumnUCS2 | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | float | width,
|  | const unsigned short * | text |
| ) |  |  |

float intraFontPrintColumnUCS2Ex | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | float | width,
|  | const unsigned short * | text,
|  | int | length |
| ) |  |  |

float intraFontPrintEx | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | const char * | text,
|  | int | length |
| ) |  |  |

float intraFontPrintf | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | const char * | text,
|  |  | ... |
| ) |  |  |

Draw text along the baseline starting at x, y (with formatting).

引数:

  | font | - A valid intraFont
  | x | - X position on screen
  | y | - Y position on screen
  | width | - column width for automatic line breaking (intraFontPrintfColumn... versions only)
  | text | - Text to draw (ASCII & extended ASCII, S-JIS or UTF-8 encoded)
  | length | - char length of text to draw (...Ex versions only)

戻り値:
  The x position after the last char

float intraFontPrintUCS2 | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | const unsigned short * | text |
| ) |  |  |

Draw UCS-2 encoded text along the baseline starting at x, y.

引数:

  | font | - A valid intraFont
  | x | - X position on screen
  | y | - Y position on screen
  | width | - column width for automatic line breaking (intraFontPrintColumn... versions only)
  | text | - UCS-2 encoded text to draw
  | length | - char length of text to draw (...Ex versions only)

戻り値:
  The x position after the last char

float intraFontPrintUCS2Ex | ( | intraFont * | font,
|  | float | x,
|  | float | y,
|  | const unsigned short * | text,
|  | int | length |
| ) |  |  |

void intraFontSetAltFont | ( | intraFont * | font,
|  | intraFont * | altFont |
| ) |  |  |

Set alternative font.

引数:

  | font | - A valid intraFont
  | altFont | - A valid intraFont that's to be used if font does not contain a character

void intraFontSetEncoding | ( | intraFont * | font,
|  | unsigned int | options |
| ) |  |  |

Set type of string encoding to be used in intraFontPrint[f].

引数:

  | font | - A valid intraFont
  | options | - INTRAFONT_STRING_XXX flags as defined above except flags related to CACHE (ored together)

void intraFontSetStyle | ( | intraFont * | font,
|  | float | size,
|  | unsigned int | color,
|  | unsigned int | shadowColor,
|  | unsigned int | options |
| ) |  |  |

Set font style.

引数:

  | font | - A valid intraFont
  | size | - Text size
  | color | - Text color
  | shadowColor | - Shadow color (use 0 for no shadow)
  | options | - INTRAFONT_XXX flags as defined above except flags related to CACHE (ored together)

void intraFontShutdown | ( | void |  | ) |

Shutdown the Font library.

void intraFontUnload | ( | intraFont * | font | ) |

Free the specified font.

引数:

  | font | - A valid intraFont