MCPcopy Create free account
hub / github.com/JetBrains/skija / testLigatures

Method testLigatures

tests/java/TextLineTest.java:82–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 }
81
82 public void testLigatures() {
83 try (TextLine line = TextLine.make("<=>->", inter36);) {
84 assertArrayEquals(new short[] {1712, 1701}, line.getGlyphs());
85 assertArrayEquals(new int[] {0, 1, 2, 3, 4, 5}, TextLine._nGetBreakOffsets(line._ptr));
86 assertArrayEquals(new float[] {0f, 16f, 32f, 48f, 65f, 82f}, TextLine._nGetBreakPositions(line._ptr));
87
88 pushStack("getOffsetAtCoord");
89 assertEquals(0, line.getOffsetAtCoord(0f));
90 assertEquals(1, line.getOffsetAtCoord(16f));
91 assertEquals(2, line.getOffsetAtCoord(32f));
92 assertEquals(3, line.getOffsetAtCoord(48f));
93 assertEquals(4, line.getOffsetAtCoord(65f));
94 assertEquals(5, line.getOffsetAtCoord(82f));
95 popStack();
96
97 pushStack("getCoordAtOffset");
98 assertClose(0f, line.getCoordAtOffset(0));
99 assertClose(16f, line.getCoordAtOffset(1));
100 assertClose(32f, line.getCoordAtOffset(2));
101 assertClose(48f, line.getCoordAtOffset(3));
102 assertClose(65f, line.getCoordAtOffset(4));
103 assertClose(82f, line.getCoordAtOffset(5));
104 popStack();
105 }
106 }
107
108 public void testCombining() {
109 // u U+0075 LATIN SMALL LETTER U

Callers 1

executeMethod · 0.95

Calls 11

makeMethod · 0.95
_nGetBreakOffsetsMethod · 0.95
_nGetBreakPositionsMethod · 0.95
assertArrayEqualsMethod · 0.80
pushStackMethod · 0.80
assertEqualsMethod · 0.80
getOffsetAtCoordMethod · 0.80
popStackMethod · 0.80
assertCloseMethod · 0.80
getCoordAtOffsetMethod · 0.80
getGlyphsMethod · 0.45

Tested by

no test coverage detected