diff options
author | Mike Krüger <mikkrg@microsoft.com> | 2019-07-02 16:34:36 +0300 |
---|---|---|
committer | Vsevolod Kukol <sevoku@microsoft.com> | 2019-10-16 08:51:55 +0300 |
commit | af6c3d148951cc27a214b38a52da893a9d8219d2 (patch) | |
tree | 0353f6ddb942c0d8df9bbead032ae84856fe909c /main/src/addins/MonoDevelop.Refactoring | |
parent | 42a6089bb98bab3ffab75b808c95b91edfdbd6f9 (diff) |
Fixes VSTS Bug 937839: [Feedback] Text Editor: font weight ignored
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/937839
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs index 97248f635b..cdeb62ef83 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringPreviewTooltipWindow.cs @@ -64,8 +64,11 @@ namespace MonoDevelop.Refactoring this.codeAction = codeAction; TransientFor = IdeApp.Workbench.RootWindow; - fontDescription = Pango.FontDescription.FromString (DefaultSourceEditorOptions.Instance.FontName); - fontDescription.Size = (int)(fontDescription.Size * 0.8f); + if (IdeServices.FontService.TryParsePangoFont (DefaultSourceEditorOptions.Instance.FontName, out fontDescription)) { + fontDescription.Size = (int)(fontDescription.Size * 0.8f); + } else { + LoggingService.LogError ("Error loading font : " + DefaultSourceEditorOptions.Instance.FontName); + } using (var metrics = PangoContext.GetMetrics (fontDescription, PangoContext.Language)) { lineHeight = (int)Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale); |