Print fonts as polygons, not triangles

Similar to plotting, print engines are probably happier dealing with
filled polygons than hundreds of triangles
This commit is contained in:
Seth Hillbrand 2022-01-14 09:17:57 -08:00
parent bc77a1e2dd
commit 728ca8265f
1 changed files with 3 additions and 4 deletions

View File

@ -153,11 +153,10 @@ void GRPrintText( wxDC* aDC, const VECTOR2I& aPos, const COLOR4D& aColor, const
else
GRCSegm( nullptr, aDC, aPt1.x, aPt1.y, aPt2.x, aPt2.y, aWidth, 0, aColor );
},
// Triangulation callback
[&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2, const VECTOR2I& aPt3 )
// Polygon callback
[&]( const SHAPE_LINE_CHAIN& aPoly )
{
VECTOR2I pts[3] = { aPt1, aPt2, aPt3 };
GRClosedPoly( nullptr, aDC, 3, pts, true, 0, aColor, aColor );
GRClosedPoly( nullptr, aDC, aPoly.PointCount(), aPoly.CPoints().data(), true, aColor, aColor );
} );
TEXT_ATTRIBUTES attributes;