MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / getKerning

Method getKerning

lib/EpdFont/EpdFont.cpp:103–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103int8_t EpdFont::getKerning(const uint32_t leftCp, const uint32_t rightCp) const {
104 if (utf8IsCjkBreakable(leftCp) || utf8IsCjkBreakable(rightCp)) {
105 return 0;
106 }
107 if (!data->kernMatrix) {
108 return 0;
109 }
110 const uint8_t lc = lookupKernClass(data->kernLeftClasses, data->kernLeftEntryCount, leftCp);
111 if (lc == 0) return 0;
112 const uint8_t rc = lookupKernClass(data->kernRightClasses, data->kernRightEntryCount, rightCp);
113 if (rc == 0) return 0;
114 return data->kernMatrix[(lc - 1) * data->kernRightClassCount + (rc - 1)];
115}
116
117uint32_t EpdFont::getLigature(const uint32_t leftCp, const uint32_t rightCp) const {
118 const auto* pairs = data->ligaturePairs;

Callers 4

computeLineBreaksMethod · 0.45
extractLineMethod · 0.45
TESTFunction · 0.45

Calls 2

utf8IsCjkBreakableFunction · 0.85
lookupKernClassFunction · 0.85

Tested by 1

TESTFunction · 0.36