-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathIssues_484.cs
More file actions
51 lines (40 loc) · 1.49 KB
/
Issues_484.cs
File metadata and controls
51 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
namespace SixLabors.Fonts.Tests.Issues;
public class Issues_484
{
[Fact]
public void Test_Issue_484()
=> Parallel.For(0, 10, static _ => Test_Issue_484_Core());
private static void Test_Issue_484_Core()
{
FontCollection fontCollection = new();
string arial = fontCollection.Add(TestFonts.Arial).Name;
FontFamily arialFamily = fontCollection.Get(arial);
Font arialFont = arialFamily.CreateFont(12, FontStyle.Regular);
TextOptions textOptions = new(arialFont)
{
HintingMode = HintingMode.Standard
};
FontRectangle advance = TextMeasurer.MeasureAdvance("Hello, World!", textOptions);
Assert.NotEqual(FontRectangle.Empty, advance);
}
[Fact]
public void Test_Issue_484_B()
{
FontCollection fontCollection = new();
string arial = fontCollection.Add(TestFonts.Arial).Name;
FontFamily arialFamily = fontCollection.Get(arial);
Font arialFont = arialFamily.CreateFont(12, FontStyle.Regular);
Parallel.For(0, 10, _ => Test_Issue_484_Core_B(arialFont));
}
private static void Test_Issue_484_Core_B(Font font)
{
TextOptions textOptions = new(font)
{
HintingMode = HintingMode.Standard
};
FontRectangle advance = TextMeasurer.MeasureAdvance("Hello, World!", textOptions);
Assert.NotEqual(FontRectangle.Empty, advance);
}
}