diff --git a/common/font/outline_font.cpp b/common/font/outline_font.cpp index 638baab88a..497495ed38 100644 --- a/common/font/outline_font.cpp +++ b/common/font/outline_font.cpp @@ -334,9 +334,19 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphs( BOX2I* aBBox, std::vector guard( m_freeTypeMutex ); + + return getTextAsGlyphsUnlocked( aBBox, aGlyphs, aText, aSize, aPosition, aAngle, aMirror, + aOrigin, aTextStyle ); +} + +VECTOR2I OUTLINE_FONT::getTextAsGlyphsUnlocked( BOX2I* aBBox, std::vector>* aGlyphs, + const wxString& aText, const VECTOR2I& aSize, + const VECTOR2I& aPosition, const EDA_ANGLE& aAngle, + bool aMirror, const VECTOR2I& aOrigin, + TEXT_STYLE_FLAGS aTextStyle ) const +{ + VECTOR2D glyphSize = aSize; FT_Face face = m_face; double scaler = faceSize(); @@ -478,7 +488,7 @@ VECTOR2I OUTLINE_FONT::getTextAsGlyphs( BOX2I* aBBox, std::vector> underscoreGlyphs; - getTextAsGlyphs( nullptr, &underscoreGlyphs, wxT( "_" ), aSize, { 0, 0 }, ANGLE_0, false, + getTextAsGlyphsUnlocked( nullptr, &underscoreGlyphs, wxT( "_" ), aSize, { 0, 0 }, ANGLE_0, false, { 0, 0 }, aTextStyle & ~TEXT_STYLE::OVERBAR ); OUTLINE_GLYPH* underscoreGlyph = static_cast( underscoreGlyphs[0].get() ); diff --git a/include/font/outline_font.h b/include/font/outline_font.h index 0ccf703920..d04ce98d28 100644 --- a/include/font/outline_font.h +++ b/include/font/outline_font.h @@ -135,6 +135,12 @@ protected: const VECTOR2I& aPosition, const EDA_ANGLE& aAngle, bool aMirror, const VECTOR2I& aOrigin, TEXT_STYLE_FLAGS aTextStyle ) const; +private: + VECTOR2I getTextAsGlyphsUnlocked( BOX2I* aBoundingBox, std::vector>* aGlyphs, + const wxString& aText, const VECTOR2I& aSize, + const VECTOR2I& aPosition, const EDA_ANGLE& aAngle, bool aMirror, + const VECTOR2I& aOrigin, TEXT_STYLE_FLAGS aTextStyle ) const; + private: // FreeType variables