From 61cae081d07de52c91fe89dfd37ba0844b9d74f1 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 Sep 2019 09:42:55 -0400 Subject: [PATCH] In BSSourceView, override the NSFont attribute to use Menlo. --- Source/BSSourceView.mm | 7 +++++++ 1 file changed, 7 insertions(+) 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]); } -- 2.43.5