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

Method applyLigatures

lib/EpdFont/EpdFont.cpp:139–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139uint32_t EpdFont::applyLigatures(uint32_t cp, const char*& text) const {
140 if (!data->ligaturePairs || data->ligaturePairCount == 0) {
141 return cp;
142 }
143 while (true) {
144 const auto saved = reinterpret_cast<const uint8_t*>(text);
145 const uint32_t nextCp = utf8NextCodepoint(reinterpret_cast<const uint8_t**>(&text));
146 if (nextCp == 0) break;
147 const uint32_t lig = getLigature(cp, nextCp);
148 if (lig == 0) {
149 text = reinterpret_cast<const char*>(saved);
150 break;
151 }
152 cp = lig;
153 }
154 return cp;
155}
156
157const EpdGlyph* EpdFont::getGlyph(const uint32_t cp) const {
158 const int count = data->intervalCount;

Callers 3

drawTextMethod · 0.45
getTextAdvanceXMethod · 0.45
drawTextRotated90CWMethod · 0.45

Calls 1

utf8NextCodepointFunction · 0.85

Tested by

no test coverage detected