From: Robert Sesek Date: Sun, 15 Sep 2019 13:42:55 +0000 (-0400) Subject: In BSSourceView, override the NSFont attribute to use Menlo. X-Git-Tag: 2.0-beta-1~26 X-Git-Url: https://src.bluestatic.org/?a=commitdiff_plain;h=61cae081d07de52c91fe89dfd37ba0844b9d74f1;p=macgdbp.git In BSSourceView, override the NSFont attribute to use Menlo. --- diff --git a/Source/BSSourceView.mm b/Source/BSSourceView.mm index 337d7b6..8892801 100644 --- a/Source/BSSourceView.mm +++ b/Source/BSSourceView.mm @@ -205,6 +205,13 @@ // back to normal spaces. NSMutableString* stringData = [source mutableString]; [stringData replaceOccurrencesOfString:@"\u00A0" withString:@" " options:0 range:NSMakeRange(0, stringData.length)]; + + // Override the default font from Courier. + NSFont* menloFont = [NSFont fontWithName:@"Menlo" size:12]; + if (menloFont) { + [source addAttributes:@{ NSFontAttributeName : menloFont } + range:NSMakeRange(0, source.length)]; + } } else { NSLog(@"Failed to highlight PHP file %@: %@", filePath, [[errPipe fileHandleForReading] readDataToEndOfFile]); }