diff --git a/app/src/main/cpp/CvText.cpp b/app/src/main/cpp/CvText.cpp index 01dbcdd5..48a15b16 100644 --- a/app/src/main/cpp/CvText.cpp +++ b/app/src/main/cpp/CvText.cpp @@ -354,7 +354,18 @@ namespace cv { mvFn(NULL, (void*)userData); // Update current position ( in FreeType coordinates ) +#if defined(USING_HB) currentPos.x += mFace->glyph->advance.x; +#else + if (wstr[i] == ' ') + { + currentPos.x += mFace->glyph->advance.x << 1; + } + else + { + currentPos.x += mFace->glyph->advance.x; + } +#endif currentPos.y += mFace->glyph->advance.y; } delete userData; @@ -1036,7 +1047,19 @@ namespace cv { (this->*putPixel)(dst, gPos.y + row, gPos.x + col, _colorUC8n, cl); } } - _org.x += (mFace->glyph->advance.x) >> 6; + +#if defined(USING_HB) + _org.x += (mFace->glyph->advance.x) >> 6; +#else + if (wstr[i] == ' ') + { + _org.x += ((mFace->glyph->advance.x) >> 6) << 1; + } + else + { + _org.x += (mFace->glyph->advance.x) >> 6; + } +#endif _org.y += (mFace->glyph->advance.y) >> 6; }