Split another couple of hairs in the never-ending "how big is a font".
Fixes https://gitlab.com/kicad/code/kicad/issues/13009 Fixes https://gitlab.com/kicad/code/kicad/issues/13115
This commit is contained in:
parent
2a32bc4372
commit
6d73d9a08e
|
@ -287,7 +287,7 @@ VECTOR2I FONT::StringBoundaryLimits( const wxString& aText, const VECTOR2I& aSiz
|
|||
if( IsStroke() )
|
||||
{
|
||||
// Inflate by a bit more than thickness/2 to catch diacriticals, descenders, etc.
|
||||
boundingBox.Inflate( KiROUND( aThickness * 1.5 ) );
|
||||
boundingBox.Inflate( KiROUND( aThickness * 1.25 ) );
|
||||
}
|
||||
else if( IsOutline() )
|
||||
{
|
||||
|
|
|
@ -89,14 +89,14 @@ inline void InferBold( TEXT_ATTRIBUTES* aAttrs )
|
|||
|
||||
|
||||
/**
|
||||
* Returns the margin for knockout text.
|
||||
* Returns the margin for knocking out text.
|
||||
*
|
||||
* Note that this is not a perfect calculation as fonts (especially outline fonts) vary greatly
|
||||
* in how well ascender and descender heights are enforced.
|
||||
*/
|
||||
inline int GetKnockoutTextMargin( const VECTOR2I& aSize, int aThickness )
|
||||
{
|
||||
return std::max( aThickness, KiROUND( aSize.y / 4.0 ) );
|
||||
return std::max( KiROUND( aThickness / 2 ), KiROUND( aSize.y / 7.0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -997,7 +997,7 @@ void PCB_DIM_LEADER::updateGeometry()
|
|||
// Now that we have the text updated, we can determine how to draw the second line
|
||||
// First we need to create an appropriate bounding polygon to collide with
|
||||
BOX2I textBox = m_text.GetTextBox().Inflate( m_text.GetTextWidth() / 2,
|
||||
m_text.GetEffectiveTextPenWidth() * 1.8 );
|
||||
m_text.GetEffectiveTextPenWidth() * 2 );
|
||||
|
||||
SHAPE_POLY_SET polyBox;
|
||||
polyBox.NewOutline();
|
||||
|
|
Loading…
Reference in New Issue