diff --git a/examples/awesome.svg b/examples/awesome.svg
index 47a2144..a4bfbaa 100644
--- a/examples/awesome.svg
+++ b/examples/awesome.svg
@@ -1,5 +1,4 @@
\ No newline at end of file
+.background {fill: #002b36}]]>nico ~ $ nico ~ $ t nico ~ $ te nico ~ $ ter nico ~ $ term nico ~ $ termt nico ~ $ termto nico ~ $ termtos nico ~ $ termtosv nico ~ $ termtosvg nico ~ $ f nico ~ $ fo nico ~ $ for nico ~ $ for nico ~ $ for i nico ~ $ for i nico ~ $ for i i nico ~ $ for i in nico ~ $ for i in nico ~ $ for i in { nico ~ $ for i in {0 nico ~ $ for i in {0. nico ~ $ for i in {0.. nico ~ $ for i in {0..1 nico ~ $ for i in {0..10 nico ~ $ for i in {0..10} nico ~ $ for i in {0..10}; nico ~ $ for i in {0..10}; nico ~ $ for i in {0..10}; d nico ~ $ for i in {0..10}; do > > e > ec > ech > echo > echo > echo " > echo "t > echo "te > echo "ter > echo "term > echo "termt > echo "termto > echo "termtos > echo "termtosv > echo "termtosvg > echo "termtosvg > echo "termtosvg i > echo "termtosvg is > echo "termtosvg is > echo "termtosvg is a > echo "termtosvg is aw > echo "termtosvg is awe > echo "termtosvg is awes > echo "termtosvg is aweso > echo "termtosvg is awesom > echo "termtosvg is awesome > echo "termtosvg is awesome! > echo "termtosvg is awesome!" > d > do > don > done > done > done | > done | > done | l > done | lo > done | lol > done | lolc > done | lolca > done | lolcat term termtosvg is awes termtosvg is aweso termtosvg is awe nico ~ $ termtosvgRecording started, enter "exit" command or Control-D to endnico ~ $ for i in {0..10}; do> echo "termtosvg is awesome!"> done | lolcattermtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is awesome!termtosvg is nico ~ $ e nico ~ $ ex nico ~ $ exi nico ~ $ exit termtosvg is awesome!termtosvg is awesome!nico ~ $ exitexitRecording ended, SVG animation is /tmp/termtosvg__20rwx67.svg
\ No newline at end of file
diff --git a/examples/casts/awesome.cast b/examples/casts/awesome.cast
index ad43fad..0cd4df1 100644
--- a/examples/casts/awesome.cast
+++ b/examples/casts/awesome.cast
@@ -1,5 +1,5 @@
{"version": 2, "width": 82, "height": 19, "theme": {"fg": "#839496", "bg": "#002b36", "palette": "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"}}
-[0.0, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[0.0, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[0.390644, "o", "t"]
[0.534149, "o", "e"]
[0.60612, "o", "r"]
@@ -11,7 +11,7 @@
[1.845896, "o", "g"]
[2.045981, "o", "\r\n"]
[2.31268, "o", "Recording started, enter \"exit\" command or Control-D to end\r\n"]
-[2.335253, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[2.335253, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[2.919678, "o", "f"]
[3.057802, "o", "o"]
[3.156814, "o", "r"]
@@ -84,12 +84,12 @@
[19.312437, "o", "\u001b[39m\u001b[38;5;44mo\u001b[39m"]
[19.314078, "o", "\u001b[38;5;44mm\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44m!\u001b[39m\u001b[38;5;44m\u001b[39m\r\n\u001b[38;5;33mt\u001b[39m\u001b[38;5;33me\u001b[39m\u001b[38;5;39mr\u001b[39m\u001b[38;5;39mm\u001b[39m\u001b[38;5;39mt\u001b[39m\u001b[38;5;39mo\u001b[39m\u001b[38;5;39ms\u001b[39m\u001b[38;5;39mv\u001b[39m\u001b[38;5;39mg\u001b[39m\u001b[38;5;39m \u001b[39m\u001b[38;5;39mi\u001b[39m\u001b[38;5;38ms\u001b[39m\u001b[38;5;38m \u001b[39m\u001b[38;5;44ma\u001b[39m\u001b[38;5;44mw\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44mo\u001b[39m\u001b[38;5;44mm\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44m!\u001b[39m\u001b[38;5;44m\u001b[39m\r\n\u001b[38;5;39mt\u001b[39m\u001b[38;5;39me\u001b[39m\u001b[38;5;39mr\u001b[39m\u001b[38;5;39mm\u001b[39m\u001b[38;5;39mt\u001b[39m\u001b[38;5;39mo\u001b[39m\u001b[38;5;39ms\u001b[39m\u001b[38;5;39mv\u001b[39m\u001b[38;5;38mg\u001b[39m\u001b[38;5;38m \u001b[39m\u001b[38;5;44mi\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44m \u001b[39m\u001b[38;5;44ma\u001b[39m\u001b[38;5;44mw\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44mo\u001b[39m\u001b[38;5;44mm\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;43m!\u001b[39m\u001b[38;5;49m\u001b[39m\r\n\u001b[38;5;39mt\u001b[39m\u001b[38;5;39me\u001b[39m\u001b[38;5;39mr\u001b[39m\u001b[38;5;39mm\u001b[39m\u001b[38;5;39mt\u001b[39m\u001b[38;5;38mo\u001b[39m\u001b[38;5;38ms\u001b[39m\u001b[38;5;44mv\u001b[39m\u001b[38;5;44mg\u001b[39m\u001b[38;5;44m \u001b[39m\u001b[38;5;44mi\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44m \u001b[39m\u001b[38;5;44ma\u001b[39m\u001b[38;5;44mw\u001b[39m\u001b[38;5;44me\u001b["]
[19.31967, "o", "39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;43mo\u001b[39m\u001b[38;5;49mm\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49m!\u001b[39m\u001b[38;5;49m\u001b[39m\r\n\u001b[38;5;39mt\u001b[39m\u001b[38;5;39me\u001b[39m\u001b[38;5;38mr\u001b[39m\u001b[38;5;38mm\u001b[39m\u001b[38;5;44mt\u001b[39m\u001b[38;5;44mo\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44mv\u001b[39m\u001b[38;5;44mg\u001b[39m\u001b[38;5;44m \u001b[39m\u001b[38;5;44mi\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44m \u001b[39m\u001b[38;5;44ma\u001b[39m\u001b[38;5;43mw\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49mo\u001b[39m\u001b[38;5;49mm\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49m!\u001b[39m\u001b[38;5;49m\u001b[39m\r\n\u001b[38;5;38mt\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44mr\u001b[39m\u001b[38;5;44mm\u001b[39m\u001b[38;5;44mt\u001b[39m\u001b[38;5;44mo\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44mv\u001b[39m\u001b[38;5;44mg\u001b[39m\u001b[38;5;44m \u001b[39m\u001b[38;5;44mi\u001b[39m\u001b[38;5;43ms\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49ma\u001b[39m\u001b[38;5;49mw\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49mo\u001b[39m\u001b[38;5;49mm\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49m!\u001b[39m\u001b[38;5;49m\u001b[39m\r\n\u001b[38;5;44mt\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44mr\u001b[39m\u001b[38;5;44mm\u001b[39m\u001b[38;5;44mt\u001b[39m\u001b[38;5;44mo\u001b[39m\u001b[38;5;44ms\u001b[39m\u001b[38;5;44mv\u001b[39m\u001b[38;5;43mg\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49mi\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49m"]
-[19.323298, "o", "a\u001b[39m\u001b[38;5;49mw\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49mo\u001b[39m\u001b[38;5;49mm\u001b[39m\u001b[38;5;48me\u001b[39m\u001b[38;5;48m!\u001b[39m\u001b[38;5;48m\u001b[39m\r\n\u001b[38;5;44mt\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44mr\u001b[39m\u001b[38;5;44mm\u001b[39m\u001b[38;5;44mt\u001b[39m\u001b[38;5;43mo\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49mv\u001b[39m\u001b[38;5;49mg\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49mi\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49ma\u001b[39m\u001b[38;5;49mw\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;48ms\u001b[39m\u001b[38;5;48mo\u001b[39m\u001b[38;5;48mm\u001b[39m\u001b[38;5;48me\u001b[39m\u001b[38;5;48m!\u001b[39m\u001b[38;5;48m\u001b[39m\r\n\u001b[m\u001b[?25h\u001b[?1;5;2004l\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[19.323298, "o", "a\u001b[39m\u001b[38;5;49mw\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49mo\u001b[39m\u001b[38;5;49mm\u001b[39m\u001b[38;5;48me\u001b[39m\u001b[38;5;48m!\u001b[39m\u001b[38;5;48m\u001b[39m\r\n\u001b[38;5;44mt\u001b[39m\u001b[38;5;44me\u001b[39m\u001b[38;5;44mr\u001b[39m\u001b[38;5;44mm\u001b[39m\u001b[38;5;44mt\u001b[39m\u001b[38;5;43mo\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49mv\u001b[39m\u001b[38;5;49mg\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49mi\u001b[39m\u001b[38;5;49ms\u001b[39m\u001b[38;5;49m \u001b[39m\u001b[38;5;49ma\u001b[39m\u001b[38;5;49mw\u001b[39m\u001b[38;5;49me\u001b[39m\u001b[38;5;48ms\u001b[39m\u001b[38;5;48mo\u001b[39m\u001b[38;5;48mm\u001b[39m\u001b[38;5;48me\u001b[39m\u001b[38;5;48m!\u001b[39m\u001b[38;5;48m\u001b[39m\r\n\u001b[m\u001b[?25h\u001b[?1;5;2004l\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[22.490234, "o", "e"]
[22.737309, "o", "x"]
[22.889771, "o", "i"]
[23.009438, "o", "t"]
[23.761836, "o", "\r\nexit\r\n"]
[23.836601, "o", "Recording ended, SVG animation is /tmp/termtosvg__20rwx67.svg\r\n"]
-[23.836602, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[23.836602, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[26.349826, "o", ""]
diff --git a/examples/casts/colors.cast b/examples/casts/colors.cast
index d4eb664..fd54a02 100644
--- a/examples/casts/colors.cast
+++ b/examples/casts/colors.cast
@@ -1,5 +1,5 @@
{"version": 2, "width": 82, "height": 19, "theme": {"fg": "#839496", "bg": "#002b36", "palette": "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"}}
-[0.0, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[0.0, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[1.226717, "o", "~"]
[1.642848, "o", "/"]
[1.786827, "o", "s"]
@@ -108,7 +108,7 @@
[5.709857, "o", "\u001b[48;5;240m \u001b[0m\u001b[48;5;241m \u001b[0m\u001b[48;5;242m \u001b[0m\u001b[48;5;243m \u001b[0m\u001b[48;5;244m \u001b[0m\u001b[48;5;245m \u001b[0m\u001b[48;5;246m \u001b[0m\u001b[48;5;247m \u001b[0m\u001b[48;5;248m \u001b[0m\u001b[48;5;249m \u001b[0m\u001b[48;5;250m \u001b[0m"]
[5.709923, "o", "\u001b[48;5;251m \u001b[0m\u001b[48;5;252m \u001b[0m\u001b[48;5;253m \u001b[0m\u001b[48;5;254m \u001b[0m\u001b[48;5;255m \u001b[0m"]
[5.709965, "o", "\r\n\r\n"]
-[5.710217, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[5.710217, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[7.618975, "o", "~"]
[7.938859, "o", "/"]
[8.066321, "o", "s"]
@@ -143,7 +143,7 @@
[13.592818, "o", "\u001b[48;2;20;40;234m\u001b[38;2;234;214;20m \u001b[0m\u001b[48;2;16;33;238m\u001b[38;2;238;221;16m \u001b[0m\u001b[48;2;13;26;241m\u001b[38;2;241;228;13m \u001b[0m"]
[13.592858, "o", "\u001b[48;2;10;20;244m\u001b[38;2;244;234;10m \u001b[0m\u001b[48;2;6;13;248m\u001b[38;2;248;241;6m \u001b[0m\u001b[48;2;3;6;251m\u001b[38;2;251;248;3m \u001b[0m\u001b[48;2;0;0;255m\u001b[38;2;255;255;0m \u001b[0m"]
[13.592898, "o", "\r\n"]
-[13.593518, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[13.593518, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[15.354717, "o", "t"]
[15.482695, "o", "e"]
[15.546875, "o", "r"]
@@ -565,7 +565,7 @@
[22.190496, "o", "\u001b[38;5;184ml\u001b[39m\u001b[38;5;184mp\u001b[39m"]
[22.190557, "o", "\u001b[38;5;178m'\u001b[39m\u001b[38;5;214m\u001b[39m\r\n"]
[22.191482, "o", "\u001b[m\u001b[?25h\u001b[?1;5;2004l"]
-[22.196526, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[22.196526, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[24.786606, "o", "e"]
[24.986799, "o", "x"]
[25.090796, "o", "i"]
diff --git a/examples/casts/htop.cast b/examples/casts/htop.cast
index 82d36e9..3f00a37 100644
--- a/examples/casts/htop.cast
+++ b/examples/casts/htop.cast
@@ -1,5 +1,5 @@
{"version": 2, "width": 82, "height": 19, "theme": {"fg": "#839496", "bg": "#002b36", "palette": "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"}}
-[0.0, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[0.0, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[1.560565, "o", "h"]
[1.640251, "o", "t"]
[1.720707, "o", "o"]
@@ -60,7 +60,7 @@
[13.464868, "o", "\u001b[4;57H\u001b[0;1m\u000f\u001b[36m1\r\u001b[14d\u001b[39m\u001b[m\u000f27173 nico 20 0 \u001b[36m16\u001b[39m\u001b[m\u000f244 \u001b[36m 4\u001b[39m\u001b[m\u000f080 \u001b[36m 3\u001b[39m\u001b[m\u000f364 S 0.0 0.1 0:00.08 \u001b[36m│ │ └─ \u001b[39m\u001b[m\u000fbash \u001b[15;1H\u001b[30m\u001b[46m29180 nico 20 0 104M 26720 8640 S 0.0 0.3 0:00.28 │ │ └─ pyth\u001b[1;1H\u001b[39;49m\u001b[m\u000f"]
[14.980874, "o", "\u001b[2;10H \u001b[2;34H5.0\u001b[2;53H\u001b[0;1m\u000f\u001b[32m2\u001b[3;8H\u001b[0m\u000f\u001b[31m|\u001b[39m\u001b[m\u000f \u001b[3;34H5.4\u001b[4;8H\u001b[32m||\u001b[31m|\u001b[4;33H\u001b[39m\u001b[m\u000f10.8\u001b[4;57H\u001b[0;1m\u000f\u001b[36m2\u001b[5;8H\u001b[0m\u000f\u001b[32m|\u001b[5;36H\u001b[39m\u001b[m\u000f0\u001b[17;48H8\u001b[17;62H4\u001b[H"]
[15.648421, "o", "\u001b[19d\u001b[J\u001b[34h\u001b[?25h\u001b[?1000l\u001b[19;1H\u001b[?1049l\r\u001b[?1l\u001b>"]
-[15.648984, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[15.648984, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[16.664419, "o", "e"]
[16.960091, "o", "x"]
[17.112119, "o", "i"]
diff --git a/examples/casts/ipython.cast b/examples/casts/ipython.cast
index 5160f97..6cc36b5 100644
--- a/examples/casts/ipython.cast
+++ b/examples/casts/ipython.cast
@@ -1,5 +1,5 @@
{"version": 2, "width": 82, "height": 19, "theme": {"fg": "#839496", "bg": "#002b36", "palette": "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"}}
-[0.0, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[0.0, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[0.921472, "o", "i"]
[1.073422, "o", "p"]
[1.31298, "o", "y"]
@@ -158,7 +158,7 @@
[34.020075, "o", "\u001b[?25l\u001b[?7l\u001b[0mt\u001b[?7h\u001b[0m\u001b[?12l\u001b[?25h"]
[34.196083, "o", "\u001b[?25l\u001b[?7l\u001b[12D\u001b[0m\u001b[J\u001b[0;38;5;28mIn [\u001b[0;38;5;10;1m3\u001b[0;38;5;28m]: \u001b[0mexit\u001b[12D\u001b[0m\r\r\n\u001b[J\u001b[?7h\u001b[0m\u001b[?12l\u001b[?25h"]
[34.196286, "o", "\u001b[?2004l"]
-[34.282302, "o", "\u001b[1;31mnico \u001b[0;34m~\u001b[1;31m $ \u001b[0m"]
+[34.282302, "o", "\u001b[0;31mnico \u001b[0;34m~\u001b[0;31m $ \u001b[0m"]
[34.673114, "o", "e"]
[34.753043, "o", "x"]
[34.960957, "o", "i"]
diff --git a/examples/casts/unittest.cast b/examples/casts/unittest.cast
index b2fb50a..c6fa3ea 100644
--- a/examples/casts/unittest.cast
+++ b/examples/casts/unittest.cast
@@ -1,5 +1,5 @@
{"version": 2, "width": 82, "height": 19, "theme": {"fg": "#839496", "bg": "#002b36", "palette": "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"}}
-[0.0, "o", "\u001b[1;31mnico \u001b[0;34m~/termtosvg\u001b[1;31m $ \u001b[0m"]
+[0.0, "o", "\u001b[0;31mnico \u001b[0;34m~/termtosvg\u001b[0;31m $ \u001b[0m"]
[0.891279, "o", "m"]
[1.003135, "o", "a"]
[1.115415, "o", "k"]
@@ -105,7 +105,7 @@
[11.542392, "o", "ok\r\n"]
[11.542649, "o", "\r\n----------------------------------------------------------------------\r\nRan 18 tests in 5.164s\r\n\r\nOK\r\n"]
[11.767437, "o", "Name Stmts Miss Branch BrPart Cover\r\n----------------------------------------------------------\r\ntermtosvg/__init__.py 0 0 0 0 100%\r\ntermtosvg/__main__.py 106 4 38 4 94%\r\ntermtosvg/anim.py 146 3 60 3 97%\r\ntermtosvg/asciicast.py 93 6 38 3 93%\r\ntermtosvg/term.py 192 13 66 8 91%\r\n----------------------------------------------------------\r\nTOTAL 537 26 202 18 94%\r\n"]
-[11.981343, "o", "\u001b[1;31mnico \u001b[0;34m~/termtosvg\u001b[1;31m $ \u001b[0m"]
+[11.981343, "o", "\u001b[0;31mnico \u001b[0;34m~/termtosvg\u001b[0;31m $ \u001b[0m"]
[15.49189, "o", "e"]
[15.68319, "o", "x"]
[15.842958, "o", "i"]
diff --git a/examples/colors.svg b/examples/colors.svg
index d405e43..9d5ab3e 100644
--- a/examples/colors.svg
+++ b/examples/colors.svg
@@ -1,5 +1,4 @@
\ No newline at end of file
+.background {fill: #002b36}]]>nico ~ $ nico ~ $ ~ nico ~ $ ~/ nico ~ $ ~/s nico ~ $ ~/sc nico ~ $ ~/scr nico ~ $ ~/scri nico ~ $ ~/scrip nico ~ $ ~/scripts/ nico ~ $ ~/scripts/c nico ~ $ ~/scripts/co nico ~ $ ~/scripts/col nico ~ $ ~/scripts/colo nico ~ $ ~/scripts/colors nico ~ $ ~/scripts/colors_ nico ~ $ ~/scripts/colors_2 nico ~ $ ~/scripts/colors_25 nico ~ $ ~/scripts/colors_256 nico ~ $ ~/scripts/colors_256.sh nico ~ $ ~/scripts/t nico ~ $ ~/scripts/tr nico ~ $ ~/scripts/tru nico ~ $ ~/scripts/true_colors. nico ~ $ ~/scripts/true_colors.s nico ~ $ ~/scripts/true_colors.sh nico ~ $ ~/scripts/true_colors.sh nico ~ $ t nico ~ $ te nico ~ $ ter nico ~ $ term nico ~ $ termm nico ~ $ termmt nico ~ $ termm nico ~ $ term nico ~ $ termt nico ~ $ termtosvg nico ~ $ termtosvg nico ~ $ termtosvg - nico ~ $ termtosvg -- nico ~ $ termtosvg --h nico ~ $ termtosvg --he nico ~ $ termtosvg --hel nico ~ $ termtosvg --help nico ~ $ termtosvg --help nico ~ $ termtosvg --help | nico ~ $ termtosvg --help | nico ~ $ termtosvg --help | l nico ~ $ termtosvg --help | lo nico ~ $ termtosvg --help | loc nico ~ $ termtosvg --help | locl nico ~ $ termtosvg --help | lol nico ~ $ termtosvg --help | lolc nico ~ $ termtosvg --help | lolca nico ~ $ termtosvg --help | lolcat usage: termtosvg [output_file] [-- nico ~ $ ~/scripts/colors_256.sh nico ~ $ ~/scripts/true_colors.sh nico ~ $ termtosvg --help | lolcat usage: termtosvg [output_file] [--theme THEME] [--help Record a ter usage: termtosvg [output_file] [--theme THEME] [--help] [--verbose]Record a terminal session and render an SVG anim Record a terminal session and render an SVG animation on the flypositional output_file optiona positional arguments: output_file optional filename of the SVG animation; if missi output_file optional filename of the SVG animation; if missing, a random filename will be automatically gene filename will be automatically generatedoptional arguments: -h, --help show this help -h, --help show this help message and exit --theme THEME color theme used to render the te classic-dark, clas --theme THEME color theme used to render the terminal session (circus, classic-dark, classic-light, dracula, material, monokai, solari classic-dark, classic-light, dracula, isotope, marrakesh, material, monokai, solarized-dark, solarized-light, zenburn) material, monokai, solarized-dark, solarized-light, zenburn) -v, --verbose increase log mess See also 'termtosvg re -v, --verbose increase log messages verbositySee also 'termtosvg record --help' and 'termtosvg See also 'termtosvg record --help' and 'termtosvg render --help'nico ~ $ e nico ~ $ ex nico ~ $ exi nico ~ $ exit nico ~ $ exitexit
\ No newline at end of file
diff --git a/examples/htop.svg b/examples/htop.svg
index 4edb7c7..94bcf1c 100644
--- a/examples/htop.svg
+++ b/examples/htop.svg
@@ -1,5 +1,4 @@
\ No newline at end of file
+.background {fill: #002b36}]]>nico ~ $ nico ~ $ h nico ~ $ ht nico ~ $ hto nico ~ $ htop nico ~ $ htop nico ~ $ htop 1 [|||||||||||||||||||||||||100.0%] Tasks: 39; 1 running2 [0.0%] Load average: 0.33 0.32 0.30 3 [0.0%] Uptime: 09:45:004 [0.0%]29184 nico20 0 21412 4192 3420 R 160. 0.1 0:00.04 │ │ └ 1 root 20 0 229M 8792 6896 S 0.0 0.1 0:06.21 init 23027 nico20 0 30252 5040 3096 S 0.0 0.1 0:02.17 ├─ tmux23027 nico 20 0 30252 5040 3096 S 0.0 0.1 0:02.17 ├─ tmux 27104 nico20 0 16256 4132 3388 S 0.0 0.1 0:00.01 │ ├─ -bash3 [|||5.3%] Uptime: 09:45:0227104 nico 20 0 16256 4132 3388 S 0.0 0.1 0:00.01 │ ├─ -bash 27170 nico20 0 104M 26948 8816 S 0.0 0.3 0:00.86 │ │ └─ python /us27170 nico 20 0 104M 26948 8816 S 0.0 0.3 0:00.86 │ │ └─ python /us27173 nico20 0 16244 4080 3364 S 0.0 0.1 0:00.08 │ │ └─ bash2 [|||7.4%] Load average: 0.33 0.32 0.30 27173 nico 20 0 16244 4080 3364 S 0.0 0.1 0:00.08 │ │ └─ bash 29180 nico20 0 104M 26700 8640 S 0.0 0.3 0:00.27 │ │ └─ pyth29180 nico 20 0 104M 26700 8640 S 0.0 0.3 0:00.27 │ │ └─ pyth29183 nico20 0 16124 3740 3264 S 0.0 0.0 0:00.00 │ │ └─ b29183 nico 20 0 16124 3740 3264 S 0.0 0.0 0:00.00 │ │ └─ b29184 nico20 0 21412 4192 3420 R 0.7 0.1 0:00.05 │ │ └ 1 [|||| 6.5%] Tasks: 39; 1 running2 [|||7.4%] Load average: 0.31 0.32 0.30 3 [|||5.3%] Uptime: 09:45:034 [||5.3%]27170 nico 20 0 104M 26948 8816 S 0.0 0.3 0:00.86 │ │ └─ python /us29184 nico 20 0 21412 4192 3420 R 0.7 0.1 0:00.05 │ │ └23028 nico20 0 16256 4060 3308 S 0.0 0.1 0:00.24 │ └─ -bash 1 [|| 6.0%] Tasks: 39; 1 running2 [|||6.5%] Load average: 0.31 0.32 0.30 3 [|||8.4%] Uptime: 09:45:034 [|||6.4%]Mem[||||||||||||||||| 2.45G/7.74G]Swp[0K/0K] PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 1 root 20 0 229M 8792 6896 S 0.0 0.1 0:06.21 init 23027 nico 20 0 30252 5040 3096 S 0.0 0.1 0:02.17 ├─ tmux 27104 nico 20 0 16256 4132 3388 S 0.0 0.1 0:00.01 │ ├─ -bash 27170 nico 20 0 104M 26948 8816 S 0.6 0.3 0:00.87 │ │ └─ python /us27173 nico 20 0 16244 4080 3364 S 0.0 0.1 0:00.08 │ │ └─ bash 29180 nico 20 0 104M 26700 8640 S 0.0 0.3 0:00.27 │ │ └─ pyth29183 nico 20 0 16124 3740 3264 S 0.0 0.0 0:00.00 │ │ └─ b29184 nico 20 0 21412 4192 3420 R 0.6 0.1 0:00.06 │ │ └23028 nico 20 0 16256 4060 3308 S 0.0 0.1 0:00.24 │ └─ -bash F1Help F2Setup F3SearchF4FilterF5SortedF6CollapF7Nice -F8Nice +F9Kill F10Quit 3 [|||8.4%] Uptime: 09:45:0423028 nico 20 0 16256 4060 3308 S 0.0 0.1 0:00.24 │ └─ -bash 27086 nico 20 0 180M 16268 12144 S 0.0 0.2 0:00.02 │ └─ vim termto27086 nico 20 0 180M 16268 12144 S 0.0 0.2 0:00.02 │ └─ vim termto 759 nico 20 0 164M 37300 18668 S 1.2 0.5 6:56.44 ├─ compton -b 759 nico 20 0 164M 37300 18668 S 1.2 0.5 6:56.44 ├─ compton -b 710 nico 20 0 79188 7880 6668 S 0.0 0.1 0:00.01 ├─ systemd --user 710 nico 20 0 79188 7880 6668 S 0.0 0.1 0:00.01 ├─ systemd --user 3225 nico 20 0 180M 4892 4364 S 0.0 0.1 0:00.00 │ ├─ dconf-service 3225 nico 20 0 180M 4892 4364 S 0.0 0.1 0:00.00 │ ├─ dconf-service 818 nico 20 0 336M 5104 4512 S 0.0 0.1 0:00.00 │ ├─ at-spi-bus-la3 [|||8.4%] Uptime: 09:45:05 818 nico 20 0 336M 5104 4512 S 0.0 0.1 0:00.00 │ ├─ at-spi-bus-la 807 nico 20 0 32420 3212 2928 S 0.0 0.0 0:00.13 │ ├─ dbus-daemon - 807 nico 20 0 32420 3212 2928 S 0.0 0.0 0:00.13 │ ├─ dbus-daemon - 711 nico 20 0 138M 2160 4 S 0.0 0.0 0:00.00 │ └─ (sd-pam) 1 [||| 7.6%] Tasks: 39; 1 running2 [|||5.2%] Load average: 0.31 0.32 0.30 3 [|||6.4%] Uptime: 09:45:054 [|| 5.2%] 759 nico 20 0 164M 37300 18668 S 0.6 0.5 6:56.45 ├─ compton -b 711 nico 20 0 138M 2160 4 S 0.0 0.0 0:00.00 │ └─ (sd-pam) 698 root 20 0 71312 3124 2580 S 0.0 0.0 0:00.19 ├─ login -- nico 698 root 20 0 71312 3124 2580 S 0.0 0.0 0:00.19 ├─ login -- nico 716 nico 20 0 13872 3348 2900 S 0.0 0.0 0:00.01 │ └─ sh /usr/bin/s3 [|||6.4%] Uptime: 09:45:06 759 nico 20 0 164M 37300 18668 S 0.6 0.5 6:56.46 ├─ compton -b 1 [|||| 9.8%] Tasks: 39; 2 running2 [|||7.3%] Load average: 0.31 0.32 0.30 3 [|||7.4%] Uptime: 09:45:074 [|||6.2%] 759 nico 20 0 164M 37300 18668 S 0.6 0.5 6:56.46 ├─ compton -b 716 nico 20 0 13872 3348 2900 S 0.0 0.0 0:00.01 │ └─ sh /usr/bin/s29184 nico 20 0 21412 4192 3420 R 1.2 0.1 0:00.10 │ │ └29184 nico 20 0 21412 4192 3420 R 1.2 0.1 0:00.10 │ │ └3 [|||7.4%] Uptime: 09:45:0829180 nico 20 0 104M 26716 8640 S 0.6 0.3 0:00.28 │ │ └─ pyth29180 nico 20 0 104M 26716 8640 S 0.6 0.3 0:00.28 │ │ └─ pyth27170 nico 20 0 104M 26948 8816 S 0.0 0.3 0:00.87 │ │ └─ python /us2 [|||7.3%] Load average: 0.28 0.31 0.30 27170 nico 20 0 104M 26948 8816 S 0.0 0.3 0:00.87 │ │ └─ python /us 1 [||||| 12.7%] Tasks: 39; 1 running2 [|||8.2%] Load average: 0.28 0.31 0.30 3 [||||||13.9%] Uptime: 09:45:084 [|||||13.2%]23027 nico 20 0 30252 5040 3096 S 0.0 0.1 0:02.18 ├─ tmux 27170 nico 20 0 104M 26948 8816 S 0.6 0.3 0:00.88 │ │ └─ python /us29180 nico 20 0 104M 26720 8640 S 0.0 0.3 0:00.28 │ │ └─ pyth29184 nico 20 0 21412 4192 3420 R 0.6 0.1 0:00.11 │ │ └3 [||||||13.9%] Uptime: 09:45:0923027 nico 20 0 30252 5040 3096 S 0.0 0.1 0:02.18 ├─ tmux 3 [||||||13.9%] Uptime: 09:45:1027170 nico 20 0 104M 26948 8816 S 0.0 0.3 0:00.88 │ │ └─ python /us27170 nico 20 0 104M 26948 8816 S 0.0 0.3 0:00.88 │ │ └─ python /us3 [||| 8.6%] Uptime: 09:45:10 1 [|||| 8.8%] Tasks: 39; 1 running2 [||||9.6%] Load average: 0.28 0.31 0.30 3 [||| 8.6%] Uptime: 09:45:114 [||| 7.5%]29184 nico 20 0 21412 4192 3420 R 0.6 0.1 0:00.12 │ │ └nico ~ $ nico ~ $ e nico ~ $ ex nico ~ $ exi 1 [||| 5.0%] Tasks: 39; 2 running2 [|| 5.4%] Load average: 0.28 0.31 0.30 3 [|||| 10.8%] Uptime: 09:45:124 [||| 7.0%]29180 nico 20 0 104M 26720 8640 S 0.0 0.3 0:00.28 │ │ └─ pyth29184 nico 20 0 21412 4192 3420 R 0.8 0.1 0:00.14 │ │ └nico ~ $ exit nico ~ $ exit exit
\ No newline at end of file
diff --git a/examples/ipython.svg b/examples/ipython.svg
index 45eba30..bb1369b 100644
--- a/examples/ipython.svg
+++ b/examples/ipython.svg
@@ -1,5 +1,4 @@
\ No newline at end of file
+.background {fill: #002b36}]]>nico ~ $ nico ~ $ i nico ~ $ ip nico ~ $ ipy nico ~ $ ipyt nico ~ $ ipyth nico ~ $ ipytho nico ~ $ ipython In [1]: In [1]: i In [1]: im In [1]: imp In [1]: impo In [1]: impor In [1]: import In [1]: import In [1]: import t In [1]: import ti In [1]: import tim In [1]: import time In [2]: In [2]: f In [2]: fo In [2]: for In [2]: for In [2]: for i In [2]: for i In [2]: for i i In [2]: for i in In [2]: for i in In [2]: for i in r In [2]: for i in ra In [2]: for i in ran In [2]: for i in rang In [2]: for i in range In [2]: for i in range( In [2]: for i in range(4 In [2]: for i in range(40 In [2]: for i in range(40) In [2]: for i in range(40): ...: ...: p ...: pr ...: pri ...: prin ...: print ...: print( ...: print(' ...: print('= ...: print('=' ...: print('=' ...: print('=' * ...: print('=' * ...: print('=' * i ...: print('=' * i ...: print('=' * i + ...: print('=' * i + ...: print('=' * i + ' ...: print('=' * i + '+ ...: print('=' * i + '+' ...: print('=' * i + '+' ...: print('=' * i + '+' ...: print('=' * i + '+' + ...: print('=' * i + '+' + ...: print('=' * i + '+' + ' ...: print('=' * i + '+' + '= ...: print('=' * i + '+' + '=' ...: print('=' * i + '+' + '=' ...: print('=' * i + '+' + '=' * ...: print('=' * i + '+' + '=' * ...: print('=' * i + '+' + '=' * ( ...: print('=' * i + '+' + '=' * (4 ...: print('=' * i + '+' + '=' * (40 ...: print('=' * i + '+' + '=' * (40 ...: print('=' * i + '+' + '=' * (40- ...: print('=' * i + '+' + '=' * (40-i ...: print('=' * i + '+' + '=' * (40-i) ...: print('=' * i + '+' + '=' * (40-i)) ...: t ...: ti ...: tim ...: time ...: time. ...: time.s time.sleep time.strptime ...: time.sleep time.sleep time.strptime time.strftime time.struct_time <unknown> ...: time.sleep( ...: time.sleep(0 ...: time.sleep(0. ...: time.sleep(0.1 ...: time.sleep(0.1) In [2]: for i in range(40): ...: print('=' * i + '+' + '=' * (40-i)) ...: time.sleep(0.1) ...: nico ~ $ ipythonPython 3.6.5 (default, May 11 2018, 04:00:52) Type 'copyright', 'credits' or 'license' for more informationIPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help.In [1]: import time ...: +======================================== =+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=========================================+=In [3]: In [3]: e In [3]: ex In [3]: exi In [3]: exit nico ~ $ nico ~ $ e nico ~ $ ex nico ~ $ exi In [3]: exit nico ~ $ exit nico ~ $ exit exit
\ No newline at end of file
diff --git a/examples/unittest.svg b/examples/unittest.svg
index 749e1bf..ea918c6 100644
--- a/examples/unittest.svg
+++ b/examples/unittest.svg
@@ -1,5 +1,4 @@
\ No newline at end of file
+.background {fill: #002b36}]]>nico ~/termtosvg $ nico ~/termtosvg $ m nico ~/termtosvg $ ma nico ~/termtosvg $ mak nico ~/termtosvg $ make nico ~/termtosvg $ make nico ~/termtosvg $ make t nico ~/termtosvg $ make te nico ~/termtosvg $ make tes nico ~/termtosvg $ make test nico ~/termtosvg $ make tests nico ~/termtosvg $ make tests(test -d .venv || python -m venv .venv). .venv/bin/activate && \ pip install -U -e .[dev]Obtaining file:///home/nico/termtosvgRequirement already up-to-date: setuptools in ./.venv/lib/python3.6/site-packages (from termtosvg==0.1.0)Requirement already up-to-date: pyte in ./.venv/lib/python3.6/site-packages (from termtosvg==0.1.0)Requirement already up-to-date: python-xlib in ./.venv/lib/python3.6/site-packages (from termtosvg==0.1.0)Requirement already up-to-date: svgwrite in ./.venv/lib/python3.6/site-packages (from termtosvg==0.1.0)Requirement already up-to-date: coverage in ./.venv/lib/python3.6/site-packages (fRequirement already up-to-date: twine in ./.venv/lib/python3.6/site-packages (from termtosvg==0.1.0)Requirement already up-to-date: wheel in ./.venv/lib/python3.6/site-packages (fromRequirement already up-to-date: wcwidth in ./.venv/lib/python3.6/site-packages (from pyte->termtosvg==0.1.0)Requirement already up-to-date: six>=1.10.0 in ./.venv/lib/python3.6/site-packages (from python-xlib->termtosvg==0.1.0)Requirement already up-to-date: pyparsing>=2.0.1 in ./.venv/lib/python3.6/site-packages (from svgwrite->termtosvg==0.1.0)Requirement already up-to-date: requests!=2.15,!=2.16,>=2.5.0 in ./.venv/lib/python3.6/site-packages (from twine->termtosvg==0.1.0)Requirement already up-to-date: requests-toolbelt>=0.8.0 in ./.venv/lib/python3.6/site-packages (from twine->termtosvg==0.1.0)Requirement already up-to-date: tqdm>=4.14 in ./.venv/lib/python3.6/site-packages (from twine->termtosvg==0.1.0)Requirement already up-to-date: pkginfo>=1.4.2 in ./.venv/lib/python3.6/site-packages (from twine->termtosvg==0.1.0)Requirement already up-to-date: certifi>=2017.4.17 in ./.venv/lib/python3.6/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine->termtosvg==0.1.0)Requirement already up-to-date: idna<2.8,>=2.5 in ./.venv/lib/python3.6/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine->termtosvg==0.1.0)Requirement already up-to-date: urllib3<1.24,>=1.21.1 in ./.venv/lib/python3.6/site-packages (from requests!=2.15,!=2.16,>=2.5.0->twine->termtosvg==0.1.0)Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in ./.venv/lib/python3.6/sitInstalling collected packages: termtosvg Found existing installation: termtosvg 0.1.0 Uninstalling termtosvg-0.1.0: Successfully uninstalled termtosvg-0.1.0 Running setup.py develop for termtosvgSuccessfully installed termtosvgYou are using pip version 9.0.3, however version 10.0.1 is available.You should consider upgrading via the 'pip install --upgrade pip' command. pip freeze && \ coverage run --branch --source termtosvg -m unittest -v && \ coverage report && \ coverage htmlpython-xlib==0.23pytz==2018.4requests==2.19.1requests-toolbelt==0.8.0rsa==3.4.2six==1.11.0svgwrite==1.1.12-e git+git@github.com:nbedos/termtosvg.git@dab7f522c126e9938e896d023d8be453f0dcf1b9#egg=termtosvgtinydb==3.9.0.post1tinyrecord==0.1.5tox==3.0.0tqdm==4.23.4twine==1.11.0urllib3==1.23virtualenv==16.0.0wcwidth==0.1.7wrapt==1.10.11test_main (tests.test___main__.TestMain) ... test_main (tests.test___main__.TestMain) ... Recording started, enter "exit" command or Control-D to endRecording ended, cast file is /tmp/termtosvg_3vqhnplh.castRecording started, enter "exit" command or Control-D to endRecording ended, cast file is /tmp/termtosvg_s7tgsv75.castRendering startedRendering ended, SVG animation is /tmp/termtosvg_wts11qev.svgRendering ended, SVG animation is /tmp/termtosvg_s7tgsv75.svgRendering ended, SVG animation is /tmp/termtosvg_i8zp1z7w.svgLogging to /tmp/termtosvg.logRecording ended, SVG animation is /tmp/termtosvg_fkz0r2vk.svgRecording ended, SVG animation is /tmp/termtosvg_s7tgsv75.svgoktest_parse (tests.test___main__.TestMain) ... test_parse (tests.test___main__.TestMain) ... oktest__render_characters (tests.test_anim.TestAnim) ... oktest__render_line_bg_colors (tests.test_anim.TestAnim) ... test__render_line_bg_colors (tests.test_anim.TestAnim) ... oktest_from_pyte (tests.test_anim.TestAnim) ... oktest_render_animation (tests.test_anim.TestAnim) ... test_render_animation (tests.test_anim.TestAnim) ... oktest_serialize_css_dict (tests.test_anim.TestAnim) ... oktest_AsciiCastEvent (tests.test_asciicast.TestAsciicast) ... oktest_AsciiCastHeader (tests.test_asciicast.TestAsciicast) ... oktest_from_json (tests.test_asciicast.TestAsciicast) ... test_from_json (tests.test_asciicast.TestAsciicast) ... oktest_from_xresources (tests.test_asciicast.TestAsciicast) ... test_from_xresources (tests.test_asciicast.TestAsciicast) ... oktest_to_json (tests.test_asciicast.TestAsciicast) ... oktest__group_by_time (tests.test_term.TestTerm) ... oktest__record (tests.test_term.TestTerm) ... test__record (tests.test_term.TestTerm) ... oktest_default_themes (tests.test_term.TestTerm) ... test_default_themes (tests.test_term.TestTerm) ... oktest_get_configuration (tests.test_term.TestTerm) ... test_get_configuration (tests.test_term.TestTerm) ... oktest_record (tests.test_term.TestTerm) ... test_record (tests.test_term.TestTerm) ... oktest_replay (tests.test_term.TestTerm) ... test_replay (tests.test_term.TestTerm) ... ok----------------------------------------------------------------------Ran 18 tests in 5.164sOKnico ~/termtosvg $ e nico ~/termtosvg $ ex nico ~/termtosvg $ exi Name Stmts Miss Branch BrPart Cover----------------------------------------------------------termtosvg/__init__.py 0 0 0 0 100%termtosvg/__main__.py 106 4 38 4 94%termtosvg/anim.py 146 3 60 3 97%termtosvg/asciicast.py 93 6 38 3 93%termtosvg/term.py 192 13 66 8 91%TOTAL 537 26 202 18 94%nico ~/termtosvg $ exit nico ~/termtosvg $ exitexit
\ No newline at end of file
diff --git a/termtosvg/anim.py b/termtosvg/anim.py
index b24c0aa..5fbddd9 100644
--- a/termtosvg/anim.py
+++ b/termtosvg/anim.py
@@ -22,9 +22,10 @@
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
-_CharacterCell = namedtuple('_CharacterCell', ['text', 'color', 'background_color'])
+_CharacterCell = namedtuple('_CharacterCell', ['text', 'color', 'background_color', 'bold'])
_CharacterCell.__doc__ = 'Representation of a character cell'
_CharacterCell.text.__doc__ = 'Text content of the cell'
+_CharacterCell.bold.__doc__ = 'Bold modificator flag'
_CharacterCell.color.__doc__ = 'Color of the text'
_CharacterCell.background_color.__doc__ = 'Background color of the cell'
@@ -80,7 +81,7 @@ def from_pyte(cls, char, palette):
if char.reverse:
text_color, background_color = background_color, text_color
- return CharacterCell(char.data, text_color, background_color)
+ return CharacterCell(char.data, text_color, background_color, char.bold)
CharacterCellConfig = namedtuple('CharacterCellConfig', ['width', 'height', 'text_color',
@@ -139,6 +140,8 @@ def make_text(group: List[int]) -> svgwrite.text.Text:
'lengthAdjust': 'spacingAndGlyphs',
'fill': screen_line[group[0]].color
}
+ if screen_line[group[0]].bold:
+ attributes['font-weight'] = 'bold'
return svgwrite.text.Text(**attributes)
group = []
@@ -176,9 +179,6 @@ def render_animation(records, filename, font, font_size=14, cell_width=8, cell_h
'text': {
'dominant-baseline': 'text-before-edge',
},
- '.bold': {
- 'font-weight': 'bold',
- },
'.background': {
'fill': header.background_color,
},
diff --git a/tests/test_anim.py b/tests/test_anim.py
index c280c62..a5f2296 100644
--- a/tests/test_anim.py
+++ b/tests/test_anim.py
@@ -32,15 +32,15 @@ def test_from_pyte(self):
]
char_cells = [
- anim.CharacterCell('A', 'color1', 'color4'),
- anim.CharacterCell('B', 'color4', 'color1'),
- anim.CharacterCell('C', 'color9', 'color4'),
- anim.CharacterCell('D', 'color4', 'color9'),
- anim.CharacterCell('E', 'color12', 'color4'),
- anim.CharacterCell('F', 'foreground', 'background'),
- anim.CharacterCell('G', '#008700', '#ABCDEF'),
- anim.CharacterCell('H', 'color10', '#ABCDEF'),
- anim.CharacterCell('I', 'color3', '#ABCDEF'),
+ anim.CharacterCell('A', 'color1', 'color4', False),
+ anim.CharacterCell('B', 'color4', 'color1', False),
+ anim.CharacterCell('C', 'color9', 'color4', True),
+ anim.CharacterCell('D', 'color4', 'color9', True),
+ anim.CharacterCell('E', 'color12', 'color4', True),
+ anim.CharacterCell('F', 'foreground', 'background', False),
+ anim.CharacterCell('G', '#008700', '#ABCDEF', False),
+ anim.CharacterCell('H', 'color10', '#ABCDEF', True),
+ anim.CharacterCell('I', 'color3', '#ABCDEF', True),
]
palette = {
@@ -60,16 +60,16 @@ def test_from_pyte(self):
def test__render_line_bg_colors(self):
cell_width = 8
screen_line = {
- 0: anim.CharacterCell('A', 'black', 'red'),
- 1: anim.CharacterCell('A', 'black', 'red'),
- 3: anim.CharacterCell('A', 'black', 'red'),
- 4: anim.CharacterCell('A', 'black', 'blue'),
- 6: anim.CharacterCell('A', 'black', 'blue'),
- 7: anim.CharacterCell('A', 'black', 'blue'),
- 8: anim.CharacterCell('A', 'black', 'green'),
- 9: anim.CharacterCell('A', 'black', 'red'),
- 10: anim.CharacterCell('A', 'black', 'red'),
- 99: anim.CharacterCell('A', 'black', 'black'),
+ 0: anim.CharacterCell('A', 'black', 'red', False),
+ 1: anim.CharacterCell('A', 'black', 'red', False),
+ 3: anim.CharacterCell('A', 'black', 'red', False),
+ 4: anim.CharacterCell('A', 'black', 'blue', False),
+ 6: anim.CharacterCell('A', 'black', 'blue', False),
+ 7: anim.CharacterCell('A', 'black', 'blue', False),
+ 8: anim.CharacterCell('A', 'black', 'green', False),
+ 9: anim.CharacterCell('A', 'black', 'red', False),
+ 10: anim.CharacterCell('A', 'black', 'red', False),
+ 99: anim.CharacterCell('A', 'black', 'black', False),
}
rectangles = anim._render_line_bg_colors(screen_line=screen_line,
@@ -95,15 +95,15 @@ def test__render_line_bg_colors(self):
def test__render_characters(self):
screen_line = {
- 0: anim.CharacterCell('A', 'red', 'white'),
- 1: anim.CharacterCell('B', 'blue', 'white'),
- 2: anim.CharacterCell('C', 'blue', 'white'),
- 7: anim.CharacterCell('D', 'green', 'white'),
- 8: anim.CharacterCell('E', 'green', 'white'),
- 9: anim.CharacterCell('F', 'green', 'white'),
- 10: anim.CharacterCell('G', 'green', 'white'),
- 11: anim.CharacterCell('H', 'red', 'white'),
- 20: anim.CharacterCell(' ', 'black', 'black')
+ 0: anim.CharacterCell('A', 'red', 'white', False),
+ 1: anim.CharacterCell('B', 'blue', 'white', False),
+ 2: anim.CharacterCell('C', 'blue', 'white', False),
+ 7: anim.CharacterCell('D', 'green', 'white', False),
+ 8: anim.CharacterCell('E', 'green', 'white', False),
+ 9: anim.CharacterCell('F', 'green', 'white', False),
+ 10: anim.CharacterCell('G', 'green', 'white', False),
+ 11: anim.CharacterCell('H', 'red', 'white', False),
+ 20: anim.CharacterCell(' ', 'black', 'black', False)
}
with self.subTest(case='Content'):
@@ -138,7 +138,7 @@ def test_serialize_css_dict(self):
def test_render_animation(self):
def line(i):
- chars = [anim.CharacterCell(c, '#123456', '#789012') for c in 'line{}'.format(i)]
+ chars = [anim.CharacterCell(c, '#123456', '#789012', False) for c in 'line{}'.format(i)]
return dict(enumerate(chars))
records = [