Font size and highlighting styles

SyntaxEditor for WPF Forum

Posted 4 years ago by Valéry Sablonnière - Staubli
Version: 15.1.0622
Platform: .NET 4.5
Environment: Windows 7 (64-bit)
Avatar

Hi


I have two related issues when I’m trying to update all FontSize properties of highlighting styles, and apply it to a syntax editor:

  •  the line number font size of the syntax editor seems to be higher than the other font size styles (for example, when I set all font size to 12)
  •  the line height seems to be higher when you set a font size to the plain text style.

Here’s the code that I’m using (I tried directly this on your great sample):

Code behind:

private void FontFamilyComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
    var l_fontFamily = ((FontFamily)((FontFamilyComboBox)sender).SelectedValue).Source;
    foreach (var l_highlightingStyle in HighlightingStyleRegistry.HighlightingStyles)
    {
        l_highlightingStyle.FontFamilyName = l_fontFamily;
    }
}

private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
    var l_fontSize = Convert.ToDouble(((FontSizeComboBox)sender).SelectedValue);
    foreach (var l_highlightingStyle in HighlightingStyleRegistry.HighlightingStyles)
    {
        l_highlightingStyle.FontSize = l_fontSize;
    }
}

 Xaml:

<Label Content="FontFamily" Grid.Row="0"/>
<ribbon:FontFamilyComboBox Grid.Row="0" IsEditable="False" x:Name="FontFamilyComboBox" SelectionChanged="FontFamilyComboBox_OnSelectionChanged"/>
<Label Content="FontSize" Grid.Row="1"/>
<ribbon:FontSizeComboBox Grid.Row="1" IsEditable="False" SelectionChanged="Selector_OnSelectionChanged" />

Comments (1)

Answer - Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for reporting this.  We've found the problem and have it fixed for the next maintenance release.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.