MCPcopy Create free account
hub / github.com/HumbleUI/Skija / testLigatures

Method testLigatures

tests/java/TextLineTest.java:83–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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