Bug 8191 - Make monospace font configurable
Summary: Make monospace font configurable
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2012-11-03 00:39 UTC by Martin Baulig
Modified: 2012-11-14 12:33 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Martin Baulig 2012-11-03 00:39:39 UTC
The default monospace font is currently hardcoded as "Monaco 12" in MacPlatform.cs.

Let's please make this configurable somehow.

Btw. is there any reason why the debugger's immediate pad scales this down to 80% ?
This makes the effective font size 10 points, which is almost unreadable.
Comment 1 Mikayla Hutchinson [MSFT] 2012-11-05 15:42:15 UTC
It is configurable via two settings:
- custom editor font
- custom output pad font

No idea why it's scaled down, that seems like a bug.
Comment 2 Martin Baulig 2012-11-06 02:57:15 UTC
It is not configurable for the debugger's immediate pad on the Mac.

Look at main/src/addins/MacPlatform/MacPlatform.cs, its implementation of the 'DefaultMonospaceFont' property returns a string constant.

Then DesktopService.DefaultMonoSpaceFont simply returns PlatformService.DefaultMonoSpaceFont.

And main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ImmediatePad.cs simply uses that to set the font, scaling it down by 80%:

                        view = new ConsoleView ();
                        view.ConsoleInput += OnViewConsoleInput;
                        Pango.FontDescription font = Pango.FontDescription.FromString (DesktopService.DefaultMonospaceFont);
                        font.Size = (font.Size * 8) / 10;
                        view.SetFont (font);
                        view.ShadowType = Gtk.ShadowType.None;
                        view.ShowAll ();

The font in the output pad is in fact configurable.
Comment 3 Mikayla Hutchinson [MSFT] 2012-11-06 11:27:36 UTC
Yeah, my point is that the immediate pad should either have its own font setting, or use the output pad font. That's why I assigned the bug to the debugger. We shouldn't change DefaultMonoSpaceFont.
Comment 4 Jeffrey Stedfast 2012-11-06 11:41:31 UTC
Doesn't do that in ui-refresh branch

backported to git master.
Comment 5 Mikayla Hutchinson [MSFT] 2012-11-06 12:03:17 UTC
The scaling is removed, sure, but it still doesn't respect the output pad font. 

See HandleCustomFontChanged in main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
Comment 6 Jeffrey Stedfast 2012-11-06 12:41:34 UTC
Comment 7 Martin Baulig 2012-11-14 11:28:53 UTC
Where did you fix this, I don't see it ?

Looking at monodevelop/master commit fec78d7, there is

                public void Initialize (IPadWindow container)
                        view = new ConsoleView ();
                        view.ConsoleInput += OnViewConsoleInput;
                        Pango.FontDescription font = Pango.FontDescription.FromString (DesktopService.DefaultMonospaceFont);
                        view.SetFont (font);
                        view.ShadowType = Gtk.ShadowType.None;
                        view.ShowAll ();

and DefaultMonospaceFont is hardcoded in MacPlatform.cs.
Comment 8 Jeffrey Stedfast 2012-11-14 11:40:05 UTC
in ui-refresh, it uses the OutputPad font (which is configurable)

I didn't backport that part of the patch because it didn't cherry-pick cleanly due to other changes.
Comment 9 Martin Baulig 2012-11-14 12:20:50 UTC
Let's please also get something into monodevelop/master.

How about this patch, can this one go in:

I simply looked at how it's done in the OutputPad, then did the same for the Immediate Pad.
Comment 10 Jeffrey Stedfast 2012-11-14 12:33:47 UTC
backported my ui-refresh patch instead