From f2f572c370b7459df7f1b2b5cf928994999ba03b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 9 Sep 2023 10:25:22 +0200 Subject: [PATCH] drc_test_provider_text_dims.cpp: ensure glyphs to test are OUTLINE_GLYPH. For non Kicad font texts with a overbar, the overbar is not a OUTLINE_GLYPH. Fixes #15604 https://gitlab.com/kicad/code/kicad/-/issues/15604 --- pcbnew/drc/drc_test_provider_text_dims.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcbnew/drc/drc_test_provider_text_dims.cpp b/pcbnew/drc/drc_test_provider_text_dims.cpp index 5d0290b618..021d99e567 100644 --- a/pcbnew/drc/drc_test_provider_text_dims.cpp +++ b/pcbnew/drc/drc_test_provider_text_dims.cpp @@ -159,6 +159,12 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run() for( const std::unique_ptr& glyph : *glyphs ) { + // Ensure the glyph is a OUTLINE_GLYPH + // for texts with overbar, it can be a STROKE_GLYPH + // TODO: perhaps test the overbar thickness. + if( !glyph->IsOutline() ) + continue; + auto outlineGlyph = static_cast( glyph.get() ); int outlineCount = outlineGlyph->OutlineCount(); int holeCount = 0;