diff --git a/ChangeLog b/ChangeLog index 8cf3a4a..8a31fab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * Modules/Editors/ProjectCenter/PCEditorView.m Use constants and not strings as keys. + * Modules/Debuggers/ProjectCenter/PCDebugger.m + Use console font for the view. + 2015-03-22 Riccardo Mottola * Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m diff --git a/Modules/Debuggers/ProjectCenter/PCDebugger.m b/Modules/Debuggers/ProjectCenter/PCDebugger.m index c85bca2..5058b9d 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebugger.m +++ b/Modules/Debuggers/ProjectCenter/PCDebugger.m @@ -1,7 +1,7 @@ /* ** PCDebugger ** -** Copyright (c) 2008 +** Copyright (c) 2008-2015 ** ** Author: Gregory Casamento ** @@ -24,6 +24,8 @@ #import "PCDebugger.h" #import "PCDebuggerView.h" +#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h" + #ifndef NOTIFICATION_CENTER #define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter] #endif @@ -95,6 +97,27 @@ static NSImage *downImage = nil; } } ++ (NSFont *)defaultConsoleFont +{ + NSUserDefaults *df = [NSUserDefaults standardUserDefaults]; + NSString *fontName; + float fontSize; + NSFont *font = nil; + + fontName = [df objectForKey:ConsoleFixedFont]; + fontSize = [df floatForKey:ConsoleFixedFontSize]; + + if (fontName != nil && fontSize > 0) + { + font = [NSFont fontWithName:fontName size:fontSize]; + } + if (font == nil) + { + font = [NSFont userFixedPitchFontOfSize:0]; + } + + return font; +} - (id) init { if((self = [super init]) != nil) @@ -141,7 +164,7 @@ static NSImage *downImage = nil; [debuggerWindow setToolbar: toolbar]; RELEASE(toolbar); - [debuggerView setFont: [NSFont userFixedPitchFontOfSize: 0]]; + [debuggerView setFont: [PCDebugger defaultConsoleFont]]; [debuggerWindow setFrameAutosaveName: @"PCDebuggerWindow"]; [self setStatus: @"Idle."]; }