Skip to content

Commit f75643d

Browse files
authored
Killing four bugs with one PR? (#144)
* Killing four bugs with one fix? * Revert unneeded changes * Add comments * Update CSharpMath.Forms.Example.UWP.csproj
1 parent a97d586 commit f75643d

File tree

96 files changed

+229
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+229
-81
lines changed

CSharpMath.Forms.Example/CSharpMath.Forms.Example.Android/Resources/Resource.designer.cs

Lines changed: 118 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CSharpMath.Forms.Example/CSharpMath.Forms.Example.UWP/CSharpMath.Forms.Example.UWP.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@
171171
</ItemGroup>
172172
<ItemGroup>
173173
<PackageReference Include="Xamarin.Forms" Version="4.3.0.908675" />
174-
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
175-
<Version>6.2.8</Version>
176-
</PackageReference>
174+
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10" />
177175
</ItemGroup>
178176
<ItemGroup>
179177
<ProjectReference Include="..\..\CSharpMath.Editor\CSharpMath.Editor.csproj">
@@ -212,4 +210,4 @@
212210
<Target Name="AfterBuild">
213211
</Target>
214212
-->
215-
</Project>
213+
</Project>

CSharpMath.Forms.Example/CSharpMath.Forms.Example/SelectPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public SelectPage() {
1111
InitializeComponent();
1212
App.AllMathViews.Add(View);
1313
Size.ItemsSource = TryPage.FontSizes;
14+
Size.SelectedItem = View.FontSize;
1415
Size.SelectedIndexChanged += (sender, e) =>
1516
View.FontSize = (float)Size.SelectedItem;
16-
Size.SelectedItem = 96f;
1717
Picker.ItemsSource = Rendering.Tests.TestRenderingMathData.AllConstants.Keys.ToList();
1818
Picker.SelectedIndexChanged += (sender, e) =>
1919
View.LaTeX = Label.Text = Rendering.Tests.TestRenderingMathData.AllConstants[(string)Picker.SelectedItem];

CSharpMath.Forms/Buttons.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ public BaseButton() {
1616
var latex = c.Painter.LaTeX;
1717
// Appropriate positioning for non-full characters, e.g. prime, degree
1818
// Also acts as spacing between MathButtons next to each other
19-
c.Painter.LaTeX = @"{\color{#0000}|}" + latex + @"{\color{#0000}|}";
19+
// TODO: Implement and use \phantom
20+
c.Painter.LaTeX = @"{\color{#00000000}|}" + latex + @"{\color{#00000000}|}";
2021
var stream = c.Painter.DrawAsStream();
2122
c.Painter.LaTeX = latex;
2223
return stream;

CSharpMath.Forms/MathInputButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class MathInputButton : MathButton {
66
public MathInputButton() => Command = new Command(() => Keyboard?.KeyPress(Input));
77
public static readonly BindableProperty KeyboardProperty =
88
BindableProperty.Create(nameof(Keyboard), typeof(MathKeyboard), typeof(MathInputButton));
9-
public MathKeyboard Keyboard { get => (MathKeyboard)GetValue(KeyboardProperty); set => SetValue(KeyboardProperty, value); }
9+
public MathKeyboard? Keyboard { get => (MathKeyboard?)GetValue(KeyboardProperty); set => SetValue(KeyboardProperty, value); }
1010
static string InputToLaTeX(MathKeyboardInput input) {
1111
switch (input) {
1212
case MathKeyboardInput.Left: return "\u25C0";

CSharpMath.Rendering.Tests/TestRendering.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,33 @@ public void TextCenterInfiniteWidth(string file, string latex) =>
100100
[SkippableTheory, ClassData(typeof(TestRenderingTextData))]
101101
public void TextRightInfiniteWidth(string file, string latex) =>
102102
Run(file, latex, new TTextPainter(), TextAlignment.TopRight, textPainterCanvasWidth: float.PositiveInfinity);
103+
public static TheoryData<float, TextAlignment> TextFontSizesData() {
104+
var data = new TheoryData<float, TextAlignment>();
105+
// TODO: Fix font sizes at 100 and 300
106+
foreach (var fontSize in stackalloc[] { 20, 40, 60 })
107+
foreach (var alignment in typeof(TextAlignment).GetEnumValues().Cast<TextAlignment>())
108+
data.Add(fontSize, alignment);
109+
return data;
110+
}
111+
[SkippableTheory, MemberData(nameof(TextFontSizesData))]
112+
public void TextFontSizes(float fontSize, TextAlignment alignment) =>
113+
Run((fontSize, alignment).ToString(), @"Here are some text.
114+
This text is made to be long enough to have the TextPainter of CSharpMath add a line break to this text automatically.
115+
To demonstrate the capabilities of the TextPainter,
116+
here are some math content:
117+
First, a fraction in inline mode: $\frac34$
118+
Next, a summation in inline mode: $\sum_{i=0}^3i^i$
119+
Then, a summation in display mode: $$\sum_{i=0}^3i^i$$
120+
After that, an integral in display mode: $$\int^6_{-56}x\ dx$$
121+
Finally, an escaped dollar sign \$ that represents the start/end of math mode when it is unescaped.
122+
Colors can be achieved via \backslash color\textit{\{color\}\{content\}}, or \backslash \textit{color\{content\}},
123+
where \textit{color} stands for one of the LaTeX standard colors.
124+
\red{Colored text in text mode are able to automatically break up when spaces are inside the colored text, which the equivalent in math mode cannot do.}
125+
\textbf{Styled} \texttt{text} can be achieved via the LaTeX styling commands.
126+
The SkiaSharp version of this is located at CSharpMath.SkiaSharp.TextPainter;
127+
and the Xamarin.Forms version of this is located at CSharpMath.Forms.TextView.
128+
Was added in 0.1.0-pre4; working in 0.1.0-pre5; fully tested in 0.1.0-pre6. \[\frac{Display}{maths} \sqrt\text\mathtt{\ at\ the\ end}^\mathbf{are\ now\ incuded\ in\ Measure!} \]",
129+
new TTextPainter { FontSize = fontSize }, alignment);
103130
protected void Run<TContent>(
104131
string inFile, string latex, Painter<TCanvas, TContent, TColor> painter, TextAlignment alignment = TextAlignment.TopLeft,
105132
float textPainterCanvasWidth = TextPainter<TCanvas, TColor>.DefaultCanvasWidth, [CallerMemberName] string folder = "") where TContent : class {
@@ -120,7 +147,7 @@ protected void Run<TContent>(
120147

121148
var expectedFile = new FileInfo(System.IO.Path.Combine(folder, inFile + ".png"));
122149
if (!expectedFile.Exists) {
123-
Skip.If(FileSizeTolerance != 0, "Baseline images may only be created by SkiaSharp.");
150+
Skip.IfNot(FileSizeTolerance is 0, "Baseline images may only be created by SkiaSharp.");
124151
actualFile.CopyTo(expectedFile.FullName);
125152
expectedFile.Refresh();
126153
}
65 Bytes
-62 Bytes
-67 Bytes
-178 Bytes
19 Bytes
-13 Bytes
68 Bytes
-44 Bytes
20 Bytes
-69 Bytes
241 Bytes
-74 Bytes
275 Bytes

CSharpMath.Rendering/FrontEnd/TextPainter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ private void DrawCore(TCanvas canvas, float? width, TextAlignment alignment,
6464
? System.Math.Max(_relativeXCoordDisplay.Displays.CollectionWidth(),
6565
_absoluteXCoordDisplay.Displays.IsNonEmpty() ? _absoluteXCoordDisplay.Displays.Max(d => d.Width) : 0)
6666
: c.Width;
67+
// https://github.com/verybadcat/CSharpMath/issues/123
68+
// Take into account padding, offset etc. on both sides
69+
adjustedCanvasWidth -= _relativeXCoordDisplay.Position.X * 2;
6770
float Δx = 0;
6871
var y = float.NegativeInfinity;
6972
var leftRightFlags = alignment & (TextAlignment.Left | TextAlignment.Right);

CSharpMath.Xaml/Views.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,12 @@ protected override void OnTouch(global::SkiaSharp.Views.Forms.SKTouchEventArgs e
156156
}
157157
protected sealed override void OnPaintSurface(global::SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs e) {
158158
base.OnPaintSurface(e);
159-
e.Surface.Canvas.Clear();
160159
var canvas = e.Surface.Canvas;
160+
canvas.Clear();
161+
// https://github.com/verybadcat/CSharpMath/issues/136 and https://github.com/verybadcat/CSharpMath/issues/137
162+
// SkiaSharp deals with raw pixels as opposed to Xamarin.Forms's device-independent units.
163+
// We should scale to occupy the full view size.
164+
canvas.Scale(e.Info.Width / (float)Width);
161165
#endif
162166
Painter.Draw(canvas, TextAlignment, Padding, DisplacementX, DisplacementY);
163167
}

CSharpMath/Display/Typesetter.cs

Lines changed: 69 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ private void CreateDisplayAtoms(List<MathAtom> preprocessedAtoms) {
168168
case Variable _:
169169
case UnaryOperator _:
170170
throw new InvalidCodePathException
171-
($"Type {atom.GetType()} should have been removed by preprocessing");
171+
($"Type {atom.TypeName} should have been removed by preprocessing");
172172
case Space space:
173173
AddDisplayLine(false);
174174
_currentPosition.X += space.ActualLength(_mathTable, _font);
@@ -232,7 +232,7 @@ private void CreateDisplayAtoms(List<MathAtom> preprocessedAtoms) {
232232
AddInterElementSpace(prevAtom, inner);
233233
IDisplay<TFont, TGlyph> innerDisplay;
234234
if (inner.LeftBoundary != Boundary.Empty || inner.RightBoundary != Boundary.Empty) {
235-
innerDisplay = _MakeInner(inner, atom.IndexRange);
235+
innerDisplay = MakeInner(inner, atom.IndexRange);
236236
} else {
237237
innerDisplay = CreateLine(inner.InnerList, _font, _context, _style, _cramped);
238238
}
@@ -522,6 +522,20 @@ private void AddInterElementSpace(MathAtom? prev, MathAtom current) =>
522522
return null;
523523
}
524524
private RadicalDisplay<TFont, TGlyph> MakeRadical(MathList radicand, Range range) {
525+
IGlyphDisplay<TFont, TGlyph> _GetRadicalGlyph(float radicalHeight) {
526+
// TODO: something related to GlyphFinder.FindGlyph
527+
var radicalGlyph = _context.GlyphFinder.FindGlyphForCharacterAtIndex(_font, 0, "\u221A");
528+
var glyph = FindGlyph(radicalGlyph, radicalHeight,
529+
out float glyphAscent, out float glyphDescent, out float glyphWidth);
530+
531+
return
532+
glyphAscent + glyphDescent < radicalHeight
533+
// the glyphs are not big enough, so we construct one using extenders
534+
&& ConstructGlyph(radicalGlyph, radicalHeight) is IGlyphDisplay<TFont, TGlyph> constructed
535+
? constructed
536+
: new GlyphDisplay<TFont, TGlyph>
537+
(glyph, Range.NotFound, _styleFont, glyphAscent, glyphDescent, glyphWidth);
538+
}
525539
var innerDisplay = CreateLine(radicand, _font, _context, _style, true);
526540
var radicalVerticalGap =
527541
_style == LineStyle.Display
@@ -562,46 +576,43 @@ private RadicalDisplay<TFont, TGlyph> MakeRadical(MathList radicand, Range range
562576
};
563577
}
564578

565-
private float _NumeratorShiftUp(bool hasRule) =>
566-
(hasRule, _style) switch
567-
{
568-
(true, LineStyle.Display) => _mathTable.FractionNumeratorDisplayStyleShiftUp(_styleFont),
569-
(true, _) => _mathTable.FractionNumeratorShiftUp(_styleFont),
570-
(false, LineStyle.Display) => _mathTable.StackTopDisplayStyleShiftUp(_styleFont),
571-
(false, _) => _mathTable.StackTopShiftUp(_styleFont)
572-
};
573-
private float _NumeratorGapMin =>
574-
_style == LineStyle.Display
575-
? _mathTable.FractionNumDisplayStyleGapMin(_styleFont)
576-
: _mathTable.FractionNumeratorGapMin(_styleFont);
577-
578-
private float _DenominatorShiftDown(bool hasRule) =>
579-
(hasRule, _style) switch
580-
{
581-
(true, LineStyle.Display) => _mathTable.FractionDenominatorDisplayStyleShiftDown(_styleFont),
582-
(true, _) => _mathTable.FractionDenominatorShiftDown(_styleFont),
583-
(false, LineStyle.Display) => _mathTable.StackBottomDisplayStyleShiftDown(_styleFont),
584-
(false, _) => _mathTable.StackBottomShiftDown(_styleFont)
585-
};
586-
587-
private float _DenominatorGapMin =>
588-
_style == LineStyle.Display
589-
? _mathTable.FractionDenomDisplayStyleGapMin(_styleFont)
590-
: _mathTable.FractionDenominatorGapMin(_styleFont);
591-
592-
private float _StackGapMin =>
593-
_style == LineStyle.Display
594-
? _mathTable.StackDisplayStyleGapMin(_styleFont)
595-
: _mathTable.StackGapMin(_styleFont);
596-
597-
private float _FractionDelimiterHeight =>
598-
_style == LineStyle.Display
599-
? _mathTable.FractionDelimiterDisplayStyleSize(_styleFont)
600-
: _mathTable.FractionDelimiterSize(_styleFont);
601-
602579
private IDisplay<TFont, TGlyph> MakeFraction(Fraction fraction) {
580+
float _NumeratorShiftUp(bool hasRule) =>
581+
(hasRule, _style) switch
582+
{
583+
(true, LineStyle.Display) => _mathTable.FractionNumeratorDisplayStyleShiftUp(_styleFont),
584+
(true, _) => _mathTable.FractionNumeratorShiftUp(_styleFont),
585+
(false, LineStyle.Display) => _mathTable.StackTopDisplayStyleShiftUp(_styleFont),
586+
(false, _) => _mathTable.StackTopShiftUp(_styleFont)
587+
};
588+
float _NumeratorGapMin() =>
589+
_style == LineStyle.Display
590+
? _mathTable.FractionNumDisplayStyleGapMin(_styleFont)
591+
: _mathTable.FractionNumeratorGapMin(_styleFont);
592+
593+
float _DenominatorShiftDown(bool hasRule) =>
594+
(hasRule, _style) switch
595+
{
596+
(true, LineStyle.Display) => _mathTable.FractionDenominatorDisplayStyleShiftDown(_styleFont),
597+
(true, _) => _mathTable.FractionDenominatorShiftDown(_styleFont),
598+
(false, LineStyle.Display) => _mathTable.StackBottomDisplayStyleShiftDown(_styleFont),
599+
(false, _) => _mathTable.StackBottomShiftDown(_styleFont)
600+
};
601+
float _DenominatorGapMin() =>
602+
_style == LineStyle.Display
603+
? _mathTable.FractionDenomDisplayStyleGapMin(_styleFont)
604+
: _mathTable.FractionDenominatorGapMin(_styleFont);
605+
float _StackGapMin() =>
606+
_style == LineStyle.Display
607+
? _mathTable.StackDisplayStyleGapMin(_styleFont)
608+
: _mathTable.StackGapMin(_styleFont);
609+
float _FractionDelimiterHeight() =>
610+
_style == LineStyle.Display
611+
? _mathTable.FractionDelimiterDisplayStyleSize(_styleFont)
612+
: _mathTable.FractionDelimiterSize(_styleFont);
613+
603614
var numeratorDisplay =
604-
CreateLine(fraction.Numerator, _font, _context, _fractionStyle, false);
615+
CreateLine(fraction.Numerator, _font, _context, _fractionStyle, false);
605616
var denominatorDisplay =
606617
CreateLine(fraction.Denominator, _font, _context, _fractionStyle, true);
607618

@@ -616,20 +627,20 @@ private IDisplay<TFont, TGlyph> MakeFraction(Fraction fraction) {
616627
var distanceFromNumeratorToBar =
617628
numeratorShiftUp - numeratorDisplay.Descent - (barLocation + barThickness / 2);
618629
// The distance should be at least displayGap
619-
if (distanceFromNumeratorToBar < _NumeratorGapMin) {
620-
numeratorShiftUp += (_NumeratorGapMin - distanceFromNumeratorToBar);
630+
if (distanceFromNumeratorToBar < _NumeratorGapMin()) {
631+
numeratorShiftUp += (_NumeratorGapMin() - distanceFromNumeratorToBar);
621632
}
622633
// now, do the same for the denominator
623634
var distanceFromDenominatorToBar =
624635
barLocation - barThickness / 2 - (denominatorDisplay.Ascent - denominatorShiftDown);
625-
if (distanceFromDenominatorToBar < _DenominatorGapMin) {
626-
denominatorShiftDown += _DenominatorGapMin - distanceFromDenominatorToBar;
636+
if (distanceFromDenominatorToBar < _DenominatorGapMin()) {
637+
denominatorShiftDown += _DenominatorGapMin() - distanceFromDenominatorToBar;
627638
}
628639
} else {
629640
float clearance =
630641
numeratorShiftUp - numeratorDisplay.Descent
631642
- (denominatorDisplay.Ascent - denominatorShiftDown);
632-
float minClearance = _StackGapMin;
643+
float minClearance = _StackGapMin();
633644
if (clearance < minClearance) {
634645
numeratorShiftUp += (minClearance - clearance / 2);
635646
denominatorShiftDown += (minClearance - clearance) / 2;
@@ -649,11 +660,11 @@ private IDisplay<TFont, TGlyph> MakeFraction(Fraction fraction) {
649660

650661
if (fraction.LeftDelimiter is null && fraction.RightDelimiter is null)
651662
return display;
652-
var glyphHeight = _FractionDelimiterHeight;
663+
var glyphHeight = _FractionDelimiterHeight();
653664
var position = new PointF();
654665
var innerGlyphs = new List<IDisplay<TFont, TGlyph>>();
655666
if (fraction.LeftDelimiter?.Length > 0) {
656-
var leftGlyph = _FindGlyphForBoundary(fraction.LeftDelimiter, glyphHeight);
667+
var leftGlyph = FindGlyphForBoundary(fraction.LeftDelimiter, glyphHeight);
657668
leftGlyph.Position = position;
658669
innerGlyphs.Add(leftGlyph);
659670
position.X += leftGlyph.Width;
@@ -662,7 +673,7 @@ private IDisplay<TFont, TGlyph> MakeFraction(Fraction fraction) {
662673
position.X += display.Width;
663674
innerGlyphs.Add(display);
664675
if (fraction.RightDelimiter?.Length > 0) {
665-
var rightGlyph = _FindGlyphForBoundary(fraction.RightDelimiter, glyphHeight);
676+
var rightGlyph = FindGlyphForBoundary(fraction.RightDelimiter, glyphHeight);
666677
rightGlyph.Position = position;
667678
innerGlyphs.Add(rightGlyph);
668679
position.X += rightGlyph.Width;
@@ -672,7 +683,7 @@ private IDisplay<TFont, TGlyph> MakeFraction(Fraction fraction) {
672683
};
673684
}
674685

675-
private InnerDisplay<TFont, TGlyph> _MakeInner(Inner inner, Range range) {
686+
private InnerDisplay<TFont, TGlyph> MakeInner(Inner inner, Range range) {
676687
if (inner.LeftBoundary == Boundary.Empty && inner.RightBoundary == Boundary.Empty) {
677688
throw new InvalidCodePathException("Inner should have a boundary to call this function.");
678689
}
@@ -689,24 +700,24 @@ private InnerDisplay<TFont, TGlyph> _MakeInner(Inner inner, Range range) {
689700

690701
var leftGlyph =
691702
inner.LeftBoundary is Boundary { Nucleus: var left } && left.Length > 0
692-
? _FindGlyphForBoundary(left, glyphHeight)
703+
? FindGlyphForBoundary(left, glyphHeight)
693704
: null;
694705

695706
var rightGlyph =
696707
inner.RightBoundary is Boundary { Nucleus: var right } && right.Length > 0
697-
? _FindGlyphForBoundary(right, glyphHeight)
708+
? FindGlyphForBoundary(right, glyphHeight)
698709
: null;
699710
return new InnerDisplay<TFont, TGlyph>(innerListDisplay, leftGlyph, rightGlyph, range);
700711
}
701712

702-
private IGlyphDisplay<TFont, TGlyph> _FindGlyphForBoundary(
713+
private IGlyphDisplay<TFont, TGlyph> FindGlyphForBoundary(
703714
string delimiter, float glyphHeight) {
704715
var leftGlyph = _context.GlyphFinder.FindGlyphForCharacterAtIndex(_font, 0, delimiter);
705-
var glyph = _FindGlyph(leftGlyph, glyphHeight,
716+
var glyph = FindGlyph(leftGlyph, glyphHeight,
706717
out float glyphAscent, out float glyphDescent, out float glyphWidth);
707718
var glyphDisplay =
708719
glyphAscent + glyphDescent < glyphHeight
709-
&& _ConstructGlyph(leftGlyph, glyphHeight) is IGlyphDisplay<TFont, TGlyph> constructed
720+
&& ConstructGlyph(leftGlyph, glyphHeight) is IGlyphDisplay<TFont, TGlyph> constructed
710721
? constructed
711722
: new GlyphDisplay<TFont, TGlyph>
712723
(glyph, Range.NotFound, _styleFont, glyphAscent, glyphDescent, glyphWidth);
@@ -718,35 +729,21 @@ private IGlyphDisplay<TFont, TGlyph> _FindGlyphForBoundary(
718729
return glyphDisplay;
719730
}
720731

721-
private IGlyphDisplay<TFont, TGlyph> _GetRadicalGlyph(float radicalHeight) {
722-
// TODO: something related to GlyphFinder.FindGlyph
723-
var radicalGlyph = _context.GlyphFinder.FindGlyphForCharacterAtIndex(_font, 0, "\u221A");
724-
var glyph = _FindGlyph(radicalGlyph, radicalHeight,
725-
out float glyphAscent, out float glyphDescent, out float glyphWidth);
726-
727-
return
728-
glyphAscent + glyphDescent < radicalHeight
729-
// the glyphs are not big enough, so we construct one using extenders
730-
&& _ConstructGlyph(radicalGlyph, radicalHeight) is IGlyphDisplay<TFont, TGlyph> constructed
731-
? constructed
732-
: new GlyphDisplay<TFont, TGlyph>
733-
(glyph, Range.NotFound, _styleFont, glyphAscent, glyphDescent, glyphWidth);
734-
}
735732

736-
private GlyphConstructionDisplay<TFont, TGlyph>? _ConstructGlyph(TGlyph glyph, float glyphHeight) {
733+
private GlyphConstructionDisplay<TFont, TGlyph>? ConstructGlyph(TGlyph glyph, float glyphHeight) {
737734
var parts = _mathTable.GetVerticalGlyphAssembly(glyph, _styleFont);
738735
if (parts is null) return null;
739736
var glyphs = new List<TGlyph>();
740737
var offsets = new List<float>();
741-
float height = _ConstructGlyphWithParts(parts, glyphHeight, glyphs, offsets);
738+
float height = ConstructGlyphWithParts(parts, glyphHeight, glyphs, offsets);
742739
using var singleGlyph = new Structures.RentedArray<TGlyph>(glyphs[0]);
743740
// descent:0 because it's up to the rendering to adjust the display glyph up or down by setting ShiftDown
744741
return new GlyphConstructionDisplay<TFont, TGlyph>
745742
(glyphs, offsets, _styleFont, height, 0, _context.GlyphBoundsProvider
746743
.GetAdvancesForGlyphs(_styleFont, singleGlyph.Result, 1).Total);
747744
}
748745

749-
private float _ConstructGlyphWithParts(IEnumerable<GlyphPart<TGlyph>> parts,
746+
private float ConstructGlyphWithParts(IEnumerable<GlyphPart<TGlyph>> parts,
750747
float glyphHeight, List<TGlyph> glyphs, List<float> offsets) {
751748
for (int nExtenders = 0; ; nExtenders++) {
752749
glyphs.Clear();
@@ -800,7 +797,7 @@ private float _ConstructGlyphWithParts(IEnumerable<GlyphPart<TGlyph>> parts,
800797
}
801798
}
802799

803-
private TGlyph _FindGlyph(TGlyph rawGlyph, float height,
800+
private TGlyph FindGlyph(TGlyph rawGlyph, float height,
804801
out float glyphAscent, out float glyphDescent, out float glyphWidth) {
805802
// in iosMath.
806803
glyphAscent = glyphDescent = glyphWidth = float.NaN;

0 commit comments

Comments
 (0)