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
This commit is contained in:
jean-pierre charras 2023-09-09 10:25:22 +02:00
parent b4c5d46825
commit f2f572c370
1 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,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;