Skip to content

Commit ed72190

Browse files
charlesroddieHappypig375FoggyFinder
authored
Cleanup in preparation for Font Styles (#156)
* font styles init * remove unused deconstruct and commented code * Simplify by removing IFontChanger * remove unused interface * clean Typefaces of unused methods * Document Typefaces * tidy * WIP: Fixing IndexRanges in progress * Use Rune as TGlyph * Tests show unexpected changes in positioning * Include italic m as double in width measurement * Fixed tests * Don't test UnicodeFontChanger only * Fix typo * Remove duplicate comment * Be even more lenient wrt CI load * Wait longer in caret reset test * Increase alert threshold again * Update ReportGenerator * Add the word "Ignore" * use ToStringInvariant() * Remove outdated comment * copy in happypig's explanation verbatim * copy in happypig's comment * Clarify the comment * Fix the test * . * Quick update * Update CaretTests.cs Co-authored-by: Hadrian Tang <hadrianwttang@outlook.com> Co-authored-by: FoggyFinder <FoggyFinder@yandex.ua>
1 parent 789b861 commit ed72190

35 files changed

+447
-281
lines changed

.github/workflows/Benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
output-file-path: .benchmarkresults/results/CSharpMath.Rendering.Benchmarks.Program-report-full-compressed.json
2222
github-token: ${{ github.token }}
2323
auto-push: ${{ github.ref == 'refs/heads/master' }} # Push and deploy GitHub pages branch automatically
24-
alert-threshold: 140% # Should not be lower than 140% to take account of fluctuations of CI load, see https://github.com/verybadcat/CSharpMath/commit/51a3c066372ab486edb44a424c6ba61ea35914c5
24+
alert-threshold: 155% # Should not be lower than 155% to take account of fluctuations of CI load, see https://github.com/verybadcat/CSharpMath/pull/156#commitcomment-42067078
2525
comment-on-alert: true # Show alert with commit comment on detecting possible performance regression
2626
fail-on-alert: true
2727
alert-comment-cc-users: '@Happypig375'

.github/workflows/Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
# Coverlet settings come after --: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md#advanced-options-supported-via-runsettings
4545
dotnet test CSharpMath.CrossPlatform.slnf -c Release -l GitHubActions --blame --collect:"XPlat Code Coverage" -r .testcoverage -p:PackageReleaseNotes="$RELEASE_NOTES" -p:PackageVersion=${{ steps.release_drafter.outputs.tag_name || format('{0}-pr', github.event.number) }}-ci-${{ github.sha }} -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeTestAssembly=true
4646
- name: Run ReportGenerator on Test Coverage results
47-
uses: danielpalme/ReportGenerator-GitHub-Action@4.6.4
47+
uses: danielpalme/ReportGenerator-GitHub-Action@4.6.7
4848
with:
4949
reports: '.testcoverage/**/*.*' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
5050
targetdir: '.testcoverage/report' # REQUIRED # The directory where the generated report should be saved.

CSharpMath.Apple/BackEnd/AppleTypesetters.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public static class AppleTypesetters {
88
(font, size) => new AppleMathFont(font, size),
99
AppleGlyphBoundsProvider.Instance,
1010
CtFontGlyphFinder.Instance,
11-
Display.UnicodeFontChanger.Instance,
1211
new JsonMathTable<AppleMathFont, TGlyph>(
1312
AppleFontMeasurer.Instance,
1413
Resources.ManifestResources.LatinMath,
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
namespace CSharpMath.CoreTests {
2+
using Xunit;
3+
using Atom;
4+
public class FontChangingTests {
5+
// Tests are ordered by numeric value of the Atom.FontStyle enumeration
6+
void Test(string input, string output, string command) {
7+
var displays = TypesetterTests.ParseLaTeXToDisplay(@"\" + command + "{" + input + "}").Displays;
8+
if (input is "")
9+
Assert.Empty(displays);
10+
else {
11+
var display =
12+
Assert.IsType<Display.Displays.TextLineDisplay<FrontEnd.TestFont, System.Text.Rune>>(Assert.Single(displays));
13+
var run = Assert.Single(display.Runs).Run;
14+
Assert.Equal(output, run.Text.ToString());
15+
Assert.Equal(output, string.Concat(run.Glyphs));
16+
Assert.Equal(output, string.Concat(display.Text));
17+
Assert.All(display.Atoms, atom => Assert.Equal(LaTeXSettings.FontStyles.FirstToSecond[command], atom.FontStyle));
18+
}
19+
Assert.Equal(output, Display.UnicodeFontChanger.ChangeFont(input, LaTeXSettings.FontStyles.FirstToSecond[command]));
20+
}
21+
// Variables become italic but Captial Greek stay upright
22+
[Theory]
23+
[InlineData("", "")]
24+
[InlineData("1", "1")]
25+
[InlineData("a", "𝑎")]
26+
[InlineData("!", "!")]
27+
[InlineData("1234567890", "1234567890")]
28+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝑎𝑏𝑐𝑑𝑒𝑓𝑔ℎ𝑖𝑗𝑘𝑙𝑚𝑛𝑜𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑥𝑦𝑧")]
29+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍")]
30+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")]
31+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")]
32+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
33+
[InlineData("!2|a@A<β$Δ`ϖ|", "!2|𝑎@𝐴<𝛽$Δ`𝜛|")]
34+
public void Default(string input, string output) => Test(input, output, "mathnormal");
35+
// The default appearance for characters is Roman
36+
[Theory]
37+
[InlineData("", "")]
38+
[InlineData("1", "1")]
39+
[InlineData("a", "a")]
40+
[InlineData("!", "!")]
41+
[InlineData("1234567890", "1234567890")]
42+
[InlineData("abcdefghijklmnopqrstuvxyz", "abcdefghijklmnopqrstuvxyz")]
43+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "ABCDEFGHIJKLMNOPQRSTUVWXYZ")]
44+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ")]
45+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")]
46+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
47+
[InlineData("!2|a@A<β$Δ`ϖ|", "!2|a@A<β$Δ`ϖ|")]
48+
public void Roman(string input, string output) => Test(input, output, "mathrm");
49+
[Theory]
50+
[InlineData("", "")]
51+
[InlineData("1", "𝟏")]
52+
[InlineData("a", "𝐚")]
53+
[InlineData("!", "!")]
54+
[InlineData("1234567890", "𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗𝟎")]
55+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐱𝐲𝐳")]
56+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙")]
57+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛂𝛃𝛄𝛅𝛆𝛇𝛈𝛉𝛊𝛋𝛌𝛍𝛎𝛏𝛐𝛑𝛒𝛓𝛔𝛕𝛖𝛗𝛘𝛙𝛚∂𝛜𝛝𝛞𝛟𝛠𝛡")]
58+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "𝚨𝚩𝚪𝚫𝚬𝚭𝚮𝚯𝚰𝚱𝚲𝚳𝚴𝚵𝚶𝚷𝚸𝚺𝚻𝚼𝚽𝚾𝚿𝛀")]
59+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
60+
[InlineData("!2|a@A<β$Δ`ϖ|", "!𝟐|𝐚@𝐀<𝛃$𝚫`𝛡|")]
61+
public void Bold(string input, string output) => Test(input, output, "mathbf");
62+
[Theory]
63+
[InlineData("", "")]
64+
[InlineData("1", "1")]
65+
[InlineData("a", "𝑎")]
66+
[InlineData("!", "!")]
67+
[InlineData("1234567890", "1234567890")]
68+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝑎𝑏𝑐𝑑ℯ𝑓ℊℎ𝑖𝑗𝑘𝑙𝑚𝑛ℴ𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑥𝑦𝑧")]
69+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵")]
70+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")] // Default font
71+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")] // Default font
72+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
73+
[InlineData("!2|a@A<β$Δ`ϖ|", "!2|𝑎@𝒜<𝛽$Δ`𝜛|")]
74+
public void Caligraphic(string input, string output) => Test(input, output, "mathcal");
75+
[Theory]
76+
[InlineData("", "")]
77+
[InlineData("1", "𝟷")]
78+
[InlineData("a", "𝚊")]
79+
[InlineData("!", "!")]
80+
[InlineData("1234567890", "𝟷𝟸𝟹𝟺𝟻𝟼𝟽𝟾𝟿𝟶")]
81+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝚊𝚋𝚌𝚍𝚎𝚏𝚐𝚑𝚒𝚓𝚔𝚕𝚖𝚗𝚘𝚙𝚚𝚛𝚜𝚝𝚞𝚟𝚡𝚢𝚣")]
82+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝙰𝙱𝙲𝙳𝙴𝙵𝙶𝙷𝙸𝙹𝙺𝙻𝙼𝙽𝙾𝙿𝚀𝚁𝚂𝚃𝚄𝚅𝚆𝚇𝚈𝚉")]
83+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")] // Default font
84+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")] // Default font
85+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
86+
[InlineData("!2|a@A<β$Δ`ϖ|", "!𝟸|𝚊@𝙰<𝛽$Δ`𝜛|")]
87+
public void Typewriter(string input, string output) => Test(input, output, "mathtt");
88+
[Theory]
89+
[InlineData("", "")]
90+
[InlineData("1", "1")]
91+
[InlineData("a", "𝑎")]
92+
[InlineData("!", "!")]
93+
[InlineData("1234567890", "1234567890")]
94+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝑎𝑏𝑐𝑑𝑒𝑓𝑔ℎ𝑖𝑗𝑘𝑙𝑚𝑛𝑜𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑥𝑦𝑧")]
95+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍")]
96+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")]
97+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "𝛢𝛣𝛤𝛥𝛦𝛧𝛨𝛩𝛪𝛫𝛬𝛭𝛮𝛯𝛰𝛱𝛲𝛴𝛵𝛶𝛷𝛸𝛹𝛺")] // Unlike Default font
98+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
99+
[InlineData("!2|a@A<β$Δ`ϖ|", "!2|𝑎@𝐴<𝛽$𝛥`𝜛|")]
100+
public void Italic(string input, string output) => Test(input, output, "mathit");
101+
[Theory]
102+
[InlineData("", "")]
103+
[InlineData("1", "𝟣")]
104+
[InlineData("a", "𝖺")]
105+
[InlineData("!", "!")]
106+
[InlineData("1234567890", "𝟣𝟤𝟥𝟦𝟧𝟨𝟩𝟪𝟫𝟢")]
107+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝖺𝖻𝖼𝖽𝖾𝖿𝗀𝗁𝗂𝗃𝗄𝗅𝗆𝗇𝗈𝗉𝗊𝗋𝗌𝗍𝗎𝗏𝗑𝗒𝗓")]
108+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝖠𝖡𝖢𝖣𝖤𝖥𝖦𝖧𝖨𝖩𝖪𝖫𝖬𝖭𝖮𝖯𝖰𝖱𝖲𝖳𝖴𝖵𝖶𝖷𝖸𝖹")]
109+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")] // Default font
110+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")] // Default font
111+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
112+
[InlineData("!2|a@A<β$Δ`ϖ|", "!𝟤|𝖺@𝖠<𝛽$Δ`𝜛|")]
113+
public void SansSerif(string input, string output) => Test(input, output, "mathsf");
114+
[Theory]
115+
[InlineData("", "")]
116+
[InlineData("1", "1")]
117+
[InlineData("a", "𝔞")]
118+
[InlineData("!", "!")]
119+
[InlineData("1234567890", "1234567890")]
120+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔵𝔶𝔷")]
121+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝔄𝔅ℭ𝔇𝔈𝔉𝔊ℌℑ𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔ℜ𝔖𝔗𝔘𝔙𝔚𝔛𝔜ℨ")]
122+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")] // Default font
123+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")] // Default font
124+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
125+
[InlineData("!2|a@A<β$Δ`ϖ|", "!2|𝔞@𝔄<𝛽$Δ`𝜛|")]
126+
public void Fraktur(string input, string output) => Test(input, output, "mathfrak");
127+
[Theory]
128+
[InlineData("", "")]
129+
[InlineData("1", "𝟙")]
130+
[InlineData("a", "𝕒")]
131+
[InlineData("!", "!")]
132+
[InlineData("1234567890", "𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡𝟘")]
133+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕩𝕪𝕫")]
134+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ")]
135+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝛼𝛽𝛾𝛿𝜀𝜁𝜂𝜃𝜄𝜅𝜆𝜇𝜈𝜉𝜊𝜋𝜌𝜍𝜎𝜏𝜐𝜑𝜒𝜓𝜔∂𝜖𝜗𝜘𝜙𝜚𝜛")] // Default font
136+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ")] // Default font
137+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
138+
[InlineData("!2|a@A<β$Δ`ϖ|", "!𝟚|𝕒@𝔸<𝛽$Δ`𝜛|")]
139+
public void Blackboard(string input, string output) => Test(input, output, "mathbb");
140+
[Theory]
141+
[InlineData("", "")]
142+
[InlineData("1", "𝟏")]
143+
[InlineData("a", "𝒂")]
144+
[InlineData("!", "!")]
145+
[InlineData("1234567890", "𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗𝟎")]
146+
[InlineData("abcdefghijklmnopqrstuvxyz", "𝒂𝒃𝒄𝒅𝒆𝒇𝒈𝒉𝒊𝒋𝒌𝒍𝒎𝒏𝒐𝒑𝒒𝒓𝒔𝒕𝒖𝒗𝒙𝒚𝒛")]
147+
[InlineData("ABCDEFGHIJKLMNOPQRSTUVWXYZ", "𝑨𝑩𝑪𝑫𝑬𝑭𝑮𝑯𝑰𝑱𝑲𝑳𝑴𝑵𝑶𝑷𝑸𝑹𝑺𝑻𝑼𝑽𝑾𝑿𝒀𝒁")]
148+
[InlineData("αβγδεζηθικλμνξοπρςστυφχψω∂ϵϑϰϕϱϖ", "𝜶𝜷𝜸𝜹𝜺𝜻𝜼𝜽𝜾𝜿𝝀𝝁𝝂𝝃𝝄𝝅𝝆𝝇𝝈𝝉𝝊𝝋𝝌𝝍𝝎∂𝝐𝝑𝝒𝝓𝝔𝝕")]
149+
[InlineData("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ", "𝜜𝜝𝜞𝜟𝜠𝜡𝜢𝜣𝜤𝜥𝜦𝜧𝜨𝜩𝜪𝜫𝜬𝜮𝜯𝜰𝜱𝜲𝜳𝜴")]
150+
[InlineData("~!@<$`|=*();+", "~!@<$`|=*();+")]
151+
[InlineData("!2|a@A<β$Δ`ϖ|", "!𝟐|𝒂@𝑨<𝜷$𝜟`𝝕|")]
152+
public void BoldItalic(string input, string output) => Test(input, output, "mathbfit");
153+
}
154+
}

CSharpMath.CoreTests/MockTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using CSharpMath.CoreTests.FrontEnd;
22
using Xunit;
3-
using TGlyph = System.Char;
3+
using TGlyph = System.Text.Rune;
44
using CSharpMath.Display;
55

66
namespace CSharpMath.CoreTests {
@@ -11,7 +11,7 @@ public void TestGlyphBoundsWithoutM() {
1111
string hello = "Hello";
1212
var font = new TestFont(10);
1313
var provider = TestGlyphBoundsProvider.Instance;
14-
var glyphRun = new AttributedGlyphRun<TestFont, TGlyph>(hello, hello, font);
14+
var glyphRun = new AttributedGlyphRun<TestFont, TGlyph>(hello, hello.EnumerateRunes(), font);
1515
Assert.All(glyphRun.GlyphInfos, glyphInfo => Assert.Null(glyphInfo.Foreground));
1616
var width = provider.GetTypographicWidth(font, glyphRun);
1717
Approximately.Equal(width, 25, 0.01);
@@ -21,7 +21,7 @@ public void TestGlyphBoundsWithM() {
2121
string america = "America";
2222
var font = new TestFont(10);
2323
var provider = TestGlyphBoundsProvider.Instance;
24-
var glyphRun = new AttributedGlyphRun<TestFont, TGlyph>(america, america, font);
24+
var glyphRun = new AttributedGlyphRun<TestFont, TGlyph>(america, america.EnumerateRunes(), font);
2525
Assert.All(glyphRun.GlyphInfos, glyphInfo => Assert.Null(glyphInfo.Foreground));
2626
var width = provider.GetTypographicWidth(font, glyphRun);
2727
Approximately.Equal(width, 40, 0.01);

0 commit comments

Comments
 (0)