|
楼主 |
发表于 2005-9-17 18:36:06
|
显示全部楼层
目前粗体早就搞定
斜体有问题
if (val->key.flags & PRIVATE_FLAG_OBLIQUE &&
(face->style_flags & FT_STYLE_FLAG_ITALIC) == 0) {
FT_GlyphSlot_Oblique (glyphslot);
}
...
FcBool embolden=FcFalse;
int w=-1;
/*if (FcPatternGetBool (pattern,
FC_EMBOLDEN, 0, &embolden) != FcResultMatch)
embolden = FcFalse;*/
if (FcPatternGetInteger (pattern,FC_WEIGHT, 0, &w) != FcResultMatch) embolden = FcFalse;
if(w==FC_WEIGHT_BOLD) embolden=FcTrue;
if (embolden)
load_flags |= PRIVATE_FLAG_EMBOLDEN;
}
看上去ok吧
但是在freetype中
FT_EXPORT_DEF( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot )
{
FT_Matrix transform;
FT_Outline* outline = &slot->outline;
/* only oblique outline glyphs */
if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
return;
/* we don't touch the advance width */
/* For italic, simply apply a shear transform, with an angle */
/* of about 12 degrees. */
transform.xx = 0x10000L;
transform.yx = 0x00000L;
transform.xy = 0x06000L;
transform.yy = 0x10000L;
FT_Outline_Transform( outline, &transform );
}
所以必须对FT_GLYPH_FORMAT_BITMAP进行斜体算法
我目前没有什么办法,也许请教以下firefly。他patch过freetype |
|