Skip to content

Commit

Permalink
Update harfbuzz to 7.3.0 (#2582)
Browse files Browse the repository at this point in the history
\
# Conflicts:
#	externals/skia
#	scripts/VERSIONS.txt
  • Loading branch information
mattleibow committed Aug 29, 2023
1 parent f890265 commit 687c7cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
23 changes: 9 additions & 14 deletions tests/Tests/HBFontTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void ShouldHaveDefaultSupportedShapers()
using (var face = new Face(Blob, 0))
using (var font = new Font(face))
{
Assert.Equal(new[] { "ot", "fallback" }, font.SupportedShapers);
Assert.Equal(new[] { "ot" }, font.SupportedShapers);
}
}

Expand All @@ -35,8 +35,7 @@ public void ShouldHaveDefaultScale()
using (var font = new Font(face))
{
font.GetScale(out var xScale, out var yScale);
Assert.Equal(2048, xScale);
Assert.Equal(2048, yScale);
Assert.Equal((2048, 2048), (xScale, yScale));
}
}

Expand All @@ -47,8 +46,7 @@ public void ShouldGetHorizontalGlyphOrigin()
using (var font = new Font(face))
{
font.TryGetHorizontalGlyphOrigin(49, out var xOrigin, out var yOrigin);
Assert.Equal(0, xOrigin);
Assert.Equal(0, yOrigin);
Assert.Equal((0, 0), (xOrigin, yOrigin));
}
}

Expand All @@ -59,8 +57,7 @@ public void ShouldGetVerticalGlyphOrigin()
using (var font = new Font(face))
{
Assert.True(font.TryGetVerticalGlyphOrigin(49, out var xOrigin, out var yOrigin));
Assert.Equal(557, xOrigin);
Assert.Equal(1022, yOrigin);
Assert.Equal((557, 1991), (xOrigin, yOrigin));
}
}

Expand All @@ -80,7 +77,7 @@ public void ShouldGetVerticalGlyphAdvance()
using (var face = new Face(Blob, 0))
using (var font = new Font(face))
{
Assert.Equal(-2048, font.GetVerticalGlyphAdvance(49));
Assert.Equal(-2961, font.GetVerticalGlyphAdvance(49));
}
}

Expand All @@ -91,10 +88,9 @@ public void ShouldGetHorizontalGlyphAdvances()
using (var font = new Font(face))
{
var advances = font.GetHorizontalGlyphAdvances(new[] { 49u, 50u, 51u });
var expected = new [] { 1114, 514, 602 };

Assert.Equal(1114, advances[0]);
Assert.Equal(514, advances[1]);
Assert.Equal(602, advances[2]);
Assert.Equal(expected, advances);
}
}

Expand All @@ -105,10 +101,9 @@ public void ShouldGetVerticalGlyphAdvances()
using (var font = new Font(face))
{
var advances = font.GetVerticalGlyphAdvances(new[] { 49u, 50u, 51u });
var expected = new [] { -2961, -2961, -2961 };

Assert.Equal(-2048, advances[0]);
Assert.Equal(-2048, advances[1]);
Assert.Equal(-2048, advances[2]);
Assert.Equal(expected, advances);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Tests/SKShaperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void CorrectlyShapesArabicScriptAtAnOffset()
{
var clusters = new uint[] { 4, 2, 0 };
var codepoints = new uint[] { 629, 668, 891 };
var points = new SKPoint[] { new SKPoint(100, 200), new SKPoint(128.25f, 200), new SKPoint(142, 200) };
var points = new SKPoint[] { new SKPoint(100, 200), new SKPoint(128.375f, 200), new SKPoint(142.125f, 200) };

using (var tf = SKTypeface.FromFile(Path.Combine(PathToFonts, "content-font.ttf")))
using (var shaper = new SKShaper(tf))
Expand All @@ -58,7 +58,7 @@ public void CorrectlyShapesArabicScript()
{
var clusters = new uint[] { 4, 2, 0 };
var codepoints = new uint[] { 629, 668, 891 };
var points = new SKPoint[] { new SKPoint(0, 0), new SKPoint(28.25f, 0), new SKPoint(42, 0) };
var points = new SKPoint[] { new SKPoint(0, 0), new SKPoint(28.375f, 0), new SKPoint(42.125f, 0) };

using (var tf = SKTypeface.FromFile(Path.Combine(PathToFonts, "content-font.ttf")))
using (var shaper = new SKShaper(tf))
Expand Down

0 comments on commit 687c7cc

Please sign in to comment.