diff --git a/fonts/chs/font.ini b/fonts/chs/font.ini new file mode 100644 index 0000000..f8a5e8e --- /dev/null +++ b/fonts/chs/font.ini @@ -0,0 +1,55 @@ +[font0] +maxHeight= 10 +maxWidth= 10 +lineSpacing=0 +wordSpacing=4 +letterSpacing=1 +heightOffset=0 +fileName=font.ttf +warpMode=0 +encoding=GBK + +[font1] +maxHeight= 12 +maxWidth= 12 +lineSpacing=1 +wordSpacing=4 +letterSpacing=1 +heightOffset=1 +fileName=zpix.ttf +warpMode=1 +encoding=GBK + +[font2] +maxHeight= 15 +maxWidth= 15 +lineSpacing=1 +wordSpacing=3 +letterSpacing=1 +heightOffset=0 +fileName=font.ttf +warpMode=0 +encoding=GBK + +[font3] +maxHeight= 15 +maxWidth= 15 +lineSpacing=1 +wordSpacing=4 +letterSpacing=1 +heightOffset=0 +fileName=font.ttf +warpMode=0 +encoding=GBK + +[font4] +maxHeight= 22 +maxWidth= 22 +lineSpacing=1 +wordSpacing=12 +letterSpacing=1 +heightOffset=0 +fileName=font.ttf +warpMode=0 +encoding=GBK + diff --git a/fonts/chs/font.ttf b/fonts/chs/font.ttf new file mode 100644 index 0000000..37c28de Binary files /dev/null and b/fonts/chs/font.ttf differ diff --git a/fonts/chs/zpix.ttf b/fonts/chs/zpix.ttf new file mode 100644 index 0000000..64a2e62 Binary files /dev/null and b/fonts/chs/zpix.ttf differ diff --git a/fonts/english/JH_FALLOUT.TTF b/fonts/english/JH_FALLOUT.TTF new file mode 100644 index 0000000..74dedb5 Binary files /dev/null and b/fonts/english/JH_FALLOUT.TTF differ diff --git a/fonts/english/TT0807M_.TTF b/fonts/english/TT0807M_.TTF new file mode 100644 index 0000000..6844476 Binary files /dev/null and b/fonts/english/TT0807M_.TTF differ diff --git a/fonts/english/font.ini b/fonts/english/font.ini new file mode 100644 index 0000000..24d8a3c --- /dev/null +++ b/fonts/english/font.ini @@ -0,0 +1,55 @@ +[font0] +maxHeight=10 +maxWidth=10 +lineSpacing=0 +wordSpacing=4 +letterSpacing=1 +heightOffset=0 +fileName=r_fallouty.ttf +warpMode=0 +encoding=GBK + +[font1] +maxHeight=12 +maxWidth=12 +lineSpacing=0 +wordSpacing=4 +letterSpacing=1 +heightOffset=0 +fileName=r_fallouty.ttf +warpMode=0 +encoding=GBK + +[font2] +maxHeight=15 +maxWidth=15 +lineSpacing=1 +wordSpacing=3 +letterSpacing=1 +heightOffset=0 +fileName=r_fallouty.ttf +warpMode=0 +encoding=GBK + +[font3] +maxHeight=15 +maxWidth=15 +lineSpacing=1 +wordSpacing=4 +letterSpacing=1 +heightOffset=0 +fileName=r_fallouty.ttf +warpMode=0 +encoding=GBK + +[font4] +maxHeight=24 +maxWidth=24 +lineSpacing=1 +wordSpacing=12 +letterSpacing=1 +heightOffset=0 +fileName=TT0807M_.TTF +warpMode=0 +encoding=GBK + diff --git a/fonts/english/r_fallouty.ttf b/fonts/english/r_fallouty.ttf new file mode 100644 index 0000000..8d3342e Binary files /dev/null and b/fonts/english/r_fallouty.ttf differ diff --git a/src/freetype_manager.cc b/src/freetype_manager.cc index e53f242..995ab99 100644 --- a/src/freetype_manager.cc +++ b/src/freetype_manager.cc @@ -40,6 +40,7 @@ typedef struct FtFontDescriptor { unsigned char* filebuffer; int maxHeight; + int maxWidth; int letterSpacing; int wordSpacing; int lineSpacing; @@ -244,6 +245,9 @@ static int FtFontLoad(int font_index) if (!configGetInt(&config, string, "maxHeight", &desc->maxHeight)) { return -1; } + if (!configGetInt(&config, string, "maxWidth", &desc->maxWidth)) { + desc->maxWidth = desc->maxHeight; + } if (!configGetInt(&config, string, "lineSpacing", &desc->lineSpacing)) { return -1; } @@ -301,7 +305,7 @@ static int FtFontLoad(int font_index) FT_New_Memory_Face(desc->library, desc->filebuffer, fileSize, 0, &desc->face); FT_Select_Charmap(desc->face, FT_ENCODING_UNICODE); - FT_Set_Pixel_Sizes(desc->face, desc->maxHeight, desc->maxHeight); + FT_Set_Pixel_Sizes(desc->face, desc->maxWidth, desc->maxHeight); fileClose(stream); configFree(&config);