Plot fonts in outline mode, not triangulated

Putting 1,000s of tiny triangles on a gerber file will cause mfg fits.
Instead, we use easy outline plotting for plots and triangulation for
everything else.
This commit is contained in:
Seth Hillbrand
2022-01-13 17:04:14 -08:00
parent 33a4c9b08e
commit e7d0318fb2
3 changed files with 36 additions and 12 deletions
+15 -2
View File
@@ -44,9 +44,22 @@ void CALLBACK_GAL::DrawGlyph( const KIFONT::GLYPH& aGlyph, int aNth, int aTotal
}
else if( aGlyph.IsOutline() )
{
const KIFONT::OUTLINE_GLYPH& glyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
if( m_triangulate )
{
const KIFONT::OUTLINE_GLYPH& glyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
glyph.Triangulate( m_triangleCallback );
glyph.Triangulate( m_triangleCallback );
}
else
{
KIFONT::OUTLINE_GLYPH glyph = static_cast<const KIFONT::OUTLINE_GLYPH&>( aGlyph );
if( glyph.HasHoles() )
glyph.Fracture( SHAPE_POLY_SET::POLYGON_MODE::PM_FAST );
for( int ii = 0; ii < glyph.OutlineCount(); ++ii )
m_outlineCallback( glyph.Outline( ii ) );
}
}
}