add examples
This commit is contained in:
parent
99cc193e57
commit
0c6057c2ae
|
@ -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
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||
|
Binary file not shown.
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue