Skip to content

Commit c434bd2

Browse files
BezrukovMyulian-gaponenko
authored andcommitted
Typography applier infrastructure
DEVSIX-5267 Autoported commit. Original commit hash: [648e2d478]
1 parent 491988d commit c434bd2

File tree

5 files changed

+166
-375
lines changed

5 files changed

+166
-375
lines changed

itext.tests/itext.layout.tests/itext/layout/renderer/TypographyUtilsTest.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ source product.
4040
For more information, please contact iText Software Corp. at this
4141
4242
*/
43-
using System.Collections.Generic;
44-
using iText.Commons.Utils;
45-
using iText.IO.Font.Otf;
4643
using iText.Test;
4744

4845
namespace iText.Layout.Renderer {
@@ -51,41 +48,5 @@ public class TypographyUtilsTest : ExtendedITextTest {
5148
public virtual void VerifyPdfCalligraphIsNotAvailable() {
5249
NUnit.Framework.Assert.IsFalse(TypographyUtils.IsPdfCalligraphAvailable());
5350
}
54-
55-
[NUnit.Framework.Test]
56-
public virtual void UpdateAnchorDeltaMarkNotReorderedTest() {
57-
// original line 'abm', and 'm' is a mark based on 'b'
58-
Glyph mGlyph = new Glyph(100, 'm');
59-
mGlyph.SetAnchorDelta((short)-1);
60-
mGlyph.SetXAdvance((short)15);
61-
mGlyph.SetYAdvance((short)25);
62-
LineRenderer.RendererGlyph b = new LineRenderer.RendererGlyph(new Glyph(100, 'b'), null);
63-
LineRenderer.RendererGlyph m = new LineRenderer.RendererGlyph(mGlyph, null);
64-
LineRenderer.RendererGlyph a = new LineRenderer.RendererGlyph(new Glyph(100, 'a'), null);
65-
IList<LineRenderer.RendererGlyph> reorderedLine = JavaUtil.ArraysAsList(b, m, a);
66-
int[] reorder = new int[] { 1, 2, 0 };
67-
int[] inverseReorder = new int[] { 2, 0, 1 };
68-
TypographyUtils.UpdateAnchorDeltaForReorderedLineGlyphs(reorder, inverseReorder, reorderedLine);
69-
NUnit.Framework.Assert.AreSame(mGlyph, m.glyph);
70-
NUnit.Framework.Assert.AreEqual(-1, m.glyph.GetAnchorDelta());
71-
}
72-
73-
[NUnit.Framework.Test]
74-
public virtual void UpdateAnchorDeltaMarkReorderedTest() {
75-
// original line 'abm', and 'm' is a mark based on 'b'
76-
Glyph mGlyph = new Glyph(100, 'm');
77-
mGlyph.SetAnchorDelta((short)-1);
78-
mGlyph.SetXAdvance((short)15);
79-
mGlyph.SetYAdvance((short)25);
80-
LineRenderer.RendererGlyph m = new LineRenderer.RendererGlyph(mGlyph, null);
81-
LineRenderer.RendererGlyph b = new LineRenderer.RendererGlyph(new Glyph(100, 'b'), null);
82-
LineRenderer.RendererGlyph a = new LineRenderer.RendererGlyph(new Glyph(100, 'a'), null);
83-
IList<LineRenderer.RendererGlyph> reorderedLine = JavaUtil.ArraysAsList(m, b, a);
84-
int[] reorder = new int[] { 2, 1, 0 };
85-
int[] inverseReorder = new int[] { 2, 1, 0 };
86-
TypographyUtils.UpdateAnchorDeltaForReorderedLineGlyphs(reorder, inverseReorder, reorderedLine);
87-
NUnit.Framework.Assert.AreNotSame(mGlyph, m.glyph);
88-
NUnit.Framework.Assert.AreEqual(1, m.glyph.GetAnchorDelta());
89-
}
9051
}
9152
}

itext/itext.layout/itext/layout/renderer/LineRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ private float DecreaseRelativeWidthByChildAdditionalWidth(IRenderer childRendere
15901590
return normalizedChildWidth;
15911591
}
15921592

1593-
internal class RendererGlyph {
1593+
public class RendererGlyph {
15941594
public Glyph glyph;
15951595

15961596
public TextRenderer renderer;

0 commit comments

Comments
 (0)