Make stroke font bbox calculation consistent with rendering

When rendering tabs we count them as 4 + 1 space but when calculating
bbox it is 4 spaces + '?' width, which is a bit wider.
This commit is contained in:
qu1ck 2019-11-11 17:25:24 -08:00 committed by Seth Hillbrand
parent ed77f522dd
commit 695caa7dfa
1 changed files with 4 additions and 1 deletions

View File

@ -577,7 +577,10 @@ VECTOR2D STROKE_FONT::ComputeStringBoundaryLimits( const UTF8& aText, const VECT
int dd = (signed) *it - ' ';
if( dd >= (int) m_glyphBoundingBoxes.size() || dd < 0 )
dd = '?' - ' ';
{
int substitute = *it == '\t' ? ' ' : '?';
dd = substitute - ' ';
}
const BOX2D& box = m_glyphBoundingBoxes[dd];
curX += box.GetEnd().x * curScale;