[ion] Namespace Ion::UTF8Helper and Ion::UTF8Decoder

This commit is contained in:
Émilie Feral
2019-04-26 17:47:40 +02:00
parent a499aa9b2c
commit 23da0d3f2c
39 changed files with 145 additions and 129 deletions

View File

@@ -12,7 +12,7 @@ KDPoint KDContext::drawString(const char * text, KDPoint p, const KDFont * font,
KDFont::GlyphBuffer glyphBuffer;
UTF8Decoder decoder(text);
Ion::UTF8Decoder decoder(text);
const char * codePointPointer = decoder.stringPosition();
CodePoint codePoint = decoder.nextCodePoint();
while (codePoint != UCodePointNull && (maxByteLength < 0 || codePointPointer < text + maxByteLength)) {

View File

@@ -12,7 +12,7 @@ KDSize KDFont::stringSizeUntil(const char * text, const char * limit) const {
}
KDSize stringSize = KDSize(0, m_glyphSize.height());
UTF8Decoder decoder(text);
Ion::UTF8Decoder decoder(text);
const char * currentStringPosition = decoder.stringPosition();
CodePoint codePoint = decoder.nextCodePoint();
while (codePoint != UCodePointNull && (limit == nullptr || currentStringPosition < limit)) {