Fix text kerning with non-antiailiasing text (fix #275)

This commit is contained in:
1024jp 2014-11-17 04:23:18 +01:00
parent 81a0522031
commit 4174cafb07
2 changed files with 13 additions and 5 deletions

View File

@ -16,6 +16,7 @@ changelog
- Fix an issue that new documents couldn't be saved with an extension that is automatically added from syntax definition.
- Fix an issue that syntax style validator didn't warn about keywords duplication that are newly added.
- Fix an issue that syntax style mapping conflict tables were always blank.
- Fix an issue that text karning was too narrow with non-antiailiasing text (thanks to tsawada2-san).
- Fix an issue that text view scrolls to the opposite side when line number view is dragged.
- Fix an issue that current line highlight didn't update after font size change.
- Fix an issue that navigation/status bars are shown for a moment on window creation even they are set as hidden.

View File

@ -110,6 +110,7 @@ static BOOL usesTextFontForInvisibles;
_showsFullwidthSpace = [defaults boolForKey:CEDefaultShowInvisibleFullwidthSpaceKey];
_showsOtherInvisibles = [defaults boolForKey:CEDefaultShowOtherInvisibleCharsKey];
[self setUsesScreenFonts:YES];
[self setShowsControlCharacters:_showsOtherInvisibles];
[self setTypesetter:[CEATSTypesetter sharedSystemTypesetter]];
}
@ -127,8 +128,7 @@ static BOOL usesTextFontForInvisibles;
//
// CETextView NSParagraphStyle lineSpacing
// 11221
//
// [NSGraphicsContext currentContextDrawingToScreen]
//
fragmentRect.size.height = [self lineHeight];
usedRect.size.height = [self lineHeight];
}
@ -157,7 +157,6 @@ static BOOL usesTextFontForInvisibles;
{
if (![self isPrinting] && [self fixesLineHeight]) {
// Y
// [NSGraphicsContext currentContextDrawingToScreen]
if ([[self firstTextView] layoutOrientation] != NSTextLayoutOrientationVertical) {
//
@ -177,8 +176,6 @@ static BOOL usesTextFontForInvisibles;
- (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin
// ------------------------------------------------------
{
// [NSGraphicsContext currentContextDrawingToScreen]
//
if (![self isPrinting]) {
[[NSGraphicsContext currentContext] setShouldAntialias:[self usesAntialias]];
@ -305,6 +302,16 @@ static BOOL usesTextFontForInvisibles;
//
//=======================================================
// ------------------------------------------------------
/// [NSGraphicsContext currentContextDrawingToScreen]
- (void)setPrinting:(BOOL)printing
// ------------------------------------------------------
{
[self setUsesScreenFonts:!printing];
_printing = printing;
}
// ------------------------------------------------------
///
- (void)setShowsInvisibles:(BOOL)showsInvisibles