In BSSourceView, override the NSFont attribute to use Menlo.
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Sep 2019 13:42:55 +0000 (09:42 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 15 Sep 2019 16:04:32 +0000 (12:04 -0400)
Source/BSSourceView.mm

index 337d7b6fb4ef9e38551bbdf209bf3371693032b0..88928016bd5e1db14d4246d2c27e9ef7045534c1 100644 (file)
         // 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]);
       }