shrhdk / text-to-svg

Convert text to SVG path without native dependence.
Other
974 stars 131 forks source link

Path overlap #42

Open thesamprice opened 5 years ago

thesamprice commented 5 years ago

Does anyone have any good ideas on how to remove path overlaps? Or recommend a different file format?

From what I gathered ttf files describe character boundaries not paths.

Single line ttfs (often used for laser cutting / cnc programs) overlap their outside, and inside boundaries.

in example using the the cam bam fonts http://www.mrrace.com/CamBam_Fonts/

textToSVG.getD("1", {x: 0, y: 0, fontSize: 10, anchor: "center bottom"})
"M0.25-2L0.25-9.20L-0.78-9.20L0.25-9.20L0.25-2Z"
move 0.25 -2 <- Starting position
line  0.25-2      to 0.25-9.20
line 0.25-9.20  to -0.78-9.20
Reflection point, everything else is the previous in reverse
line -0.78-9.20 to 0.25-9.20
line 0.25-9.20 to 0.25-2

Do otf file formats specify paths rather than character boundaries ?