update wmax, update README.md
This commit is contained in:
@@ -24,6 +24,9 @@ ALLEGRO_DEBUG_CHANNEL("font")
|
||||
#define delimit_blue (unsigned)255
|
||||
#define delimit_alpha (unsigned)255
|
||||
#define delimit_color al_map_rgba(delimit_red, delimit_green, delimit_blue, delimit_alpha)
|
||||
#define wmax (int32_t)2048 // fixed atlas width - 1024 or 2048 are ideal depending on font size
|
||||
// height is automatically adjusted in powers of two
|
||||
// todo we should expand this less when the card supports npot textures
|
||||
|
||||
/* globals */
|
||||
static bool ttf_inited;
|
||||
@@ -66,7 +69,8 @@ ALLEGRO_FONT *al_load_ttf_font_f(ALLEGRO_FILE *file,
|
||||
al_get_config_value(system_cfg, "ttf", "cache_text");
|
||||
if (!cache_text_str) {
|
||||
ALLEGRO_ERROR("No characters defined in cache_text! Using defaults\n");
|
||||
cache_text_str = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?/()@#$%^&*-_=+<>~`\u007F";
|
||||
// todo probably should just store a list of ranges instead, maybe even ditch the config var entirely
|
||||
cache_text_str = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?/()@#$%^&*-_=+<>~`\u007FĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ";
|
||||
}
|
||||
|
||||
// read font file
|
||||
@@ -89,7 +93,6 @@ ALLEGRO_FONT *al_load_ttf_font_f(ALLEGRO_FILE *file,
|
||||
}
|
||||
|
||||
// convert glyphs into textures
|
||||
#define wmax (int32_t)1024
|
||||
int32_t woff = 1, hoff = 1, hmax = 128; // signed to calculate difference at texture edges
|
||||
gtex = al_create_bitmap(wmax, hmax);
|
||||
al_set_target_bitmap(gtex);
|
||||
|
||||
Reference in New Issue
Block a user