Skip to content

Commit

Permalink
[segments] refactor distance total string formatting approach
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimpkins committed Oct 9, 2020
1 parent c986e98 commit ce2ada6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/pathins/segments.py
Expand Up @@ -10,7 +10,12 @@
from .bridge import skia_path_to_ttfont_glyph, ttfont_glyph_to_skia_path
from .datastructures import Coordinate
from .math import linear_distance_between_coordinates
from .stringbuilder import bold_text, report_header, segment_line, segment_quadratic_curve
from .stringbuilder import (
report_header,
segment_line,
segment_quadratic_curve,
segment_total_distance,
)
from .validators import validate_fontpath, validate_glyph_in_font


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

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

0 comments on commit ce2ada6

Please sign in to comment.