From fb4343bc8fb2e1c23f7eb83d4ac4d552f6cab9c5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 20 Jun 2021 23:22:30 +0100 Subject: [PATCH] Expand text bounding boxes a bit for diacriticals, descenders, etc. Fixes https://gitlab.com/kicad/code/kicad/issues/8551 --- common/eda_text.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/eda_text.cpp b/common/eda_text.cpp index ae12919f38..60e3d28589 100644 --- a/common/eda_text.cpp +++ b/common/eda_text.cpp @@ -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;