| 137 | } |
| 138 | |
| 139 | uint32_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 | |
| 157 | const EpdGlyph* EpdFont::getGlyph(const uint32_t cp) const { |
| 158 | const int count = data->intervalCount; |
no test coverage detected