diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs index 4b0b2bc81e..514d9ec60e 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/TextMarkerService.cs @@ -120,6 +120,13 @@ namespace ICSharpCode.AvalonEdit.AddIn if (foregroundBrush != null) { element.TextRunProperties.SetForegroundBrush(foregroundBrush); } + Typeface tf = element.TextRunProperties.Typeface; + element.TextRunProperties.SetTypeface(new Typeface( + tf.FontFamily, + marker.FontStyle ?? tf.Style, + marker.FontWeight ?? tf.Weight, + tf.Stretch + )); } ); } @@ -280,6 +287,30 @@ namespace ICSharpCode.AvalonEdit.AddIn } } + FontWeight? fontWeight; + + public FontWeight? FontWeight { + get { return fontWeight; } + set { + if (fontWeight != value) { + fontWeight = value; + Redraw(); + } + } + } + + FontStyle? fontStyle; + + public FontStyle? FontStyle { + get { return fontStyle; } + set { + if (fontStyle != value) { + fontStyle = value; + Redraw(); + } + } + } + public object Tag { get; set; } TextMarkerTypes markerTypes; diff --git a/src/Main/Base/Project/Src/Editor/ITextMarker.cs b/src/Main/Base/Project/Src/Editor/ITextMarker.cs index 84211a76d6..907ee0b110 100644 --- a/src/Main/Base/Project/Src/Editor/ITextMarker.cs +++ b/src/Main/Base/Project/Src/Editor/ITextMarker.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Windows; using System.Windows.Media; namespace ICSharpCode.SharpDevelop.Editor @@ -52,6 +53,16 @@ namespace ICSharpCode.SharpDevelop.Editor /// Color? ForegroundColor { get; set; } + /// + /// Gets/Sets the font weight. + /// + FontWeight? FontWeight { get; set; } + + /// + /// Gets/Sets the font style. + /// + FontStyle? FontStyle { get; set; } + /// /// Gets/Sets the type of the marker. Use TextMarkerType.None for normal markers. ///