This commit is contained in:
Vincent Wei
2019-01-12 15:02:56 +08:00
parent 9226fcff26
commit ea8ab93bad
2 changed files with 13 additions and 3 deletions
+6 -3
View File
@@ -92,7 +92,8 @@ typedef struct cache
{
/* Information about font */
char family[LEN_FONT_NAME + 1];
char charset[LEN_FONT_NAME + 1];
// VincentWei: no need to check charset for TrueType
//char charset[LEN_FONT_NAME + 1];
DWORD render_style; // render style
int fontsize;
@@ -468,7 +469,7 @@ __mg_ttc_create(char *family, char *charset, DWORD style, int size,
int nblk, int blksize, int ndir, MakeHashKeyFunc makeHashKey)
{
CacheQueueNode *temp;
if (family == NULL || charset == NULL || makeHashKey == NULL) {
if (family == NULL || /* charset == NULL || */makeHashKey == NULL) {
return (HCACHE)(0);
}
if (nblk <= 0 || blksize <= 0 || size <= 0 || ndir <= 0) {
@@ -483,7 +484,7 @@ __mg_ttc_create(char *family, char *charset, DWORD style, int size,
}
strncpy(temp->cache.family, family, LEN_FONT_NAME);
strncpy(temp->cache.charset, charset, LEN_FONT_NAME);
//strncpy(temp->cache.charset, charset, LEN_FONT_NAME);
temp->cache.render_style = (style & FS_RENDER_MASK);
temp->cache.fontsize = size;
temp->cache.blkSize = blksize;
@@ -610,7 +611,9 @@ __mg_ttc_is_exist(char *family, char *charset, DWORD style, int size)
p = __mg_globalCache.queueDummyHead.nextCache;
while (p != &__mg_globalCache.queueDummyHead) {
if (strncmp(p->cache.family, family, LEN_FONT_NAME) == 0
#if 0 // VincentWei: do not need to check charset.
&& strncmp(p->cache.charset, charset, LEN_FONT_NAME) == 0
#endif
&& p->cache.fontsize == size
&& (style & FS_RENDER_MASK) == p->cache.render_style) {
return (HCACHE) p;
+7
View File
@@ -199,6 +199,12 @@ print_bitmap_grey (void* buffer, int width, int rows, int pitch)
static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
{
#if 0 // VincentWei: use FS_RENDER_MASK instead (3.4.0)
if (logfont->style & FS_WEIGHT_SUBPIXEL)
return DEVFONTGLYPHTYPE_SUBPIXEL;
else if (logfont->style & FS_WEIGHT_BOOK)
return DEVFONTGLYPHTYPE_GREYBMP;
#else
switch (logfont->style & FS_RENDER_MASK) {
case FS_RENDER_SUBPIXEL:
return DEVFONTGLYPHTYPE_SUBPIXEL;
@@ -207,6 +213,7 @@ static DWORD get_glyph_type (LOGFONT* logfont, DEVFONT* devfont)
default:
break;
}
#endif
return DEVFONTGLYPHTYPE_MONOBMP;
}