From bb35c7cc9cb4f369d74f4a9d14f094ba9ab3007c Mon Sep 17 00:00:00 2001 From: Hominem te esse Date: Sat, 24 Mar 2012 00:21:03 +0100 Subject: [PATCH] * fix for theme font handling (when switching back to the default theme, the language font wasn't re-applyied) * font code factorization --- include/fntsys.h | 24 +- lng/lang_Italian.lng | 245 ++++++------ src/dia.c | 30 +- src/fntsys.c | 415 +++++++++------------ src/gui.c | 10 +- src/lang.c | 9 +- src/menusys.c | 2 +- src/themes.c | 98 ++--- thirdparty/font_Hungarian.ttf | Bin 25564 -> 53688 bytes .../{font_Hungarian.ttf => font_Italian.ttf} | Bin 10 files changed, 375 insertions(+), 458 deletions(-) copy thirdparty/{font_Hungarian.ttf => font_Italian.ttf} (100%) diff --git a/include/fntsys.h b/include/fntsys.h index bb040e0..b24aa8e 100644 --- a/include/fntsys.h +++ b/include/fntsys.h @@ -9,28 +9,18 @@ #define FNT_ERROR (-1) /** Initializes the font subsystem */ -void fntInit(void); +void fntInit(); /** Terminates the font subsystem */ -void fntEnd(void); - -/** Loads a font - * @param buffer The memory buffer containing the font - * @param bufferSize Size of the buffer - * @param takeover Set to nonzero - * @return font slot id (negative value means error happened) */ -int fntLoad(void* buffer, int bufferSize, int takeover); +void fntEnd(); /** Loads a font from a file path * @param path The path to the font file * @return font slot id (negative value means error happened) */ int fntLoadFile(char* path); -/** Replaces the given font slot with the defined font */ -void fntReplace(int id, void* buffer, int bufferSize, int takeover, int asDefault); - -/** Reloads the default font into the given font slot */ -void fntSetDefault(int id); +/** Reloads the default font */ +void fntLoadDefault(char* path); /** Releases a font slot */ void fntRelease(int id); @@ -40,15 +30,15 @@ void fntRelease(int id); void fntSetAspectRatio(float aw, float ah); /** Renders a text with specified window dimensions */ -int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t height, const unsigned char* string, u64 colour); +int fntRenderString(int id, int x, int y, short aligned, size_t width, size_t height, const unsigned char* string, u64 colour); /** replaces spaces with newlines so that the text fits into the specified width. * @note A destrutive operation - modifies the given string! */ -void fntFitString(int font, unsigned char *string, size_t width); +void fntFitString(int id, unsigned char *string, size_t width); /** Calculates the width of the given text string * We can't use the height for alignment, as the horizontal center would depends of the contained text itself */ -int fntCalcDimensions(int font, const unsigned char* str); +int fntCalcDimensions(int id, const unsigned char* str); #endif diff --git a/lng/lang_Italian.lng b/lng/lang_Italian.lng index 6cdd320..a67dbb5 100644 --- a/lng/lang_Italian.lng +++ b/lng/lang_Italian.lng @@ -1,105 +1,140 @@ -# translation by 0NullChAr0 -Italian - WELCOME TO OPEN PS2 LOADER. MAIN CODE BASED ON SOURCE CODE OF HD PROJECT ADAPTATION TO USB ADVANCE FORMAT AND INITIAL GUI BY IFCARO MOST OF LOADER CORE IS MADE BY JIMMIKAELKAEL. ALL THE GUI IMPROVEMENTS ARE MADE BY VOLCA. THANKS FOR USING OUR PROGRAM ^^ -Open PS2 Loader %s -Salva cambiamenti -O Indietro -Configura Network - -Impostazioni salvate... -Errore scrittura impostazioni! -Esci -Impostazioni -Giochi USB -Giochi HDD -Giochi Network -Applicazioni -Tema -Lingua -Errore avvio Network: %d -Attivato -Disattivato -OK -Impostazioni Gioco -Rimuovi tutte le impostazioni -Tutte le impostazioni del gioco sono state rimosse -Scorrimento -Lento -Medio -Veloce -Menu Predefinito -Carica dal disco -Per favore attendere -Errore caricamento ID del Gioco -Ordinamento Automatico -Errore caricamento file linguaggio -Disabilita Colori di Debug -Nessun controller rilevato, attendere... -Abilita Cover Art -Schermo ampio -Spegni -Caricamento Configurazioni -Salvataggio Configurazioni -Avvia Periferica -Avviamento periferica USB -Avviamento periferica HDD -Avviamento periferica ETH -Avviamento Applicazioni -Automatico -Manuale -Avvia HDL Server -Avviamento HDL Server... -Caricamento HDL Server... [O] Per Fermare -Premi [X] per fermare HDL... -Scaricamento HDL Server... -Esci per -Colore dello Sfondo -Colore del Testo -IP -Maschera -Ingresso -Porta -Titolo -Utente -Parola d'ordine - -X Accetta -L'oggetto sara' cancellato definitivamente, continuare? -Rinomina -Cancella -Avvia -Impostazioni Schermo -Abilita operazioni di Elimina e Rinomina -Controlla frammentazione Gioco USB -Ricorda ultimo gioco Avviato -Errore, il gioco e' frammentato -Errore, impossibile avviare l'oggetto -Testa -Lasciare vuoto per Autorizzazioni GUEST -Carica Nucleo Alternativo -Metodo lettura data alternativo -Sgancia chiamate Sistema -PSS Disabilitati -Disabilita DVD-DL -Disabilita IGR -Riduci buffer cdvdfsv -Nascondi modulo dev9 -Combo IGR alternato -Cambiare le dimensioni della VMC -Creare -Modifica -Annulla -Resetta -Usa generico -Configura VMC -Nome -Dimensione -Stato -Progresso -File VMC esiste -File VMC invalido, la dimensione non e' corretta -File VMC deve essere creato -Errore con il File VMC, continuare con MC fisica ? -Aggiornamento automatico -Informazioni -Sviluppatori \ No newline at end of file +# translation by 0NullChAr0 +Italian + WELCOME TO OPEN PS2 LOADER. MAIN CODE BASED ON SOURCE CODE OF HD PROJECT ADAPTATION TO USB ADVANCE FORMAT AND INITIAL GUI BY IFCARO MOST OF LOADER CORE IS MADE BY JIMMIKAELKAEL. ALL THE GUI IMPROVEMENTS ARE MADE BY VOLCA. THANKS FOR USING OUR PROGRAM ^^ +Open PS2 Loader %s +Salva cambiamenti +Indietro +Configura Network + +Impostazioni salvate... +Errore scrittura impostazioni! +Esci +Impostazioni +Giochi USB +Giochi HDD +Giochi Network +Applicazioni +Tema +Lingua +Avvio Network Errore: %d +Attivato +Disattivato +Ok +Impostazioni Gioco +Rimuovi tutte le impostazioni +Tutte le impostazioni del gioco sono state rimosse +Scorrimento +Lento +Medio +Veloce +Menu Predefinito +Carica dal disco +Per favore attendere +Errore caricamento ID del Gioco +Ordinamento Automatico +Errore caricamento file linguaggio +Disabilita Colori di Debug +Nessun controller rilevato, attendere... +Abilita Cover Art +Schermo ampio +Spegni +Caricamento Configurazioni +Salvataggio Configurazioni +Avvia Periferica +Avviamento periferica USB +Avviamento periferica HDD +Avviamento periferica ETH +Avviamento Applicazioni +Automatico +Manuale +Avvia HDL Server +Avviamento HDL Server... +Caricamento HDL Server... [O] Per Fermare +Premi [X] per fermare HDL... +Scaricamento HDL Server... +Esci per +Colore dello Sfondo +Colore del Testo +IP +Maschera +Ingresso +Porta +Titolo +Utente +Parola d'ordine + +Accetta +L'oggetto sarà cancellato definitivamente, continuare ? +Rinomina +Cancella +Avvia +Impostazioni Schermo +Abilita operazioni di Elimina e Rinomina +Controlla frammentazione Gioco USB +Ricorda ultimo gioco Avviato +Errore, il gioco è frammentato +Errore, impossibile avviare l'oggetto +Testa +Lasciare vuoto per Autorizzazioni GUEST +Carica Nucleo Alternativo +Metodo lettura data Alternativo +Sgancia chiamate Sistema +PSS Disabilitati +Disabilita DVD-DL +Disabilita IGR +Non utilizzato +Nascondi modulo dev9 +Combo IGR Alternato +Cambia le dimensioni della VMC +Creare +Modifica +Annulla +Resetta +Usa generico +Configura VMC +Nome +Dimensione +Stato +Progresso +File VMC esistente +File VMC invalido, la dimensione non è corretta +File VMC ancora da creare +Errore con il File VMC %s, continuare con MC fisica (slot %d) ? +Aggiornamento automatico +Informazioni +Sviluppatori +Ritardo USB +Prefisso Percorso USB +Lasciare vuoto per uscire al Browser +Valore in minuti, 0 per disabilitare spin down +Spin down HDD automatico +Modo Video +Colore Dialogo +Colore Selezionato +Mostra pagina info +Info +ELF Personalizzato +Colore Selezione +Riconnetti +Lasciare vuoto per la lista condivisioni +Prefisso Percorso ETH +Backspace +Spazio +Invio +Modo +VMC Slot 1 +VMC Slot 2 +ID Gioco +Modo DMA +V-Sync +Modo 1 +Modo 2 +Modo 3 +Modo 4 +Modo 5 +Modo 6 +Modo 7 +Modo 8 +Modo 9 +Cronometro Chiamata +Applica un ritardo alle funzioni CDVD (0 è Predefinito) \ No newline at end of file diff --git a/src/dia.c b/src/dia.c index 7594969..f6b00e4 100644 --- a/src/dia.c +++ b/src/dia.c @@ -76,7 +76,7 @@ int diaShowKeyb(char* text, int maxLen) { rmDrawRect(0, 0, screenWidth, screenHeight, gColDarker); //Text - fntRenderString(FNT_DEFAULT, 50, 120, ALIGN_NONE, 0, 0, text, gTheme->textColor); + fntRenderString(gTheme->fonts[0], 50, 120, ALIGN_NONE, 0, 0, text, gTheme->textColor); // separating line for simpler orientation rmDrawLine(25, 138, 615, 138, gColWhite); @@ -87,7 +87,7 @@ int diaShowKeyb(char* text, int maxLen) { c[0] = keyb[i + j * KEYB_WIDTH]; x = 50 + i * 31; - w = fntRenderString(FNT_DEFAULT, x, 170 + 3 * UI_SPACING_H * j, ALIGN_NONE, 0, 0, c, gTheme->uiTextColor) - x; + w = fntRenderString(gTheme->fonts[0], x, 170 + 3 * UI_SPACING_H * j, ALIGN_NONE, 0, 0, c, gTheme->uiTextColor) - x; if ((i + j * KEYB_WIDTH) == selchar) diaDrawBoundingBox(x, 170 + 3 * UI_SPACING_H * j, w, UI_SPACING_H, 0); } @@ -99,7 +99,7 @@ int diaShowKeyb(char* text, int maxLen) { rmDrawPixmap(cmdicons[i], 436, 170 + 3 * UI_SPACING_H * i, ALIGN_NONE, cmdicons[i]->Width, cmdicons[i]->Height, SCALING_RATIO, gDefaultCol); x = 477; - w = fntRenderString(FNT_DEFAULT, x, 170 + 3 * UI_SPACING_H * i, ALIGN_NONE, 0, 0, commands[i], gTheme->uiTextColor) - x; + w = fntRenderString(gTheme->fonts[0], x, 170 + 3 * UI_SPACING_H * i, ALIGN_NONE, 0, 0, commands[i], gTheme->uiTextColor) - x; if (i == selcommand) diaDrawBoundingBox(x, 170 + 3 * UI_SPACING_H * i, w, UI_SPACING_H, 0); } @@ -214,7 +214,7 @@ static int diaShowColSel(unsigned char *r, unsigned char *g, unsigned char *b) { rmDrawRect(0, 0, screenWidth, screenHeight, gColDarker); // "Color selection" - fntRenderString(FNT_DEFAULT, 50, 50, ALIGN_NONE, 0, 0, _l(_STR_COLOR_SELECTION), GS_SETREG_RGBA(0x060, 0x060, 0x060, 0x060)); + fntRenderString(gTheme->fonts[0], 50, 50, ALIGN_NONE, 0, 0, _l(_STR_COLOR_SELECTION), GS_SETREG_RGBA(0x060, 0x060, 0x060, 0x060)); // 3 bars representing the colors... size_t co; @@ -308,12 +308,12 @@ static void diaDrawHint(int text_id) { char* text = _l(text_id); - x = screenWidth - fntCalcDimensions(FNT_DEFAULT, text) - 10; + x = screenWidth - fntCalcDimensions(gTheme->fonts[0], text) - 10; y = gTheme->usedHeight - 40; // render hint on the lower side of the screen. rmDrawRect(x, y, screenWidth - x, MENU_ITEM_HEIGHT + 10, gColDarker); - fntRenderString(FNT_DEFAULT, x + 5, y + 5, ALIGN_NONE, 0, 0, text, gTheme->textColor); + fntRenderString(gTheme->fonts[0], x + 5, y + 5, ALIGN_NONE, 0, 0, text, gTheme->textColor); } /// renders an ui item (either selected or not) @@ -339,9 +339,9 @@ static void diaRenderItem(int x, int y, struct UIItem *item, int selected, int h // width is text length in pixels... const char *txt = diaGetLocalisedText(item->label.text, item->label.stringId); if(txt && strlen(txt)) - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, txt, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, txt, txtcol) - x; else - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, _l(_STR_NOT_SET), txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, _l(_STR_NOT_SET), txtcol) - x; break; } @@ -379,7 +379,7 @@ static void diaRenderItem(int x, int y, struct UIItem *item, int selected, int h case UI_OK: { const char *txt = _l(_STR_OK); - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, txt, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, txt, txtcol) - x; break; } @@ -387,15 +387,15 @@ static void diaRenderItem(int x, int y, struct UIItem *item, int selected, int h char tmp[10]; snprintf(tmp, 10, "%d", item->intvalue.current); - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, tmp, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, tmp, txtcol) - x; break; } case UI_STRING: { if(strlen(item->stringvalue.text)) - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, item->stringvalue.text, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, item->stringvalue.text, txtcol) - x; else - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, _l(_STR_NOT_SET), txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, _l(_STR_NOT_SET), txtcol) - x; break; } @@ -408,13 +408,13 @@ static void diaRenderItem(int x, int y, struct UIItem *item, int selected, int h stars[i] = '*'; stars[i] = '\0'; - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, stars, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, stars, txtcol) - x; break; } case UI_BOOL: { const char *txtval = _l((item->intvalue.current) ? _STR_ON : _STR_OFF); - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, txtval, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, txtval, txtcol) - x; break; } @@ -424,7 +424,7 @@ static void diaRenderItem(int x, int y, struct UIItem *item, int selected, int h if (!tv) tv = _l(_STR_NO_ITEMS); - *w = fntRenderString(FNT_DEFAULT, x, y, ALIGN_NONE, 0, 0, tv, txtcol) - x; + *w = fntRenderString(gTheme->fonts[0], x, y, ALIGN_NONE, 0, 0, tv, txtcol) - x; break; } diff --git a/src/fntsys.c b/src/fntsys.c index 722b058..c963d6b 100644 --- a/src/fntsys.c +++ b/src/fntsys.c @@ -30,7 +30,7 @@ extern int size_freesansfont_raw; // freetype vars static FT_Library font_library; -static int gCharHeight; +static int gCharHeight = 16; static s32 gFontSemaId; static ee_sema_t gFontSema; @@ -72,9 +72,6 @@ typedef struct { /// Nonzero if font is used int isValid; - /// Nonzero for custom fonts - int isDefault; - /// Texture atlases (default to NULL) atlas_t *atlases[ATLAS_MAX]; @@ -98,6 +95,40 @@ static FT_Vector delta; #define GLYPH_PAGE_OK(font,page) ((pageid <= font->cacheMaxPageID) && (font->glyphCache[page])) +static void fntCacheFlushPage(fnt_glyph_cache_entry_t *page) { + int i; + + for (i = 0; i < GLYPH_CACHE_PAGE_SIZE; ++i, ++page) { + page->isValid = 0; + // we're not doing any atlasFree or such - atlas has to be rebuild + page->allocation = NULL; + page->atlas = NULL; + } +} + +static void fntCacheFlush(font_t *font) { + // Release all the glyphs from the cache + int i; + for (i = 0; i <= font->cacheMaxPageID; ++i) { + if (font->glyphCache[i]) { + fntCacheFlushPage(font->glyphCache[i]); + free(font->glyphCache[i]); + font->glyphCache[i] = NULL; + } + } + + free(font->glyphCache); + font->glyphCache = NULL; + font->cacheMaxPageID = -1; + + // free all atlasses too, they're invalid now anyway + int aid; + for(aid = 0; aid < ATLAS_MAX; ++aid) { + atlasFree(font->atlases[aid]); + font->atlases[aid] = NULL; + } +} + static int fntPrepareGlyphCachePage(font_t *font, int pageid) { if (pageid > font->cacheMaxPageID) { fnt_glyph_cache_entry_t **np = realloc(font->glyphCache, (pageid + 1) * sizeof(fnt_glyph_cache_entry_t *)); @@ -131,33 +162,20 @@ static int fntPrepareGlyphCachePage(font_t *font, int pageid) { return 1; } -static void fntResetFontDef(font_t *fnt) { - fnt->glyphCache = NULL; - fnt->cacheMaxPageID = -1; - fnt->isValid = 0; - fnt->isDefault = 0; - - int aid; - for(aid = 0; aid < ATLAS_MAX; ++aid) - fnt->atlases[aid] = NULL; - - fnt->dataPtr = NULL; -} - static void fntPrepareCLUT() { fontClut.PSM = GS_PSM_T8; fontClut.ClutPSM = GS_PSM_CT32; fontClut.Clut = memalign(128, 256 * 4); fontClut.VramClut = 0; - + // generate the clut table size_t i; u32 *clut = fontClut.Clut; for (i = 0; i < 256; ++i) { u8 alpha = i > 0x080 ? 0x080 : i; - + *clut = alpha << 24 | i << 16 | i << 8 | i; - clut++; + clut++; } } @@ -166,87 +184,24 @@ static void fntDestroyCLUT() { fontClut.Clut = NULL; } -void fntInit(void) { - LOG("FNTSYS Init\n"); - int error = FT_Init_FreeType(&font_library); - - if (error) { - // just report over the ps2link - LOG("FNTSYS Freetype init failed with %x!\n", error); - // SleepThread(); - } - - fntPrepareCLUT(); - - gFontSema.init_count = 1; - gFontSema.max_count = 1; - gFontSema.option = 0; - gFontSemaId = CreateSema(&gFontSema); - - int i; - for (i = 0; i < FNT_MAX_COUNT; ++i) - fntResetFontDef(&fonts[i]); - - // load the default font (will be id=0) - fntLoad(NULL, -1, 0); -} - -static void fntCacheFlushPage(fnt_glyph_cache_entry_t *page) { - int i; - - for (i = 0; i < GLYPH_CACHE_PAGE_SIZE; ++i, ++page) { - page->isValid = 0; - // we're not doing any atlasFree or such - atlas has to be rebuild - page->allocation = NULL; - page->atlas = NULL; - } -} - -static void fntCacheFlush(font_t *fnt) { - int i; - - // Release all the glyphs from the cache - for (i = 0; i <= fnt->cacheMaxPageID; ++i) { - if (fnt->glyphCache[i]) { - fntCacheFlushPage(fnt->glyphCache[i]); - free(fnt->glyphCache[i]); - fnt->glyphCache[i] = NULL; - } - } - - free(fnt->glyphCache); - fnt->glyphCache = NULL; - fnt->cacheMaxPageID = -1; - - // free all atlasses too, they're invalid now anyway - int aid; - for(aid = 0; aid < ATLAS_MAX; ++aid) { - atlasFree(fnt->atlases[aid]); - fnt->atlases[aid] = NULL; - } -} - -static int fntNewFont() { - int i; - for (i = 0; i < FNT_MAX_COUNT; ++i) { - if (fonts[i].isValid == 0) { - fntResetFontDef(&fonts[i]); - return i; - } - } +static void fntInitSlot(font_t *font) { + font->face = NULL; + font->glyphCache = NULL; + font->cacheMaxPageID = -1; + font->dataPtr = NULL; + font->isValid = 0; - return FNT_ERROR; + int aid = 0; + for(; aid < ATLAS_MAX; ++aid) + font->atlases[aid] = NULL; } -void fntDeleteFont(font_t *font) { - // skip already deleted fonts - if (!font->isValid) - return; - +static void fntDeleteSlot(font_t *font) { // free the glyph cache, atlases, unload the font fntCacheFlush(font); FT_Done_Face(font->face); + font->face = NULL; if (font->dataPtr) { free(font->dataPtr); @@ -256,85 +211,110 @@ void fntDeleteFont(font_t *font) { font->isValid = 0; } -int fntLoadSlot(font_t *fnt, void* buffer, int bufferSize) { - if (!buffer) { +void fntRelease(int id) { + if (id > FNT_DEFAULT && id < FNT_MAX_COUNT) + fntDeleteSlot(&fonts[id]); +} + +static int fntLoadSlot(font_t *font, char* path) { + void* buffer = NULL; + int bufferSize = -1; + + fntInitSlot(font); + + if (path) { + buffer = readFile(path, -1, &bufferSize); + if (!buffer) { + LOG("FNTSYS Font file loading failed: %s\n", path); + return FNT_ERROR; + } + font->dataPtr = buffer; + } else { buffer = &freesansfont_raw; bufferSize = size_freesansfont_raw; - fnt->isDefault = 1; } // load the font via memory handle - int error = FT_New_Memory_Face(font_library, (FT_Byte*) buffer, bufferSize, 0, &fnt->face); - + int error = FT_New_Memory_Face(font_library, (FT_Byte*) buffer, bufferSize, 0, &font->face); if (error) { - // just report over the ps2link LOG("FNTSYS Freetype font loading failed with %x!\n", error); - // SleepThread(); - return -1; + fntDeleteSlot(font); + return FNT_ERROR; } - gCharHeight = 16; - - error = FT_Set_Char_Size(fnt->face, 0, gCharHeight * 16, 300, 300); - /*error = FT_Set_Pixel_Sizes( face, - 0, // pixel_width - gCharHeight ); // pixel_height*/ - + error = FT_Set_Char_Size(font->face, 0, gCharHeight * 16, 300, 300); + /*error = FT_Set_Pixel_Sizes( face, 0, // pixel_width gCharHeight ); // pixel_height */ if (error) { - // just report over the ps2link LOG("FNTSYS Freetype error setting font pixel size with %x!\n", error); - // SleepThread(); - return -1; + fntDeleteSlot(font); + return FNT_ERROR; } - fnt->isValid = 1; + font->isValid = 1; return 0; } -int fntLoad(void* buffer, int bufferSize, int takeover) { - // we need a new slot in the font array - int fontID = fntNewFont(); - - if (fontID == FNT_ERROR) - return FNT_ERROR; +void fntInit() { + LOG("FNTSYS Init\n"); + int error = FT_Init_FreeType(&font_library); + if (error) { + // just report over the ps2link + LOG("FNTSYS Freetype init failed with %x!\n", error); + // SleepThread(); + } - font_t *fnt = &fonts[fontID]; + fntPrepareCLUT(); - if (fntLoadSlot(fnt, buffer, bufferSize) == FNT_ERROR) - return FNT_ERROR; + gFontSema.init_count = 1; + gFontSema.max_count = 1; + gFontSema.option = 0; + gFontSemaId = CreateSema(&gFontSema); - if (takeover) - fnt->dataPtr = buffer; + int i = 0; + for (; i < FNT_MAX_COUNT; ++i) + fntInitSlot(&fonts[i]); - return fontID; + fntLoadDefault(NULL); } int fntLoadFile(char* path) { - LOG("FNTSYS LoadFile: %s\n", path); - // load the buffer with font - int size = -1; - void* customFont = readFile(path, -1, &size); + font_t *font; + int i = 1; + for (; i < FNT_MAX_COUNT; i++) { + font = &fonts[i]; + if (!font->isValid) { + if (fntLoadSlot(font, path) != FNT_ERROR) + return i; + break; + } + } - if (!customFont) - return FNT_ERROR; + return FNT_ERROR; +} - int fontID = fntLoad(customFont, size, 1); +void fntLoadDefault(char* path) { + font_t newFont, oldFont; - return fontID; -} + if (fntLoadSlot(&newFont, path) != FNT_ERROR) { + // copy over the new font definition + // we have to lock this phase, as the old font may still be used + // Note: No check for concurrency is done here, which is kinda funky! + WaitSema(gFontSemaId); + memcpy(&oldFont, &fonts[FNT_DEFAULT], sizeof(font_t)); + memcpy(&fonts[FNT_DEFAULT], &newFont, sizeof(font_t)); + SignalSema(gFontSemaId); -void fntRelease(int id) { - if (id < FNT_MAX_COUNT) - fntDeleteFont(&fonts[id]); + // delete the old font + fntDeleteSlot(&oldFont); + } } -/** Terminates the font rendering system */ -void fntEnd(void) { +void fntEnd() { LOG("FNTSYS End\n"); // release all the fonts int id; for (id = 0; id < FNT_MAX_COUNT; ++id) - fntDeleteFont(&fonts[id]); + fntDeleteSlot(&fonts[id]); // deinit freetype system FT_Done_FreeType(font_library); @@ -353,8 +333,8 @@ static atlas_t *fntNewAtlas() { return atl; } -static int fntGlyphAtlasPlace(font_t *fnt, fnt_glyph_cache_entry_t* glyph) { - FT_GlyphSlot slot = fnt->face->glyph; +static int fntGlyphAtlasPlace(font_t *font, fnt_glyph_cache_entry_t* glyph) { + FT_GlyphSlot slot = font->face->glyph; //LOG("FNTSYS GlyphAtlasPlace: Placing the glyph... %d x %d\n", slot->bitmap.width, slot->bitmap.rows); @@ -363,19 +343,16 @@ static int fntGlyphAtlasPlace(font_t *fnt, fnt_glyph_cache_entry_t* glyph) { return 1; } - int aid; - - for (aid = 0; aid < ATLAS_MAX; ++aid) { + int aid = 0; + for (; aid < ATLAS_MAX; aid++) { //LOG("FNTSYS Placing aid %d...\n", aid); - atlas_t **atl = &fnt->atlases[aid]; + atlas_t **atl = &font->atlases[aid]; if (!*atl) { // atlas slot not yet used //LOG("FNTSYS aid %d is new...\n", aid); *atl = fntNewAtlas(); } - glyph->allocation = - atlasPlace(*atl, slot->bitmap.width, slot->bitmap.rows, slot->bitmap.buffer); - + glyph->allocation = atlasPlace(*atl, slot->bitmap.width, slot->bitmap.rows, slot->bitmap.buffer); if (glyph->allocation) { //LOG("FNTSYS Found placement\n", aid); glyph->atlas = *atl; @@ -389,45 +366,42 @@ static int fntGlyphAtlasPlace(font_t *fnt, fnt_glyph_cache_entry_t* glyph) { } /** Internal method. Makes sure the bitmap data for particular character are pre-rendered to the glyph cache */ -static fnt_glyph_cache_entry_t* fntCacheGlyph(font_t *fnt, uint32_t gid) { +static fnt_glyph_cache_entry_t* fntCacheGlyph(font_t *font, uint32_t gid) { // calc page id and in-page index from glyph id int pageid = gid / GLYPH_CACHE_PAGE_SIZE; int idx = gid % GLYPH_CACHE_PAGE_SIZE; // do not call on every char of every font rendering call - if (!GLYPH_PAGE_OK(fnt,pageid)) - if (!fntPrepareGlyphCachePage(fnt, pageid)) // failed to prepare the page... + if (!GLYPH_PAGE_OK(font, pageid)) + if (!fntPrepareGlyphCachePage(font, pageid)) // failed to prepare the page... return NULL; - fnt_glyph_cache_entry_t *page = fnt->glyphCache[pageid]; - + fnt_glyph_cache_entry_t *page = font->glyphCache[pageid]; /* Should never happen. if (!page) // safeguard return NULL; */ fnt_glyph_cache_entry_t* glyph = &page[idx]; - if (glyph->isValid) return glyph; // not cached but valid. Cache - if (!fnt->face) { + if (!font->face) { LOG("FNTSYS Face is NULL!\n"); } - int error = FT_Load_Char(fnt->face, gid, FT_LOAD_RENDER); - + int error = FT_Load_Char(font->face, gid, FT_LOAD_RENDER); if (error) { LOG("FNTSYS Error loading glyph - %d\n", error); return NULL; } // find atlas placement for the glyph - if (!fntGlyphAtlasPlace(fnt, glyph)) + if (!fntGlyphAtlasPlace(font, glyph)) return NULL; - FT_GlyphSlot slot = fnt->face->glyph; + FT_GlyphSlot slot = font->face->glyph; glyph->width = slot->bitmap.width; glyph->height = slot->bitmap.rows; glyph->shx = slot->advance.x; @@ -442,15 +416,14 @@ static fnt_glyph_cache_entry_t* fntCacheGlyph(font_t *fnt, uint32_t gid) { void fntSetAspectRatio(float aw, float ah) { // flush cache - it will be invalid after the setting - int i; - - for (i = 0; i < FNT_MAX_COUNT; ++i) { + int i = 0; + for (; i < FNT_MAX_COUNT; i++) { if (fonts[i].isValid) fntCacheFlush(&fonts[i]); } - // set new aspect ratio (Is this correct, I wonder?) - // TODO: error = FT_Set_Char_Size(face, 0, gCharHeight*64, ah*300, aw*300); + // TODO: set new aspect ratio (Is this correct, I wonder?) + // error = FT_Set_Char_Size(face, 0, gCharHeight*64, ah*300, aw*300); } static void fntRenderGlyph(fnt_glyph_cache_entry_t* glyph, int pen_x, int pen_y) { @@ -461,8 +434,8 @@ static void fntRenderGlyph(fnt_glyph_cache_entry_t* glyph, int pen_x, int pen_y) * * 2. GS_SETREG_TEX0 for every quad - why? gsKit should only set texture if demanded * We should prepare a special fnt render method that would step over most of the - * performance problems under - begining with rmSetupQuad and continuing into gsKit - * - this method would handle the preparetion of the quads and GS upload itself, + * performance problems under - beginning with rmSetupQuad and continuing into gsKit + * - this method would handle the preparation of the quads and GS upload itself, * without the use of prim_quad_texture and rmSetupQuad... * * 3. We should use clut to keep the memory allocations sane - we're linear in the 32bit buffers @@ -485,17 +458,17 @@ static void fntRenderGlyph(fnt_glyph_cache_entry_t* glyph, int pen_x, int pen_y) } #ifndef __RTL -int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t height, const unsigned char* string, u64 colour) { +int fntRenderString(int id, int x, int y, short aligned, size_t width, size_t height, const unsigned char* string, u64 colour) { // wait for font lock to unlock WaitSema(gFontSemaId); - font_t *fnt = &fonts[font]; + font_t *font = &fonts[id]; SignalSema(gFontSemaId); if (aligned) { if (width) { - x -= min(fntCalcDimensions(font, string), width) >> 1; + x -= min(fntCalcDimensions(id, string), width) >> 1; } else { - x -= fntCalcDimensions(font, string) >> 1; + x -= fntCalcDimensions(id, string) >> 1; } y -= MENU_ITEM_HEIGHT >> 1; } @@ -507,7 +480,7 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t int xmax = x + width; int ymax = y + height; - use_kerning = FT_HAS_KERNING(fnt->face); + use_kerning = FT_HAS_KERNING(font->face); state = UTF8_ACCEPT; previous = 0; @@ -523,15 +496,15 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t if (utf8Decode(&state, &codepoint, *string)) // accumulate the codepoint value continue; - glyph = fntCacheGlyph(fnt, codepoint); + glyph = fntCacheGlyph(font, codepoint); if (!glyph) continue; // kerning if (use_kerning && previous) { - glyph_index = FT_Get_Char_Index(fnt->face, codepoint); + glyph_index = FT_Get_Char_Index(font->face, codepoint); if (glyph_index) { - FT_Get_Kerning(fnt->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning(font->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); pen_x += delta.x >> 6; } previous = glyph_index; @@ -561,7 +534,7 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t } #else -static void fntRenderSubRTL(font_t *fnt, const unsigned char* startRTL, const unsigned char* string, fnt_glyph_cache_entry_t* glyph, int x, int y) { +static void fntRenderSubRTL(font_t *font, const unsigned char* startRTL, const unsigned char* string, fnt_glyph_cache_entry_t* glyph, int x, int y) { if (glyph) { x -= glyph->shx >> 6; fntRenderGlyph(glyph, x, y); @@ -571,14 +544,14 @@ static void fntRenderSubRTL(font_t *fnt, const unsigned char* startRTL, const un if (utf8Decode(&state, &codepoint, *startRTL)) continue; - glyph = fntCacheGlyph(fnt, codepoint); + glyph = fntCacheGlyph(font, codepoint); if (!glyph) continue; if (use_kerning && previous) { - glyph_index = FT_Get_Char_Index(fnt->face, codepoint); + glyph_index = FT_Get_Char_Index(font->face, codepoint); if (glyph_index) { - FT_Get_Kerning(fnt->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning(font->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); x -= delta.x >> 6; } previous = glyph_index; @@ -589,17 +562,17 @@ static void fntRenderSubRTL(font_t *fnt, const unsigned char* startRTL, const un } } -int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t height, const unsigned char* string, u64 colour) { +int fntRenderString(int id, int x, int y, short aligned, size_t width, size_t height, const unsigned char* string, u64 colour) { // wait for font lock to unlock WaitSema(gFontSemaId); - font_t *fnt = &fonts[font]; + font_t *font = &fonts[id]; SignalSema(gFontSemaId); if (aligned) { if (width) { - x -= min(fntCalcDimensions(font, string), width) >> 1; + x -= min(fntCalcDimensions(id, string), width) >> 1; } else { - x -= fntCalcDimensions(font, string) >> 1; + x -= fntCalcDimensions(id, string) >> 1; } y -= MENU_ITEM_HEIGHT >> 1; } @@ -611,7 +584,7 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t /*int xmax = x + width; int ymax = y + height;*/ - use_kerning = FT_HAS_KERNING(fnt->face); + use_kerning = FT_HAS_KERNING(font->face); state = UTF8_ACCEPT; previous = 0; @@ -625,16 +598,16 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t if (utf8Decode(&state, &codepoint, *string)) // accumulate the codepoint value continue; - glyph = fntCacheGlyph(fnt, codepoint); + glyph = fntCacheGlyph(font, codepoint); if (!glyph) continue; // kerning delta_x = 0; if (use_kerning && previous) { - glyph_index = FT_Get_Char_Index(fnt->face, codepoint); + glyph_index = FT_Get_Char_Index(font->face, codepoint); if (glyph_index) { - FT_Get_Kerning(fnt->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning(font->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); delta_x = delta.x >> 6; } previous = glyph_index; @@ -663,7 +636,7 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t if (inRTL) { // render RTL inRTL = 0; pen_x = pen_xRTL; - fntRenderSubRTL(fnt, startRTL, string, glyphRTL, pen_xRTL, y); + fntRenderSubRTL(font, startRTL, string, glyphRTL, pen_xRTL, y); } } @@ -679,17 +652,17 @@ int fntRenderString(int font, int x, int y, short aligned, size_t width, size_t if (inRTL) { pen_x = pen_xRTL; - fntRenderSubRTL(fnt, startRTL, string, glyphRTL, pen_xRTL, y); + fntRenderSubRTL(font, startRTL, string, glyphRTL, pen_xRTL, y); } return pen_x; } #endif -void fntFitString(int font, unsigned char *string, size_t width) { +void fntFitString(int id, unsigned char *string, size_t width) { size_t cw = 0; unsigned char *str = string; - size_t spacewidth = fntCalcDimensions(font, " "); + size_t spacewidth = fntCalcDimensions(id, " "); unsigned char *psp = NULL; while (*str) { @@ -714,7 +687,7 @@ void fntFitString(int font, unsigned char *string, size_t width) { // Calc the font's width... // NOTE: The word was terminated, so we're seeing a single word // on that position - size_t ww = fntCalcDimensions(font, str); + size_t ww = fntCalcDimensions(id, str); if (cw + ww > width) { if (psp) { @@ -740,16 +713,16 @@ void fntFitString(int font, unsigned char *string, size_t width) { } } -int fntCalcDimensions(int font, const unsigned char* str) { +int fntCalcDimensions(int id, const unsigned char* str) { int w = 0; WaitSema(gFontSemaId); - font_t *fnt = &fonts[font]; + font_t *font = &fonts[id]; SignalSema(gFontSemaId); uint32_t codepoint; uint32_t state = UTF8_ACCEPT; - FT_Bool use_kerning = FT_HAS_KERNING(fnt->face); + FT_Bool use_kerning = FT_HAS_KERNING(font->face); FT_UInt glyph_index, previous = 0; FT_Vector delta; @@ -760,15 +733,15 @@ int fntCalcDimensions(int font, const unsigned char* str) { // Could just as well only get the glyph dimensions // but it is probable the glyphs will be needed anyway - fnt_glyph_cache_entry_t* glyph = fntCacheGlyph(fnt, codepoint); + fnt_glyph_cache_entry_t* glyph = fntCacheGlyph(font, codepoint); if (!glyph) continue; // kerning if (use_kerning && previous) { - glyph_index = FT_Get_Char_Index(fnt->face, codepoint); + glyph_index = FT_Get_Char_Index(font->face, codepoint); if (glyph_index) { - FT_Get_Kerning(fnt->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning(font->face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); w += delta.x >> 6; } previous = glyph_index; @@ -779,49 +752,3 @@ int fntCalcDimensions(int font, const unsigned char* str) { return w; } - -void fntReplace(int id, void* buffer, int bufferSize, int takeover, int asDefault) { - font_t *fnt = &fonts[id]; - - font_t ndefault, old; - fntResetFontDef(&ndefault); - fntLoadSlot(&ndefault, buffer, bufferSize); - ndefault.isDefault = asDefault; - - // copy over the new font definition - // we have to lock this phase, as the old font may still be used - WaitSema(gFontSemaId); - memcpy(&old, fnt, sizeof(font_t)); - memcpy(fnt, &ndefault, sizeof(font_t)); - - if (takeover) - fnt->dataPtr = buffer; - - SignalSema(gFontSemaId); - - // delete the old font - fntDeleteFont(&old); -} - -void fntSetDefault(int id) { - font_t *fnt = &fonts[id]; - - // already default - if (fnt->isDefault) - return; - - font_t ndefault, old; - fntResetFontDef(&ndefault); - fntLoadSlot(&ndefault, NULL, -1); - - // copy over the new font definition - // we have to lock this phase, as the old font may still be used - // Note: No check for concurrency is done here, which is kinda funky! - WaitSema(gFontSemaId); - memcpy(&old, fnt, sizeof(font_t)); - memcpy(fnt, &ndefault, sizeof(font_t)); - SignalSema(gFontSemaId); - - // delete the old font - fntDeleteFont(&old); -} diff --git a/src/gui.c b/src/gui.c index c8957f7..2b5ebd6 100644 --- a/src/gui.c +++ b/src/gui.c @@ -1111,7 +1111,7 @@ static void guiDrawOverlays() { else snprintf(fps, 20, "%3d ms ----- FPS", time_render); - fntRenderString(FNT_DEFAULT, screenWidth - 90, 30, ALIGN_CENTER, 0, 0, fps, GS_SETREG_RGBA(0x060, 0x060, 0x060, 0x060)); + fntRenderString(gTheme->fonts[0], screenWidth - 90, 30, ALIGN_CENTER, 0, 0, fps, GS_SETREG_RGBA(0x060, 0x060, 0x060, 0x060)); #endif } @@ -1287,10 +1287,10 @@ int guiMsgBox(const char* text, int addAccept, struct UIItem *ui) { rmDrawLine(50, 75, screenWidth - 50, 75, gColWhite); rmDrawLine(50, 410, screenWidth - 50, 410, gColWhite); - fntRenderString(FNT_DEFAULT, screenWidth >> 1, gTheme->usedHeight >> 1, ALIGN_CENTER, 0, 0, text, gTheme->textColor); - guiDrawIconAndText(CIRCLE_ICON, _STR_O_BACK, FNT_DEFAULT, 500, 417, gTheme->selTextColor); + fntRenderString(gTheme->fonts[0], screenWidth >> 1, gTheme->usedHeight >> 1, ALIGN_CENTER, 0, 0, text, gTheme->textColor); + guiDrawIconAndText(CIRCLE_ICON, _STR_O_BACK, gTheme->fonts[0], 500, 417, gTheme->selTextColor); if (addAccept) - guiDrawIconAndText(CROSS_ICON, _STR_X_ACCEPT, FNT_DEFAULT, 70, 417, gTheme->selTextColor); + guiDrawIconAndText(CROSS_ICON, _STR_X_ACCEPT, gTheme->fonts[0], 70, 417, gTheme->selTextColor); guiEndFrame(); } @@ -1312,7 +1312,7 @@ void guiRenderTextScreen(const unsigned char* message) { rmDrawRect(0, 0, screenWidth, screenHeight, gColDarker); - fntRenderString(FNT_DEFAULT, screenWidth >> 1, gTheme->usedHeight >> 1, ALIGN_CENTER, 0, 0, message, gTheme->textColor); + fntRenderString(gTheme->fonts[0], screenWidth >> 1, gTheme->usedHeight >> 1, ALIGN_CENTER, 0, 0, message, gTheme->textColor); guiDrawOverlays(); diff --git a/src/lang.c b/src/lang.c index 2cb11ad..11322a1 100644 --- a/src/lang.c +++ b/src/lang.c @@ -197,17 +197,10 @@ static int lngLoadFromFile(char* path, char *name) { strId++; } - int size = -1; char path[255]; snprintf(path, 255, "%s/font_%s.ttf", gBaseMCDir, name); - LOG("LANG Custom font path: %s\n", path); - - void* customFont = readFile(path, -1, &size); - if (customFont) - fntReplace(FNT_DEFAULT, customFont, size, 1, 1); // consider fonts loaded through language as default, so they won't be reset-ed when changing themes - else - fntSetDefault(FNT_DEFAULT); + fntLoadDefault(path); return 1; } diff --git a/src/menusys.c b/src/menusys.c index 7e8c2cd..42fa49c 100644 --- a/src/menusys.c +++ b/src/menusys.c @@ -518,7 +518,7 @@ void menuRenderMenu() { int cp = 0; // current position for (it = mainMenu; it; it = it->next, cp++) { // render, advance - fntRenderString(gTheme->itemsList->font, 320, y, ALIGN_CENTER, 0, 0, submenuItemGetText(&it->item), (cp == sitem) ? gTheme->selTextColor : gTheme->textColor); + fntRenderString(gTheme->fonts[0], 320, y, ALIGN_CENTER, 0, 0, submenuItemGetText(&it->item), (cp == sitem) ? gTheme->selTextColor : gTheme->textColor); y += spacing; } } diff --git a/src/themes.c b/src/themes.c index 86bf7e7..6707f3d 100644 --- a/src/themes.c +++ b/src/themes.c @@ -589,13 +589,12 @@ static theme_element_t* initBasic(char* themePath, config_set_t* themeConfig, th else elem->color = color; + elem->font = font; snprintf(elemProp, 64, "%s_font", name); - if (configGetInt(themeConfig, elemProp, &intValue)) - font = intValue; - if (font >= 0 && font < THM_MAX_FONTS) - elem->font = theme->fonts[font]; - else - elem->font = FNT_DEFAULT; + if (configGetInt(themeConfig, elemProp, &intValue)) { + if (intValue > 0 && intValue < THM_MAX_FONTS) + elem->font = theme->fonts[intValue]; + } return elem; } @@ -747,7 +746,7 @@ static void validateGUIElems(char* themePath, config_set_t* themeConfig, theme_t // 1. check we have a valid Background elements if ( !theme->mainElems.first || (theme->mainElems.first->type != TYPE_BACKGROUND) ) { LOG("THEMES No valid background found for main, add default BG_ART\n"); - theme_element_t* backgroundElem = initBasic(themePath, themeConfig, theme, "bg", TYPE_BACKGROUND, 0, 0, ALIGN_NONE, screenWidth, screenHeight, SCALING_NONE, gDefaultCol, FNT_DEFAULT); + theme_element_t* backgroundElem = initBasic(themePath, themeConfig, theme, "bg", TYPE_BACKGROUND, 0, 0, ALIGN_NONE, screenWidth, screenHeight, SCALING_NONE, gDefaultCol, theme->fonts[0]); if (themePath) initBackground(themePath, themeConfig, theme, backgroundElem, "bg", "BG", 1, "background"); else @@ -759,7 +758,7 @@ static void validateGUIElems(char* themePath, config_set_t* themeConfig, theme_t if (theme->infoElems.first) { if (theme->infoElems.first->type != TYPE_BACKGROUND) { LOG("THEMES No valid background found for info, add default BG_ART\n"); - theme_element_t* backgroundElem = initBasic(themePath, themeConfig, theme, "bg", TYPE_BACKGROUND, 0, 0, ALIGN_NONE, screenWidth, screenHeight, SCALING_NONE, gDefaultCol, FNT_DEFAULT); + theme_element_t* backgroundElem = initBasic(themePath, themeConfig, theme, "bg", TYPE_BACKGROUND, 0, 0, ALIGN_NONE, screenWidth, screenHeight, SCALING_NONE, gDefaultCol, theme->fonts[0]); if (themePath) initBackground(themePath, themeConfig, theme, backgroundElem, "bg", "BG", 1, "background"); else @@ -792,7 +791,7 @@ static void validateGUIElems(char* themePath, config_set_t* themeConfig, theme_t } } else { LOG("THEMES No itemsList found, adding a default one\n"); - theme->itemsList = initBasic(themePath, themeConfig, theme, "il", TYPE_ITEMS_LIST, 150, MENU_POS_V, ALIGN_NONE, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + theme->itemsList = initBasic(themePath, themeConfig, theme, "il", TYPE_ITEMS_LIST, 150, MENU_POS_V, ALIGN_NONE, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]); initItemsList(themePath, themeConfig, theme, theme->itemsList, "il", NULL); theme->itemsList->next = theme->mainElems.first->next; // Position the itemsList as second element (right after the Background) theme->mainElems.first->next = theme->itemsList; @@ -813,55 +812,55 @@ static int addGUIElem(char* themePath, config_set_t* themeConfig, theme_t* theme configGetStr(themeConfig, elemProp, &type); if (type) { if (!strcmp(elementsType[TYPE_ATTRIBUTE_TEXT], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_ATTRIBUTE_TEXT, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_ATTRIBUTE_TEXT, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]); initAttributeText(themePath, themeConfig, theme, elem, name, NULL); } else if (!strcmp(elementsType[TYPE_STATIC_TEXT], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_STATIC_TEXT, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_STATIC_TEXT, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]); initStaticText(themePath, themeConfig, theme, elem, name, NULL); } else if (!strcmp(elementsType[TYPE_ATTRIBUTE_IMAGE], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_ATTRIBUTE_IMAGE, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_ATTRIBUTE_IMAGE, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); initAttributeImage(themePath, themeConfig, theme, elem, name); } else if (!strcmp(elementsType[TYPE_GAME_IMAGE], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_GAME_IMAGE, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_GAME_IMAGE, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); initGameImage(themePath, themeConfig, theme, elem, name, NULL, 1, NULL, NULL); } else if (!strcmp(elementsType[TYPE_STATIC_IMAGE], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_STATIC_IMAGE, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_STATIC_IMAGE, 0, 0, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); initStaticImage(themePath, themeConfig, theme, elem, name, NULL); } else if (!strcmp(elementsType[TYPE_BACKGROUND], type)) { if (!elems->first) { // Background elem can only be the first one - elem = initBasic(themePath, themeConfig, theme, name, TYPE_BACKGROUND, 0, 0, ALIGN_NONE, screenWidth, screenHeight, SCALING_NONE, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_BACKGROUND, 0, 0, ALIGN_NONE, screenWidth, screenHeight, SCALING_NONE, gDefaultCol, theme->fonts[0]); initBackground(themePath, themeConfig, theme, elem, name, NULL, 1, NULL); } } else if (!strcmp(elementsType[TYPE_MENU_ICON], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_MENU_ICON, 40, 40, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_MENU_ICON, 40, 40, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); elem->drawElem = &drawMenuIcon; } else if (!strcmp(elementsType[TYPE_MENU_TEXT], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_MENU_TEXT, screenWidth >> 1, 20, ALIGN_CENTER, 200, 20, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_MENU_TEXT, screenWidth >> 1, 20, ALIGN_CENTER, 200, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]); elem->drawElem = &drawMenuText; } else if (!strcmp(elementsType[TYPE_ITEMS_LIST], type)) { if (!theme->itemsList) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_ITEMS_LIST, 150, MENU_POS_V, ALIGN_NONE, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_ITEMS_LIST, 150, MENU_POS_V, ALIGN_NONE, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]); initItemsList(themePath, themeConfig, theme, elem, name, NULL); theme->itemsList = elem; } } else if (!strcmp(elementsType[TYPE_ITEM_ICON], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_GAME_IMAGE, 80, theme->usedHeight >> 1, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_GAME_IMAGE, 80, theme->usedHeight >> 1, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); initGameImage(themePath, themeConfig, theme, elem, name, "ICO", 20, NULL, NULL); } else if (!strcmp(elementsType[TYPE_ITEM_COVER], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_GAME_IMAGE, 520, theme->usedHeight >> 1, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_GAME_IMAGE, 520, theme->usedHeight >> 1, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); initGameImage(themePath, themeConfig, theme, elem, name, "COV", 10, NULL, NULL); } else if (!strcmp(elementsType[TYPE_ITEM_TEXT], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_ITEM_TEXT, 520, 370, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_ITEM_TEXT, 520, 370, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, theme->textColor, theme->fonts[0]); elem->drawElem = &drawItemText; } else if (!strcmp(elementsType[TYPE_HINT_TEXT], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_HINT_TEXT, 16, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_HINT_TEXT, 16, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]); elem->drawElem = &drawHintText; } else if (!strcmp(elementsType[TYPE_INFO_HINT_TEXT], type)) { - elem = initBasic(themePath, themeConfig, theme, name, TYPE_INFO_HINT_TEXT, 16, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, FNT_DEFAULT); + elem = initBasic(themePath, themeConfig, theme, name, TYPE_INFO_HINT_TEXT, 16, -HINT_HEIGHT, ALIGN_NONE, 12, 20, SCALING_RATIO, theme->textColor, theme->fonts[0]); elem->drawElem = &drawInfoHintText; } else if (!strcmp(elementsType[TYPE_LOADING_ICON], type)) { if (!theme->loadingIcon) - theme->loadingIcon = initBasic(themePath, themeConfig, theme, name, TYPE_LOADING_ICON, -40, -60, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, FNT_DEFAULT); + theme->loadingIcon = initBasic(themePath, themeConfig, theme, name, TYPE_LOADING_ICON, -40, -60, ALIGN_CENTER, DIM_UNDEF, DIM_UNDEF, SCALING_RATIO, gDefaultCol, theme->fonts[0]); } if (elem) { @@ -926,12 +925,8 @@ static void thmFree(theme_t* theme) { } // free fonts - for (id = 0; id < THM_MAX_FONTS; ++id) { - int fntid = theme->fonts[id]; - - if (fntid != FNT_DEFAULT) - fntRelease(fntid); - } + for (id = 0; id < THM_MAX_FONTS; ++id) + fntRelease(theme->fonts[id]); free(theme); theme = NULL; @@ -987,49 +982,29 @@ static void thmSetColors(theme_t* theme) { static void thmLoadFonts(config_set_t* themeConfig, const char* themePath, theme_t* theme) { int fntID; // theme side font id, not the fntSys handle - for (fntID = -1; fntID < THM_MAX_FONTS; ++fntID) { + for (fntID = 0; fntID < THM_MAX_FONTS; ++fntID) { // does the font by the key exist? char fntKey[16]; - // -1 is a placeholder for default font... - if (fntID >= 0) { - // Default font handle... - theme->fonts[fntID] = FNT_DEFAULT; - snprintf(fntKey, 16, "font%d", fntID); - } else { + if (fntID == 0) { snprintf(fntKey, 16, "default_font"); + theme->fonts[0] = FNT_DEFAULT; + } else { + snprintf(fntKey, 16, "font%d", fntID); + theme->fonts[fntID] = theme->fonts[0]; } - char *fntFile; - int cfgKeyOK = configGetStr(themeConfig, fntKey, &fntFile); - if (!cfgKeyOK && (fntID >= 0)) - continue; - char fullPath[128]; - - if (fntID < 0) { - // replace the default font - if (cfgKeyOK) { - snprintf(fullPath, 128, "%s%s", themePath, fntFile); - - int size = -1; - void* customFont = readFile(fullPath, -1, &size); - - if (customFont) - fntReplace(FNT_DEFAULT, customFont, size, 1, 0); - } else { - // TODO reload the language font file - fntSetDefault(FNT_DEFAULT); - } - } else { + char *fntFile; + if (configGetStr(themeConfig, fntKey, &fntFile)) { snprintf(fullPath, 128, "%s%s", themePath, fntFile); int fntHandle = fntLoadFile(fullPath); // Do we have a valid font? Assign the font handle to the theme font slot if (fntHandle != FNT_ERROR) theme->fonts[fntID] = fntHandle; - }; - }; + } + } } static void thmLoad(char* themePath) { @@ -1061,9 +1036,6 @@ static void thmLoad(char* themePath) { addGUIElem(themePath, themeConfig, newT, &newT->mainElems, elementsType[TYPE_ITEM_TEXT], "_"); addGUIElem(themePath, themeConfig, newT, &newT->mainElems, elementsType[TYPE_HINT_TEXT], "_"); addGUIElem(themePath, themeConfig, newT, &newT->mainElems, elementsType[TYPE_LOADING_ICON], "_"); - - // reset the default font to be sure - fntSetDefault(FNT_DEFAULT); } else { char path[255]; snprintf(path, 255, "%sconf_theme.cfg", themePath); diff --git a/thirdparty/font_Hungarian.ttf b/thirdparty/font_Hungarian.ttf index 3a2e5a9e7662f901dcfff4f10b833f16677f1e68..49d4ff05829576781046186a4b7302d8df64d9a4 100644 GIT binary patch delta 21667 zcwUWs31C!3@^{yJbLGw?Gr8|cCigix$(>9l3FIOP5RL#L1QG}VfuMK|DxkO?=tD%o zU0l3HMP)q^(N))FJy}Ir6%p}vSzV7+|K`nC-LGfnO@g~$aHik%bXWbVy1Tlny2tnb z0#ED{odgIWq4=gD#Np^|Z~bca&xE|W2W#V+?M)8x417z-^9S*BPIFghPwICV})V)=*DHY9P?X1NJu#$e=Hat8d&=83!>iU`@coh^d<0~mC!?ze2cGV^;TSSNz~ber1}<151d|`}`(bR9 zG&ZnmXwyOG(}X;XpS8!=tah$j|L!|W@(FnyB?=f}+JL5ny2i*m7KK#(Kmx?iv4;HR zy{~U{mvW(eMjNder+|q-ls~G#arq3Hr!A2ST`y^)870*p9HBM%zL;pqQhW)lmmh6b zNAiduZ3TOvU_&Y;WS(Xm;vPK?VWLymO^iYg$(mGV3&%(Sd`}YpOF37#h{RxN!uB!P zZyuHz|Em=JNe-6rymZD-s)$E|JwlG_6qf1uSq~AeAMy1SL=Y1>>G}qrC-C(xer_Nq zNi>#=@wHGmM3%w^(tzNM*zOcE?8N73^o4XB*tQnSE_Vs3#4hAG@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XJa07r* zDqUDdxqmNhSok7jNmYw(#}>a}%}>(%i|QdpN?1H3zV7x=#$ D;Lb}@ delta 1158 zcwS9YYfu|i6h3!1$!;DzOO;rPAlPE5EnrJuKvN8fRvu{sRcmbtA&?@0XaWXDNozGl zOds}EMMb9%RBCG#Q%fS&mI#4jitQf;W^l%_{^;hoAzTNYEXYbkX zp1tco%}$RHHxK}b$BP6&r>iV03@ptBFkeA6MXxQO>d|$-puW7M}7w& zW?XNqD)tNhIppH=ITgm$d0P$P768(Le23X)vdi_i)?o2lsBJg5I@2JXX#SuY^&?Y+B68jjiMc`)ncms+u`iN#VX9_TT$TpSH0{Y zfyK!004(3wY&I=!kRX?7Q1jSKE;~`cF^sL^2AWJZ%f1Wl0f2I>C!Mf2yB$te1 z@lSlHFVYQClKStZ+MYde1$RNoqH}15?69*GnB^N~vtO7zkM5_Wp(lWOes{~-$H$f6vH>TMrQld3Wk&y_O zKu*NPeIGH<4g$7QjMCr)hIfUVLU5rIB7^@aVWKV;4sjn6sf^?03Z*J0HqITNkhmym z@dFPgs~=jDvNZMKwDdyA}KUHY^Rz~30Xuvp;89abTVW?q8lkA z3R-ksop3<-4Lpd0hz?;2l4x+mz`zokJlaUTquC^z`bW=E`_*+MgZ5rMJ1xqtouf?WZ=wqzW)GCB|M}6 diff --git a/thirdparty/font_Hungarian.ttf b/thirdparty/font_Italian.ttf similarity index 100% copy from thirdparty/font_Hungarian.ttf copy to thirdparty/font_Italian.ttf -- 2.11.4.GIT