Browse Source

Merge pull request #2032 from AvaloniaUI/fix-default-font

Change the default font to system's default.
pull/2043/head
danwalmsley 8 years ago
committed by GitHub
parent
commit
326f74f398
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/Avalonia.Themes.Default/EmbeddableControlRoot.xaml
  2. 1
      src/Avalonia.Themes.Default/Window.xaml
  3. 2
      src/Avalonia.Visuals/Media/FontFamily.cs
  4. 1
      tests/Avalonia.RenderTests/Controls/TextBlockTests.cs
  5. 7
      tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

1
src/Avalonia.Themes.Default/EmbeddableControlRoot.xaml

@ -1,6 +1,5 @@
<Style xmlns="https://github.com/avaloniaui" Selector="EmbeddableControlRoot"> <Style xmlns="https://github.com/avaloniaui" Selector="EmbeddableControlRoot">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
<Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}"/> <Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>

1
src/Avalonia.Themes.Default/Window.xaml

@ -1,6 +1,5 @@
<Style xmlns="https://github.com/avaloniaui" Selector="Window"> <Style xmlns="https://github.com/avaloniaui" Selector="Window">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
<Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}"/> <Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>

2
src/Avalonia.Visuals/Media/FontFamily.cs

@ -48,7 +48,7 @@ namespace Avalonia.Media
/// <summary> /// <summary>
/// Represents the default font family /// Represents the default font family
/// </summary> /// </summary>
public static FontFamily Default => new FontFamily("Courier New"); public static FontFamily Default => new FontFamily(String.Empty);
/// <summary> /// <summary>
/// Gets the primary family name of the font family. /// Gets the primary family name of the font family.

1
tests/Avalonia.RenderTests/Controls/TextBlockTests.cs

@ -30,6 +30,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
Height = 200, Height = 200,
Child = new TextBlock Child = new TextBlock
{ {
FontFamily = new FontFamily("Courier New"),
Background = Brushes.Red, Background = Brushes.Red,
FontSize = 12, FontSize = 12,
Foreground = Brushes.Black, Foreground = Brushes.Black,

7
tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

@ -29,7 +29,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
private Control Visual private Control Visual
{ {
get get
{ {
return new Panel return new Panel
{ {
@ -83,7 +83,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
await RenderToFile(target); await RenderToFile(target);
CompareImages(); CompareImages();
} }
#if AVALONIA_SKIA_SKIP_FAIL #if AVALONIA_SKIA_SKIP_FAIL
[Fact(Skip = "FIXME")] [Fact(Skip = "FIXME")]
#else #else
@ -270,7 +270,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
await RenderToFile(target); await RenderToFile(target);
CompareImages(); CompareImages();
} }
[Fact] [Fact]
public async Task VisualBrush_NoStretch_NoTile_BottomRightQuarterSource_BottomRightQuarterDest() public async Task VisualBrush_NoStretch_NoTile_BottomRightQuarterSource_BottomRightQuarterDest()
{ {
@ -429,6 +429,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
Child = new TextBlock Child = new TextBlock
{ {
FontFamily = new FontFamily("Courier New"),
Text = "Visual" Text = "Visual"
} }
}), }),

Loading…
Cancel
Save