Expand text bounding boxes a bit for diacriticals, descenders, etc.

Fixes https://gitlab.com/kicad/code/kicad/issues/8551
This commit is contained in:
Jeff Young 2021-06-20 23:22:30 +01:00
parent 685ee31c35
commit fb4343bc8f
1 changed files with 4 additions and 0 deletions

View File

@ -369,6 +369,10 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, bool aInvertY ) const
}
}
// Many fonts draw diacriticals, descenders, etc. outside the X-height of the font. This
// will cacth most (but probably not all) of them.
rect.Inflate( 0, thickness * 1.5 );
rect.Normalize(); // Make h and v sizes always >= 0
return rect;