Skip to content

Commit 0f14014

Browse files
Update refs and tests to match latest NuGet.
1 parent d7b5c69 commit 0f14014

36 files changed

Lines changed: 44 additions & 7 deletions

File tree

src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta13.5.1" />
24-
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.2" />
23+
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta15" />
24+
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" />
2525
</ItemGroup>
2626

2727
<Import Project="..\..\shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems" Label="Shared" />

tests/ImageSharp.Drawing.Tests/Drawing/Text/DrawTextOnImageTests.cs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,40 @@ public void EmojiFontRendering<TPixel>(TestImageProvider<TPixel> provider, bool
6767
$"ColorFontsEnabled-{enableColorFonts}");
6868
}
6969

70+
[Theory]
71+
[WithSolidFilledImages(400, 200, "White", PixelTypes.Rgba32)]
72+
public void FallbackFontRendering<TPixel>(TestImageProvider<TPixel> provider)
73+
where TPixel : unmanaged, IPixel<TPixel>
74+
{
75+
// https://github.com/SixLabors/Fonts/issues/171
76+
var collection = new FontCollection();
77+
FontFamily whitney = collection.Install(TestFontUtilities.GetPath("whitney-book.ttf"));
78+
FontFamily malgun = collection.Install(TestFontUtilities.GetPath("malgun.ttf"));
79+
Font font = whitney.CreateFont(25);
80+
81+
Color color = Color.Black;
82+
const string text = "亞DARKSOUL亞";
83+
84+
var textGraphicOptions = new DrawingOptions
85+
{
86+
TextOptions =
87+
{
88+
HorizontalAlignment = HorizontalAlignment.Center,
89+
VerticalAlignment = VerticalAlignment.Center,
90+
FallbackFonts = { malgun },
91+
ApplyKerning = true
92+
}
93+
};
94+
95+
provider.VerifyOperation(
96+
TextDrawingComparer,
97+
img =>
98+
{
99+
var center = new PointF(img.Width / 2, img.Height / 2);
100+
img.Mutate(i => i.DrawText(textGraphicOptions, text, font, color, center));
101+
});
102+
}
103+
70104
[Theory]
71105
[WithSolidFilledImages(276, 336, "White", PixelTypes.Rgba32)]
72106
public void DoesntThrowExceptionWhenOverlappingRightEdge_Issue688<TPixel>(TestImageProvider<TPixel> provider)
@@ -249,7 +283,7 @@ public void FontShapesAreRenderedCorrectly_LargeText<TPixel>(
249283
string str = Repeat(" ", 78) + "THISISTESTWORDSTHISISTESTWORDSTHISISTESTWORDSTHISISTESTWORDSTHISISTESTWORDS";
250284
sb.Append(str);
251285

252-
string newLines = Repeat(Environment.NewLine, 80);
286+
string newLines = Repeat(Environment.NewLine, 61);
253287
sb.Append(newLines);
254288

255289
for (int i = 0; i < 10; i++)

tests/ImageSharp.Drawing.Tests/ImageSharp.Drawing.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<None Update="TestFonts\*.ttf">
2424
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2525
</None>
26-
<None Update="TestFonts\SixLaborsSampleAB.woff">
26+
<None Update="TestFonts\*.woff">
2727
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2828
</None>
2929
<None Update="xunit.runner.json">
9.15 MB
Binary file not shown.
59.7 KB
Binary file not shown.

tests/ImageSharp.Drawing.Tests/TestUtilities/TestImageExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static Image DebugSave(
6262
{
6363
if (TestEnvironment.RunsOnCI)
6464
{
65-
return image;
65+
// return image;
6666
}
6767

6868
// We are running locally then we want to save it out
@@ -101,7 +101,7 @@ public static void DebugSave(
101101
{
102102
if (TestEnvironment.RunsOnCI)
103103
{
104-
return;
104+
// return;
105105
}
106106

107107
// We are running locally then we want to save it out
@@ -122,7 +122,7 @@ public static Image<TPixel> DebugSaveMultiFrame<TPixel>(
122122
{
123123
if (TestEnvironment.RunsOnCI)
124124
{
125-
return image;
125+
// return image;
126126
}
127127

128128
// We are running locally then we want to save it out
Loading
Loading
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)