Turn off ligatures by default

Turn off all common ligatures (fi, ffi) and rare ligatures (ct, ss).
This commit is contained in:
Jjgod Jiang
2008-07-16 16:27:59 +08:00
committed by Bjorn Winckler
parent f96c9a6845
commit 8c8db3cd4c
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -851,6 +851,14 @@ enum {
&fontID, &fontSize, &fontWidth, &transform, &options, &font
};
ATSUFontFeatureType featureTypes[] = {
kLigaturesType, kLigaturesType
};
ATSUFontFeatureSelector featureSelectors[] = {
kCommonLigaturesOffSelector, kRareLigaturesOffSelector
};
for (i = 0; i < MMMaxCellsPerChar; i++)
{
fontWidth = Long2Fix(cellSize.width * (i + 1));
@@ -862,6 +870,11 @@ enum {
ATSUDisposeStyle(atsuStyles[i]);
atsuStyles[i] = NULL;
}
// Turn off ligatures by default
ATSUSetFontFeatures(atsuStyles[i],
sizeof(featureTypes) / sizeof(featureTypes[0]),
featureTypes, featureSelectors);
}
}
+1
View File
@@ -302,6 +302,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
bg, NSBackgroundColorAttributeName,
fg, NSForegroundColorAttributeName,
sp, NSUnderlineColorAttributeName,
[NSNumber numberWithInt:0], NSLigatureAttributeName,
nil];
if (flags & DRAW_UNDERL) {