From 27a5d4bf3e6239ac994e8216a139aa112f45f158 Mon Sep 17 00:00:00 2001 From: Islam Ahmed Date: Fri, 14 Jul 2023 15:50:32 -0700 Subject: [PATCH] Round to 3 decimal places --- src/vf2symbols/write_symbol_from_svgs.py | 2 +- tests/regular_sml_baseline.svg | 2 +- tests/sample_symbol_baseline.svg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vf2symbols/write_symbol_from_svgs.py b/src/vf2symbols/write_symbol_from_svgs.py index 5032681..1ce1c9c 100644 --- a/src/vf2symbols/write_symbol_from_svgs.py +++ b/src/vf2symbols/write_symbol_from_svgs.py @@ -65,7 +65,7 @@ def main(argv): symbol.write_icon( layer_name, svgLib.SVGPath.fromstring(pico.tostring()), - SVGPathPen(None), + SVGPathPen(None, ntos=lambda pt: f'{pt:.3f}'.rstrip('0').rstrip('.')), rect, ) symbol.drop_empty_icons() diff --git a/tests/regular_sml_baseline.svg b/tests/regular_sml_baseline.svg index 7fe3c33..4b0e01e 100644 --- a/tests/regular_sml_baseline.svg +++ b/tests/regular_sml_baseline.svg @@ -9,4 +9,4 @@ text.lanchor { text-anchor: start; } - Weight/Scale VariationsUltralightThinLightRegularMediumSemiboldBoldHeavyBlackTemplate v.1.0SmallMediumLarge \ No newline at end of file + Weight/Scale VariationsUltralightThinLightRegularMediumSemiboldBoldHeavyBlackTemplate v.1.0SmallMediumLarge \ No newline at end of file diff --git a/tests/sample_symbol_baseline.svg b/tests/sample_symbol_baseline.svg index 1905819..cbeac0f 100644 --- a/tests/sample_symbol_baseline.svg +++ b/tests/sample_symbol_baseline.svg @@ -9,4 +9,4 @@ text.lanchor { text-anchor: start; } - Weight/Scale VariationsUltralightThinLightRegularMediumSemiboldBoldHeavyBlackTemplate v.1.0SmallMediumLarge \ No newline at end of file + Weight/Scale VariationsUltralightThinLightRegularMediumSemiboldBoldHeavyBlackTemplate v.1.0SmallMediumLarge \ No newline at end of file