Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement basic font rendering tuning for code editor. #83

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ICSharpCode.AvalonEdit/TextEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
</Setter.Value>
</Setter>
<Setter Property="SelectionForeground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
<Setter Property="TextOptions.TextFormattingMode" Value="{Binding (TextOptions.TextFormattingMode), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ScrollContentPresenter}}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type editing:TextArea}">
Expand Down
44 changes: 44 additions & 0 deletions ICSharpCode.AvalonEdit/TextEditorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,49 @@ public bool AllowToggleOverstrikeMode {
}
}
}

bool enableTextAntialiasing = true;

/// <summary>
/// Gets/Sets if anti-aliasing should be applied while text rendering.
/// </summary>
[DefaultValue(true)]
public bool EnableTextAntialiasing
{
get
{
return enableTextAntialiasing;
}
set
{
if (enableTextAntialiasing != value)
{
enableTextAntialiasing = value;
OnPropertyChanged("EnableTextAntialiasing");
}
}
}

bool enableTextHinting = true;

/// <summary>
/// Gets/Sets if TrueType hinting should be applied while text rendering.
/// </summary>
[DefaultValue(true)]
public bool EnableTextHinting
{
get
{
return enableTextHinting;
}
set
{
if (enableTextHinting != value)
{
enableTextHinting = value;
OnPropertyChanged("EnableTextHinting");
}
}
}
}
}