GBDKライブラリドキュメント
GBDK libraries documentation |
||
---|---|---|
前
Prev |
5章
ライブラリ
Chapter 5.Libraries |
void init_font(void)フォントハンドルをすべてクリアし、タイルをすべてリリースすることにより、フォントシステムを初期化します。
フォントシステムを初期化します。
このルーチンは
load_font
に任意の呼び出しの前にプログラムの最初に呼ばれたほうがよい。
Initialises the font system.This routine should be called at the start of the program before any calls to load_font.
無。
None.
無。
Nothing.
FONT_HANDLE load_font( void *font_structure )成功や失敗中のNULL上の FONT_HANDLE を返して、フォントフォントをロードすることを試みます。
一度各フォントについては、それが要求されれば、load_fontが呼ばれたほうがよい。
現在、unload_fontサポートがないことに注意してください。
load_font should be called once for each font that is required.Note that currently there is no unload_font support.
フォント:有効なフォント構造体の基礎へのポインタ
font: pointer to the base of a valid font structure
成功した場合、
FONT_HANDLE
を返します。
失敗した場合、NULL(0)を返します。
On success, returns a FONT_HANDLE.On failure, returns NULL (0)
void set_font( FONT_HANDLE font_handle )以前にロードしたフォントfont_handleに現在のフォントをセットします。
set_fontは現在の出力フォントをfont_handleによって指定されるものに変更します。
set_font changes current output font to the one specified by font_handle
font_handle:前の
load_font
呼び出しからのハンドル。
font_handle: handle from a previous load_font call.
無。
Nothing.
font_handleが有効なフォントハンドルかどうか確かめるチェックはされません。
No check is made to see if font_handle is a valid font handle.
void mprint_string( char *string )現在のフォントを使用して、string文字列を表示します。
これはフォントライブラリをテストするために使用される一時的なルーチンです。
This is a temporary routine used to test the font library.
string: 0で終了する表示文字列。
string: null terminated string to print.
無。
Nothing.
FONT_HANDLEは
load_font
から返され、
set_font
によって使用される16ビットの値です。
物理的に、それはfont_tableのエントリへのポインタです。
A FONT_HANDLE is a 16 bit value returned from load_font and used by set_font.Physically it is a pointer to an entry in the font_table.
font_structureは、
コード化されたデータ
と
タイル
(bitmap)イメージデータを含むフォントと関係したデータ用のコンテナです。
コード化テーブルとタイルデータの可変長さ性質により、デフォルトC構造体は存在しません。
A font_structure is a container for the data related to a font, including the encoding data and tile (bitmap) image data.Due to the variable length nature of the encoding table and the tile data no default C structure exists.
フォント構造体は、4つのフィールド-フォントタイプ、使用されるタイルの数、コード化テーブルとタイルデータ-から構成されます。
A font structure is made up of four fields - the font type, the number of tiles used, the encoding table and the tile data.
フォントタイプはコード化テーブルとタイルデータの形式について解説するシングルビットです。
コード化テーブル長さは低位2ビットによって指定されます。
00:256バイトのコード化テーブル
01:128バイトのコード化テーブル
10と11が予約されます。
第3ビット(0x04)はタイルデータが圧縮されるかどうか決めるために使用されます。
多くのタイルは、灰色の濃淡を使用せず、したがって、16の代わりに8バイトで表わすことができます。
ビット2がセットされる場合、タイルは長さ8バイトと仮定され、ロード段階で16バイトまで拡張します。
The Font type is a single bit that describes the encoding table and the format of the tile data.The encoding table length is specified by the lower two bits 00: 256 byte encoding table 01: 128 byte encoding table 10 and 11 are reserved.The third bit (0x04) is used to determine if the tile data is compressed.Many tiles do not use shades of grey, and so can be represented in 8 bytes instead of 16.If bit 2 is set, then the tiles are assumed to be 8 bytes long and are expanded to 16 bytes at the load stage.
num_tilesは、タイルデータの中に、と従ってあるタイルの数を与えます、フォントによって要求されるタイルの数。
num_tiles gives the number of tiles present in the tile data and hence the number of tiles required by the font.
コード化テーブルはタイルデータ中の適切なタイルにASCII文字を写像する配列です。
例えば、文字「A」が第10のタイルだったと仮定します。
その場合、コード化テーブル中の第65の(「A」のためのASCIIコード)エントリは、10である。
対応するタイルがないいかなるASCII特徴もデフォルトタイルに写像されるほうがよい。
スペースはタイルを推薦されます。
The encoding table is an array that maps an ASCII character to the appropriate tile in the tile data.For example, suppose that the letter 'A' was the tenth tile.Then the 65th (the ASCII code for 'A') entry in the encoding table would be 10.Any ASCII characters that don't have a corresponding tile should be mapped to a default tile.Space is recommended tile.
最終フィールドは実際のタイルデータです。
0からのスタートに番号を付けるそのタイルに注意してください。
The final field is the actual tile data.Note that tile numbering starts from zero.
前
Prev |
ホーム
Home |
|
malloc、freeと関連した関数 - stdlib.h
malloc, free and related functions - stdlib.h |
上
Up |