Skip to content

Commit

Permalink
Merge pull request #239 from ChrisClems/master
Browse files Browse the repository at this point in the history
Remove newline character for Text export
  • Loading branch information
dsn27 authored Jan 29, 2025
2 parents e43f199 + 1cc3332 commit 631cce3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CADability/ExportDxf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,12 @@ private void CollectMeshByColor(Dictionary<int, (List<Vector3>, List<short[]>)>
}
private netDxf.Entities.Text ExportText(GeoObject.Text text)
{
var textStringValue = text.TextString.Replace("\r\n", " ");
System.Drawing.FontStyle fs = System.Drawing.FontStyle.Regular;
if (text.Bold) fs |= System.Drawing.FontStyle.Bold;
if (text.Italic) fs |= System.Drawing.FontStyle.Italic;
System.Drawing.Font font = new System.Drawing.Font(text.Font, 1000.0f, fs);
netDxf.Entities.Text res = new netDxf.Entities.Text(text.TextString, Vector2.Zero, text.TextSize * 1000 / font.Height, new TextStyle(text.Font, text.Font + ".ttf"));
netDxf.Entities.Text res = new netDxf.Entities.Text(textStringValue, Vector2.Zero, text.TextSize * 1000 / font.Height, new TextStyle(text.Font, text.Font + ".ttf"));
ModOp toText = ModOp.Fit(GeoPoint.Origin, new GeoVector[] { GeoVector.XAxis, GeoVector.YAxis, GeoVector.ZAxis }, text.Location, new GeoVector[] { text.LineDirection.Normalized, text.GlyphDirection.Normalized, text.LineDirection.Normalized ^ text.GlyphDirection.Normalized });
res.TransformBy(Matrix4(toText)); // easier than setting normal and rotation
return res;
Expand Down

0 comments on commit 631cce3

Please sign in to comment.