mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-10-26 19:10:11 +03:00
Fix text kerning with non-antiailiasing text (fix #275)
This commit is contained in:
parent
81a0522031
commit
4174cafb07
@ -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.
|
||||
|
@ -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 を設定しても行間は制御できるが、
|
||||
// 「文書の1文字目に1バイト文字(または2バイト文字)を入力してある状態で先頭に2バイト文字(または1バイト文字)を
|
||||
// 挿入すると行間がズレる」問題が生じる)
|
||||
// ([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
|
||||
|
Loading…
Reference in New Issue
Block a user