39 auto strokes = [&](
const wxString& aStr )
41 std::vector<std::unique_ptr<KIFONT::GLYPH>> glyphs;
51 std::pair<double, double>
result( std::numeric_limits<double>::max(), std::numeric_limits<double>::lowest() );
65 std::pair<double, double> last = span( *strokes( aText ).back() );
67 return ( last.first + last.second ) / 2.0 - span( *strokes( wxS(
"H" ) ).front() ).first;
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
virtual VECTOR2I GetTextAsGlyphs(BOX2I *aBBox, std::vector< std::unique_ptr< GLYPH > > *aGlyphs, const wxString &aText, const VECTOR2I &aSize, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle, bool aMirror, const VECTOR2I &aOrigin, TEXT_STYLE_FLAGS aTextStyle) const =0
Convert text string to an array of GLYPHs.
wxString result
Test unit parsing edge cases and error handling.