Skip to content

Commit

Permalink
feat: Switch to OpenSans
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Jun 4, 2024
1 parent 3b918ce commit 0b10dcb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
10 changes: 10 additions & 0 deletions build/nuget/Uno.WinUI.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,31 @@
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net9.0-ios17.2 -->
<group targetFramework="net9.0-ios17.2">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net9.0-maccatalyst17.2 -->
<group targetFramework="net9.0-maccatalyst17.2">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net9.0-macos14.2 -->
<group targetFramework="net9.0-macos14.2">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net8.0-android30.0 -->
Expand All @@ -67,34 +71,39 @@
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net8.0-ios17.0 -->
<group targetFramework="net8.0-ios17.0">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net8.0-maccatalyst17.0 -->
<group targetFramework="net8.0-maccatalyst17.0">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- net8.0-macos14.0 -->
<group targetFramework="net8.0-macos14.0">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- .NET 9 (Reference API) -->
<group targetFramework="net9.0">
<dependency id="Uno.Foundation.Logging" version="0.0.0" />
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>

<!-- .NET 8 (Reference API) -->
Expand All @@ -106,6 +115,7 @@
<dependency id="Uno.Diagnostics.Eventing" version="2.0.1" />
<dependency id="System.Collections.Immutable" version="1.3.1" />
<dependency id="Uno.Fonts.Fluent" version="2.3.1" />
<dependency id="Uno.Fonts.OpenSans" version="2.4.0-dev.6" />
</group>
</dependencies>

Expand Down
1 change: 1 addition & 0 deletions src/Uno.UI/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Import Project="..\Directory.Build.targets"/>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Uno.Fonts.OpenSans" Version="2.4.0-dev.4" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\BannedSymbols.txt" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/FeatureConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static string SymbolsFont
/// The default font family for text when a font isn't explicitly specified (e.g. for a TextBlock)
/// This is often needs to be set by users on Linux, where Microsoft's Segoe UI isn't present
/// </summary>
public static string DefaultTextFontFamily { get; set; } = "Segoe UI";
public static string DefaultTextFontFamily { get; set; } = "ms-appx:///Uno.Fonts.OpenSans/Fonts/OpenSans-Regular-VariableFont_wdth,wght.ttf";

/// <summary>
/// Ignores text scale factor, resulting in a font size as dictated by the control.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static FontDetails GetFontInternal(

SKTypeface GetDefaultTypeFace()
{
// if Segoe UI is not found, it will automatically return a system default
// if the specified default font is not found, it will automatically return a system default
return SKTypeface.FromFamilyName(FeatureConfiguration.Font.DefaultTextFontFamily, skWeight, skWidth, skSlant);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/FontFamily.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public FontFamily(string familyName)
// Makes introduction of FontFamily a non-breaking change (for now)
public static implicit operator FontFamily(string familyName) => new FontFamily(familyName);

public static FontFamily Default { get; } = new FontFamily("Segoe UI");
public static FontFamily Default { get; } = new FontFamily("ms-appx:///Uno.Fonts.OpenSans/Fonts/OpenSans-Regular-VariableFont_wdth,wght.ttf");

public static FontFamily XamlAutoFontFamily => Default;

Expand Down

0 comments on commit 0b10dcb

Please sign in to comment.