|
|
|
@ -712,11 +712,13 @@ namespace cv {
|
|
|
|
|
|
|
|
|
|
// If codepoint is space(0x20), it has no glyph.
|
|
|
|
|
// A dummy boundary box is needed when last code is space.
|
|
|
|
|
bool isSpace = false;
|
|
|
|
|
if (
|
|
|
|
|
(bbox.xMin == 0) && (bbox.xMax == 0) &&
|
|
|
|
|
(bbox.yMin == 0) && (bbox.yMax == 0)
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
isSpace = true;
|
|
|
|
|
bbox.xMin = currentPos.x;
|
|
|
|
|
bbox.xMax = currentPos.x + ((mFace->glyph->advance.x << 1) + mFace->glyph->metrics.horiBearingX);
|
|
|
|
|
bbox.yMin = yMin;
|
|
|
|
@ -724,7 +726,7 @@ namespace cv {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update current position ( in FreeType coordinates )
|
|
|
|
|
currentPos.x += mFace->glyph->advance.x;
|
|
|
|
|
currentPos.x += isSpace ? (mFace->glyph->advance.x << 1) : mFace->glyph->advance.x;
|
|
|
|
|
currentPos.y += mFace->glyph->advance.y;
|
|
|
|
|
|
|
|
|
|
// Update BoundaryBox ( in OpenCV coordinates )
|
|
|
|
|