-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix more things with fonts (embedded) and unpackaged apps (#26515)
* Fix embedded fonts in unpackaged apps * Add UI tests * ws * ws * reviewability * comments * Update src/Core/src/Fonts/EmbeddedFontLoader.Windows.cs Co-authored-by: Copilot <[email protected]> * Update src/Core/src/Fonts/EmbeddedFontLoader.Windows.cs Co-authored-by: Copilot <[email protected]> * fix * ws * wow * Update path from AppDataDirectory to LocalCacheFolder * Fix embedded fonts in unpackaged apps * Add UI tests * ws * ws * reviewability * comments * Update src/Core/src/Fonts/EmbeddedFontLoader.Windows.cs Co-authored-by: Copilot <[email protected]> * Update src/Core/src/Fonts/EmbeddedFontLoader.Windows.cs Co-authored-by: Copilot <[email protected]> * fix * ws * wow * new category * Add binlogs and snapshots * android and ios images * echo contents * revert * log the loggable logging loggers loggity log * oops * fix paths * Fix unpackaged tests * mac images * try and get a fail * Everything MUST fail * logging * logging * what does CI see now? * try something * A bunch of work to re-enable tests and fix things * more info * tests * - add mac screen shot --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Shane Neuville <[email protected]>
- Loading branch information
1 parent
8b9f89e
commit a0ea0bc
Showing
35 changed files
with
360 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+60.9 KB
src/Controls/tests/TestCases.Android.Tests/snapshots/android/FromBundle_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51.9 KB
src/Controls/tests/TestCases.Android.Tests/snapshots/android/FromBundle_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+62 KB
...Controls/tests/TestCases.Android.Tests/snapshots/android/FromEmbedded_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.5 KB
...Controls/tests/TestCases.Android.Tests/snapshots/android/FromEmbedded_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions
41
src/Controls/tests/TestCases.HostApp/Concepts/FontsGalleryPage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace Maui.Controls.Sample; | ||
|
||
internal class FontsGalleryPage : CoreGalleryBasePage | ||
{ | ||
protected override void Build() | ||
{ | ||
AddImage(Test.Fonts.FromEmbedded_Image, "q", "Dokdo"); | ||
AddLabel(Test.Fonts.FromEmbedded_Label, "q", "Dokdo"); | ||
|
||
AddImage(Test.Fonts.FromBundle_Image, "\xf133", "FA"); | ||
AddLabel(Test.Fonts.FromBundle_Label, "\xf133", "FA"); | ||
} | ||
|
||
ViewContainer<View> AddImage(Test.Fonts test, string text, string fontFamily) => | ||
Add(test, new Image | ||
{ | ||
Source = new FontImageSource | ||
{ | ||
Glyph = text, | ||
FontFamily = fontFamily, | ||
Size = 40, | ||
Color = Colors.Red | ||
}, | ||
WidthRequest = 50, | ||
HeightRequest = 50, | ||
}); | ||
|
||
ViewContainer<View> AddLabel(Test.Fonts test, string text, string fontFamily) => | ||
Add(test, new Label | ||
{ | ||
Text = text, | ||
FontFamily = fontFamily, | ||
FontSize = 40, | ||
TextColor = Colors.Red, | ||
WidthRequest = 50, | ||
HeightRequest = 50, | ||
}); | ||
|
||
ViewContainer<View> Add(Test.Fonts test, View view) => | ||
Add(new ViewContainer<View>(test, view)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+2.05 MB
src/Controls/tests/TestCases.HostApp/Resources/Fonts/Dokdo-Regular.ttf
Binary file not shown.
Binary file added
BIN
+58.1 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/FromBundle_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.3 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/FromBundle_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.6 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/FromEmbedded_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.1 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/FromEmbedded_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.1 KB
...tests/TestCases.Mac.Tests/snapshots/mac/LabelUITests_FontFamily_FontAwesome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions
45
src/Controls/tests/TestCases.Shared.Tests/Tests/Concepts/FontsGalleryTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests | ||
{ | ||
[Category(UITestCategories.Fonts)] | ||
public class FontsGalleryTests : CoreGalleryBasePageTest | ||
{ | ||
public FontsGalleryTests(TestDevice device) | ||
: base(device) | ||
{ | ||
} | ||
|
||
protected override void NavigateToGallery() | ||
{ | ||
App.NavigateToGallery("Fonts Gallery"); | ||
} | ||
|
||
[Test] | ||
public void FromEmbedded_Image() => LoadAndVerify(Test.Fonts.FromEmbedded_Image); | ||
|
||
[Test] | ||
public void FromEmbedded_Label() => LoadAndVerify(Test.Fonts.FromEmbedded_Label); | ||
|
||
[Test] | ||
public void FromBundle_Image() => LoadAndVerify(Test.Fonts.FromBundle_Image); | ||
|
||
#if WINDOWS | ||
[Ignore("Windows App SDK 1.6 broke this test. See more details in https://github.com/dotnet/maui/issues/26749")] | ||
#endif | ||
[Test] | ||
public void FromBundle_Label() => LoadAndVerify(Test.Fonts.FromBundle_Label); | ||
|
||
void LoadAndVerify(Test.Fonts test) | ||
{ | ||
var remote = new EventViewContainerRemote(UITestContext, test); | ||
remote.GoTo(test.ToString()); | ||
|
||
App.WaitForElement($"{test}VisualElement"); | ||
|
||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+13.8 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/FromBundle_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/FromEmbedded_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.7 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/FromEmbedded_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/FromBundle_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51.4 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/FromBundle_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53.3 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/FromEmbedded_Image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.6 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/FromEmbedded_Label.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.