diff --git a/common/font/outline_decomposer.cpp b/common/font/outline_decomposer.cpp index 257a1b13d9..adcff67df4 100644 --- a/common/font/outline_decomposer.cpp +++ b/common/font/outline_decomposer.cpp @@ -160,7 +160,7 @@ bool OUTLINE_DECOMPOSER::approximateQuadraticBezierCurve( GLYPH_POINTS& aR // cp0 = qp0, cp1 = qp0 + 2/3 * (qp1 - qp0), cp2 = qp2 + 2/3 * (qp1 - qp2), cp3 = qp2 GLYPH_POINTS cubic; - cubic.resize( 4 ); + cubic.reserve( 4 ); cubic.push_back( aBezier[0] ); // cp0 cubic.push_back( aBezier[0] + ( ( aBezier[1] - aBezier[0] ) * 2 / 3 ) ); // cp1 diff --git a/common/font/stroke_font.cpp b/common/font/stroke_font.cpp index 6c71ce5b0d..5ac6cd170d 100644 --- a/common/font/stroke_font.cpp +++ b/common/font/stroke_font.cpp @@ -236,13 +236,11 @@ VECTOR2I STROKE_FONT::GetTextAsGlyphs( BOX2I* aBBox, std::vector= (int) m_glyphBoundingBoxes->size() || c < 0 ) + if( c >= (int) m_glyphBoundingBoxes->size() || c < ' ' ) { // Filtering non existing glyphes and non printable chars if( c == '\t' ) c = ' '; - else if( c < ' ' ) // Non printable char - c = '?'; else c = '?'; }