Skip to content

Commit

Permalink
Switch to NotoSans font and set encoding to UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
joel16 committed Mar 20, 2020
1 parent 0272f8b commit d4f0176
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Binary file added app/data/NotoSans.pgf
Binary file not shown.
Binary file removed app/data/Roboto.pgf
Binary file not shown.
2 changes: 1 addition & 1 deletion app/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern jmp_buf exitJmp;
extern int MENU_STATE;
extern int BROWSE_STATE;

extern intraFont *font;
extern intraFont *font, *jpn_font, *chn_font, *kor_font, *sym_font;

extern char cwd[512];
extern char root_path[10];
Expand Down
2 changes: 1 addition & 1 deletion app/source/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jmp_buf exitJmp;
int MENU_STATE;
int BROWSE_STATE;

intraFont *font;
intraFont *font, *jpn_font, *chn_font, *kor_font, *sym_font;

char cwd[512];
char root_path[10];
Expand Down
21 changes: 17 additions & 4 deletions app/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#include "utils.h"

PSP_MODULE_INFO("CMFileManager", 0x800, VERSION_MAJOR, VERSION_MINOR);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
PSP_HEAP_SIZE_KB(-2048);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);

static int cpu_clock = 0, bus_clock = 0;

extern const char Roboto_pgf_start[];
extern unsigned int Roboto_pgf_size;
extern const char NotoSans_pgf_start[];
extern unsigned int NotoSans_pgf_size;

static int Callbacks_Exit() {
sceKernelExitGame();
Expand Down Expand Up @@ -77,14 +77,27 @@ static int Init_Services(void) {
return ret;
}

font = intraFontLoadMem("ram:/Roboto.pgf", Roboto_pgf_start, Roboto_pgf_size, INTRAFONT_CACHE_ALL);
font = intraFontLoadMem("ram:/NotoSans.pgf", NotoSans_pgf_start, NotoSans_pgf_size, INTRAFONT_STRING_UTF8 | INTRAFONT_CACHE_LARGE);
jpn_font = intraFontLoadMem("ram:/NotoSans.pgf", NotoSans_pgf_start, NotoSans_pgf_size, INTRAFONT_STRING_UTF8 | INTRAFONT_CACHE_LARGE);
chn_font = intraFontLoadMem("ram:/NotoSans.pgf", NotoSans_pgf_start, NotoSans_pgf_size, INTRAFONT_STRING_UTF8 | INTRAFONT_CACHE_LARGE);
kor_font = intraFontLoadMem("ram:/NotoSans.pgf", NotoSans_pgf_start, NotoSans_pgf_size, INTRAFONT_STRING_UTF8 | INTRAFONT_CACHE_LARGE);
sym_font = intraFontLoadMem("ram:/NotoSans.pgf", NotoSans_pgf_start, NotoSans_pgf_size, INTRAFONT_STRING_UTF8 | INTRAFONT_CACHE_LARGE);

intraFontSetAltFont(font, jpn_font);
intraFontSetAltFont(jpn_font, chn_font);
intraFontSetAltFont(chn_font, kor_font);
intraFontSetAltFont(kor_font, sym_font);

PSP_CTRL_ENTER = Utils_GetEnterButton();
PSP_CTRL_CANCEL = Utils_GetCancelButton();
return 0;
}

static void Term_Services(void) {
intraFontUnload(sym_font);
intraFontUnload(kor_font);
intraFontUnload(chn_font);
intraFontUnload(jpn_font);
intraFontUnload(font);
Textures_Free();
Utils_TermKernelDrivers();
Expand Down

0 comments on commit d4f0176

Please sign in to comment.