From bebac03a9744c74f367d0ed23892b282ce531ded Mon Sep 17 00:00:00 2001 From: vspader Date: Wed, 23 May 2007 12:00:44 +0000 Subject: [PATCH] Fix for bold font problems. --- Playlist/PlaylistView.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index bc939e031..7bac221b8 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -26,16 +26,20 @@ NSControlSize s = NSSmallControlSize; NSEnumerator *oe = [[self allTableColumns] objectEnumerator]; NSFont *f = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:s]]; - NSFont *bf = [NSFont boldSystemFontOfSize:[NSFont systemFontSizeForControlSize:s]]; - - [self setRowHeight:[bf defaultLineHeightForFont]]; + NSFont *bf = [[NSFontManager sharedFontManager] convertFont:f toHaveTrait:NSBoldFontMask]; + + NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init]; + [self setRowHeight:[layoutManager defaultLineHeightForFont:bf]]; + [layoutManager release]; //Resize the fonts id c; while (c = [oe nextObject]) { [[c dataCell] setControlSize:s]; - [[c dataCell] setFont:f]; + + //Using the bold font defined from the default system font with the bold trait added seems to fix problems related to bold display with some fonts. + [[c dataCell] setFont:bf]; } NSTableHeaderView *currentTableHeaderView = [self headerView];