Skip to content

Commit ce2ada6

Browse files
committed
[segments] refactor distance total string formatting approach
1 parent c986e98 commit ce2ada6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/pathins/segments.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
from .bridge import skia_path_to_ttfont_glyph, ttfont_glyph_to_skia_path
1111
from .datastructures import Coordinate
1212
from .math import linear_distance_between_coordinates
13-
from .stringbuilder import bold_text, report_header, segment_line, segment_quadratic_curve
13+
from .stringbuilder import (
14+
report_header,
15+
segment_line,
16+
segment_quadratic_curve,
17+
segment_total_distance,
18+
)
1419
from .validators import validate_fontpath, validate_glyph_in_font
1520

1621

@@ -147,4 +152,4 @@ def _print_segments(coords: List[Coordinate], nocolor: bool) -> None:
147152
total_distance += distance
148153
print(qcurve_string)
149154

150-
print(f"{os.linesep} {bold_text('Total')}: {round(total_distance, 2): .2f} units")
155+
print(f"{os.linesep} {segment_total_distance(total_distance, nocolor=nocolor)}")

0 commit comments

Comments
 (0)