< index < 2. Console emulator < 2.1 Initializing the console |
===================================== |
C++ : static void TCODConsole::setCustomFont(const char *fontFile,int charWidth=8, int charHeight=8, int flags=0) C : void TCOD_console_set_custom_font(const char *fontFile,int char_width, int char_height, int flags)
Parameter | Description |
---|---|
fontFile | Name of a .bmp or .png file containing the font. |
charWidth,charHeight | Size of a character in the bitmap file. |
flags | Used to define the characters layout in the bitmap and the font type : TCOD_FONT_LAYOUT_ASCII_INCOL (==0) : characters in ASCII order, code 0-15 in the first column TCOD_FONT_LAYOUT_ASCII_INROW : characters in ASCII order, code 0-15 in the first row TCOD_FONT_LAYOUT_TCOD : simplified layout. See examples below. TCOD_FONT_TYPE_GREYSCALE : create an anti-aliased font from a greyscale bitmap |
ASCII_INROW | ASCII_INCOL | TCOD |
![]() | ![]() | ![]() |
standard (non antialiased) | antialiased (32 bits PNG) | antialiased (greyscale) |
![]() | ![]() | ![]() |
C++ : TCODConsole::setCustomFont("standard_8x8_ascii_in_col_font.bmp",8,8,0); TCODConsole::setCustomFont("32bits_8x8_ascii_in_row_font.png",8,8,TCOD_FONT_LAYOUT_INROW); TCODConsole::setCustomFont("greyscale_8x8_tcod_font.png",8,8,TCOD_FONT_LAYOUT_TCOD | TCOD_FONT_TYPE_GREYSCALE); C : TCOD_console_set_custom_font("standard_8x8_ascii_in_col_font.bmp",8,8,0); TCOD_console_set_custom_font("32bits_8x8_ascii_in_row_font.png",8,8,TCOD_FONT_LAYOUT_INROW); TCOD_console_set_custom_font("greyscale_8x8_tcod_font.png",8,8,TCOD_FONT_LAYOUT_TCOD | TCOD_FONT_TYPE_GREYSCALE);