|
|
@ -435,7 +435,7 @@ namespace cv {
|
|
|
|
|
|
|
|
|
|
|
|
CV_Assert(!FT_Load_Glyph(mFace, FT_Get_Char_Index(mFace, wstr[i]), FT_LOAD_RENDER));
|
|
|
|
CV_Assert(!FT_Load_Glyph(mFace, FT_Get_Char_Index(mFace, wstr[i]), FT_LOAD_RENDER));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
FT_GlyphSlot slot = mFace->glyph;
|
|
|
|
FT_GlyphSlot slot = mFace->glyph;
|
|
|
|
|
|
|
|
|
|
|
|
FT_Glyph glyph = NULL;
|
|
|
|
FT_Glyph glyph = NULL;
|
|
|
|
int error = FT_Get_Glyph(mFace->glyph, &glyph);
|
|
|
|
int error = FT_Get_Glyph(mFace->glyph, &glyph);
|
|
|
@ -605,7 +605,14 @@ namespace cv {
|
|
|
|
// Update current position ( in FreeType coordinates )
|
|
|
|
// Update current position ( in FreeType coordinates )
|
|
|
|
|
|
|
|
|
|
|
|
// float advance = mFace->glyph->advance.x >> 6;
|
|
|
|
// float advance = mFace->glyph->advance.x >> 6;
|
|
|
|
currentPos.x += mFace->glyph->advance.x;
|
|
|
|
if (wstr[i] == ' ')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
currentPos.x += mFace->glyph->advance.x << 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
currentPos.x += mFace->glyph->advance.x;
|
|
|
|
|
|
|
|
}
|
|
|
|
currentPos.y += mFace->glyph->advance.y;
|
|
|
|
currentPos.y += mFace->glyph->advance.y;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -711,7 +718,7 @@ namespace cv {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bbox.xMin = currentPos.x;
|
|
|
|
bbox.xMin = currentPos.x;
|
|
|
|
bbox.xMax = currentPos.x + (mFace->glyph->advance.x + mFace->glyph->metrics.horiBearingX);
|
|
|
|
bbox.xMax = currentPos.x + ((mFace->glyph->advance.x << 1) + mFace->glyph->metrics.horiBearingX);
|
|
|
|
bbox.yMin = yMin;
|
|
|
|
bbox.yMin = yMin;
|
|
|
|
bbox.yMax = yMax;
|
|
|
|
bbox.yMax = yMax;
|
|
|
|
}
|
|
|
|
}
|
|
|
|