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.
From Master branch.
Fixes #15604
https://gitlab.com/kicad/code/kicad/-/issues/15604
This commit is contained in:
jean-pierre charras 2023-09-09 10:25:22 +02:00
parent 19753719cb
commit 207f2e568b
1 changed files with 6 additions and 0 deletions

View File

@ -160,6 +160,12 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
for( const std::unique_ptr<KIFONT::GLYPH>& 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<KIFONT::OUTLINE_GLYPH*>( glyph.get() );
int outlineCount = outlineGlyph->OutlineCount();
int holeCount = 0;