void aui_cfg_reloadfonts() { byte fszs[3] = { 9, 11, 12 }; byte fszb[3] = { 12, 14, 17 }; if ((auicv.fontsize < 1) || (auicv.fontsize > 3)) auicv.fontsize = 2; char fontdir[256]; snprintf(fontdir, 256, "%s/fonts/%s/", AROMA_DIR, auicv.fontfamily); char fonts[256]; snprintf(fonts, 256, ""); AZREADDIRP r = az_readdir(fontdir); if (r != NULL) { int i = 0; for (i = 0; i < r->n; i++) { if (r->t[i] == 0) { char *vfont = strdup(fonts); snprintf(fonts, 256, "%s%s;", vfont, r->f[i]); free(vfont); } fonts[strlen(fonts) - 1] = 0; } az_readdir_free(r); ag_loadsmallfont(fonts, fszs[auicv.fontsize - 1], fontdir); ag_loadbigfont(fonts, fszb[auicv.fontsize - 1], fontdir); printf("Load Font: %s - dir: %s\n", fonts, fontdir); } }
//* //* Init All Resources //* void a_init_all(){ //-- Init ui_init(); //-- Init Event Handler ag_init(); //-- Init Graphic Framebuffer ag_loadsmallfont("fonts/small"); //-- Init Small Font ag_loadbigfont("fonts/big"); //-- Init Big Font }
//* //* SHOW TIPS //* void aui_showtips(AUI_VARSP v) { if (aui_is_show_tips) { aui_is_show_tips = 0; CANVAS * tmpc = aw_muteparent(v->hWin); aw_set_on_dialog(2); ag_rectopa(agc(), 0, 0, agw(), agh(), 0x0000, 180); ag_sync(); CANVAS alertbg; ag_canvas(&alertbg, agw(), agh()); ag_draw(&alertbg, agc(), 0, 0); //-- Load Tips Font ag_loadbigfont("fonts/HTC Hand/HTCHand.otf", 18, AROMA_DIR "/"); PNGCANVAS ap; int imS = agdp() * 12; int bHH = v->btnH / 2; int w75 = round(agw() * 0.6); if (apng_load(&ap, "common/tips1")) { apng_stretch(&alertbg, &ap, v->pad + v->btnH, v->boxY - bHH, imS, imS, 0, 0, ap.w, ap.h); apng_close(&ap); } ag_text(&alertbg, w75, v->pad + v->btnH + imS, v->boxY - bHH, "Here is the path of the current working directory", 0xffff, 1); if (apng_load(&ap, "common/tips2")) { apng_stretch(&alertbg, &ap, agw() - (v->btnH + imS), v->boxY + (v->btnH * 4.5), imS, imS, 0, 0, ap.w, ap.h); apng_close(&ap); } ag_text(&alertbg, w75, agw() - (v->btnH + imS + w75), v->boxY + (v->btnH * 4.5), "<@right>Tap the checkbox to select multiple files</@>", 0xffff, 1); if (apng_load(&ap, "common/tips3")) { apng_stretch(&alertbg, &ap, agw() - (v->btnH + imS * 3), v->btnY - (v->pad + v->btnFH + imS), imS, imS, 0, 0, ap.w, ap.h); apng_close(&ap); } ag_text(&alertbg, w75, agw() - (v->btnH + imS * 3 + w75), v->btnY - (v->pad + v->btnFH + (imS * 2)), "<@right>All functions you need is on this toolbar</@>", 0xffff, 1); //-- Revert Font aui_cfg_reloadfonts(); //-- Create Window AWINDOWP hWin = aw(&alertbg); aw_show(hWin); byte ondispatch = 1; while (ondispatch) { dword msg = aw_dispatch_ex(hWin, agh()); byte msgm = aw_gm(msg); if (msgm == 5) { ondispatch = 0; } } aw_destroy(hWin); ag_ccanvas(&alertbg); aw_set_on_dialog(0); aw_unmuteparent(v->hWin, tmpc); } }