Compare commits

..

6 Commits

Author SHA1 Message Date
Mark 69ba2ab715
Improved WASM webpage 2023-09-21 12:06:13 -07:00
Mark f9382616b2
Cleaned up art 2023-09-21 12:03:44 -07:00
Mark 921bd4d704
Added proper WASM api 2023-09-21 12:03:28 -07:00
Mark cb9f69948c
Migrate to new formattedtext & promptbuffer 2023-09-21 12:03:01 -07:00
Mark 7d78d0d74d
Improved formattedtext 2023-09-21 12:02:40 -07:00
Mark 0c07cb258b
Promptbuffer now uses FormattedText 2023-09-21 12:02:11 -07:00
11 changed files with 828 additions and 396 deletions

View File

@ -1,37 +1,149 @@
<html> <html>
<head> <head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<link rel="stylesheet" href="node_modules/xterm/css/xterm.css" />
<link rel="stylesheet" href="xterm.css">
<script src="node_modules/xterm/lib/xterm.js"></script>
<style>
@font-face {
font-family: Fantasque;
src: url("FantasqueSansMono/Regular/complete/Fantasque Sans Mono Regular Nerd Font Complete.ttf") format("opentype");
}
html, body {
color: #FFFFFF;
background-color: #272A30;
font-size: 14pt;
font-family: Fantasque;
margin: 0;
padding: 0;
overflow: hidden;
height: 100vh;
}
body {
max-width: 1000px;
margin: 0 auto !important;
float: none !important;
}
a {
font-size: 12pt;
}
a:link, a:visited {
color: #00B6B6;
text-decoration: none;
}
a:hover, a:active {
color: #04F1F1;
text-decoration: underline;
}
#terminal {
width: 90%;
height: auto;
margin: 0 auto !important;
padding: 20px;
background: #1D1F21;
box-sizing: box;
border: 0mm;
box-shadow: 0px 0px 10px 4px #4d5257;
}
#header {
padding-top: 20px;
padding-bottom: 20px;
width: 90%;
margin: 0 auto !important;
}
#footer {
padding-top: 20px;
padding-bottom: 20px;
width: 90%;
margin: 0 auto !important;
text-align: center;
}
#banner {
width: 40%;
}
</style>
</head> </head>
<body> <body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<div id="terminal"> <div id="header">
<div id="output"></div> <img id="banner" src = "misc/daisy-light.svg" alt="Daisy Banner"/>
<div id="input"> <p>A high-precision, general-purpose scientific calculator</p>
<span id="prompt">$ </span> </div>
<input type="text" id="cmd">
</div> <div id="terminal"></div>
<div id="footer">
<a href="https://github.com/rm-dr/daisy" target="_blank" rel="noopener noreferrer">Source Code</a> |
<a href="https://github.com/rm-dr/daisy#-usage" target="_blank" rel="noopener noreferrer">Documentation</a> |
<a href="https://github.com/rm-dr/daisy/blob/master/LICENSE" target="_blank" rel="noopener noreferrer">License</a>
<br>
<a href="https://crates.io/crates/daisycalc" target="_blank" rel="noopener noreferrer">crates.io</a> |
<a href="https://aur.archlinux.org/packages/daisy" target="_blank" rel="noopener noreferrer">AUR</a>
</div> </div>
<!-- Note the usage of `type=module` here as this is an ES6 module -->
<script type="module"> <script type="module">
// See wasm-pack docs // See wasm-pack docs
// Build with `wasm-pack build --release --target web` // Build with `wasm-pack build --release --target web`
// Works with wasm-pack 0.9.1. Some other versions give a segfault. // Works with wasm-pack 0.9.1. Some other versions give a segfault.
import init, { dostr } from './pkg/daisycalc.js';
import init, { daisy_init, daisy_free, daisy_char, daisy_prompt } from './pkg/daisycalc.js';
await init(); await init();
$(document).ready(function() { const term = new Terminal({
$("#cmd").focus(); "fontFamily": "Fantasque",
$("#cmd").keypress(function(e) { "rows": 32,
if(e.which == 13) { "fontSize": 16,
var cmd = $("#cmd").val(); "tabStopWidth": 8,
$("#output").append("<div>$ " + cmd + "</div>"); "cursorBlink": true,
$("#output").append("<div>$ " + dostr(cmd) + "</div>"); "theme": {
$("#cmd").val(""); "background": "#1D1F21",
"foreground": "#F8F8F8",
"cursor": "#F8F8F2",
"black": "#282828",
"blue": "#0087AF",
"brightBlack": "#555555",
"brightBlue": "#87DFFF",
"brightCyan": "#28D1E7",
"brightGreen": "#A8FF60",
"brightMagenta": "#985EFF",
"brightRed": "#FFAA00",
"brightWhite": "#D0D0D0",
"brightYellow": "#F1FF52",
"cyan": "#87DFEB",
"green": "#B4EC85",
"magenta": "#BD99FF",
"red": "#FF6600",
"white": "#F8F8F8",
"yellow": "#FFFFB6"
} }
});
}); });
term.open(document.getElementById("terminal"));
const state = daisy_init();
term.write(daisy_char(state, "h"));
term.write(daisy_char(state, "e"));
term.write(daisy_char(state, "l"));
term.write(daisy_char(state, "p"));
term.write(daisy_char(state, "\r"));
term.focus();
term.onData( data => { term.write(daisy_char(state, data)); });
</script> </script>
</body> </body>
</html> </html>

137
misc/banner.svg Normal file
View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="3600"
height="400"
viewBox="0 0 952.49994 105.83334"
version="1.1"
id="svg3246"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="banner.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview3248"
pagecolor="#9e9e9e"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="true"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
showgrid="false"
showborder="true"
borderlayer="false"
shape-rendering="auto"
inkscape:zoom="0.38377228"
inkscape:cx="1911.2897"
inkscape:cy="665.75939"
inkscape:window-width="1280"
inkscape:window-height="1384"
inkscape:window-x="1280"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" /><defs
id="defs3243"><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9-6" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-27" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-7" /></defs><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(93.034294,223.72656)"><g
id="g1657-2-2"
transform="matrix(3.2163178,0,0,3.2163178,-196.23741,245.9227)"
style="stroke:#a60d66;stroke-opacity:1"><g
id="g2349-6-0-0"
style="stroke:#ea004d;stroke-opacity:1"
transform="translate(125.41922,-167.998)"><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 26.115101,47.660493 c 1.853776,0.96137 4.1474,0.53544 5.680504,-1.05487 1.410359,-1.46298 1.804214,-3.05883 1.179203,-4.77799 -0.966718,-2.6591 -3.720953,-3.9058 -8.552213,-3.87115 l -1.673694,0.012 0.11351,2.11848 c 0.142919,2.66699 0.428255,4.15648 1.018046,5.31437 0.567689,1.11447 1.136825,1.68985 2.234644,2.25917 z"
id="path302-3-1-7-2-9-7-6-2"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 12.940109,34.959413 c -1.028597,-1.81733 -0.686937,-4.12501 0.846167,-5.71532 1.410353,-1.46298 2.990719,-1.915 4.731608,-1.35336 2.692707,0.86871 4.039427,3.57545 4.181707,8.40473 l 0.04931,1.67302 -2.121224,-0.0359 c -2.670426,-0.0452 -4.169372,-0.27577 -5.348089,-0.82278 -1.134496,-0.5265 -1.730333,-1.07418 -2.339471,-2.15042 z"
id="path302-3-1-2-0-0-8-5-8-3"
sodipodi:nodetypes="sssscsss" /></g><g
id="g1649-9-7"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 144.80192,-120.3375 c -1.85377,0.96136 -4.1474,0.53544 -5.6805,-1.05487 -1.41036,-1.46298 -1.80422,-3.05883 -1.1792,-4.77799 0.96671,-2.6591 3.72095,-3.9058 8.55221,-3.87116 l 1.67369,0.012 -0.11351,2.11849 c -0.14291,2.66698 -0.42825,4.15648 -1.01805,5.31437 -0.56768,1.11446 -1.13682,1.68985 -2.23464,2.25917 z"
id="path302-3-1-7-6-6-8-3-2-5"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 157.9769,-133.03859 c 1.0286,-1.81733 0.68693,-4.12501 -0.84616,-5.71532 -1.41036,-1.46298 -2.99072,-1.915 -4.73161,-1.35336 -2.69271,0.86871 -4.03943,3.57545 -4.18171,8.40473 l -0.0493,1.67302 2.12122,-0.0359 c 2.67043,-0.0452 4.16938,-0.27577 5.34809,-0.82278 1.1345,-0.5265 1.73033,-1.07418 2.33947,-2.15042 z"
id="path302-3-1-2-0-2-8-0-5-6-9"
sodipodi:nodetypes="sssscsss" /></g></g><path
d="M 572.88931,400.21164 V 364.3347 q 0,-2.86538 2.50721,-2.86538 h 14.3269 q 3.52202,0 6.26801,0.41787 2.80569,0.41787 5.73076,1.73117 2.98477,1.3133 4.95472,3.58172 1.96995,2.20873 3.22355,6.14863 1.2536,3.8802 1.2536,9.19309 0,5.55167 -1.55208,9.55127 -1.55208,3.99959 -3.70111,6.02923 -2.08934,2.02964 -5.31289,3.22355 -3.16386,1.13421 -5.31289,1.373 -2.14904,0.17908 -4.89503,0.17908 H 575.6353 q -1.3133,0 -2.02964,-0.53726 -0.71635,-0.53725 -0.71635,-2.14903 z m 8.29766,-2.44751 h 6.62619 q 2.92508,0 4.83533,-0.17909 1.91025,-0.23878 4.23837,-1.37299 2.38782,-1.13421 3.82051,-3.22355 2.02964,-3.10416 2.14903,-9.25279 v -0.65665 q 0,-2.86538 -0.17908,-4.65624 -0.11939,-1.79086 -0.83574,-4.17868 -0.65665,-2.44751 -1.96995,-3.8802 -1.3133,-1.43269 -3.8802,-2.50721 -2.5072,-1.13421 -6.08893,-1.2536 h -8.65583 l -0.0597,1.73117 z m 35.45911,-3.04447 q 0,-2.32812 1.37299,-4.05928 1.373,-1.73117 3.28325,-2.6863 1.96995,-0.95512 4.59655,-1.49238 2.68629,-0.59696 4.59654,-0.77604 1.96995,-0.17909 3.9399,-0.17909 v -1.2536 q 0,-2.5669 -0.83574,-4.05929 -0.83573,-1.49238 -3.40264,-1.49238 -2.32812,0 -4.23837,0.65665 -1.91025,0.59695 -2.86538,1.37299 -0.89543,0.77604 -1.73116,1.43269 -0.77604,0.65665 -1.13422,0.65665 l -0.23878,-0.0597 -0.23878,-0.17908 q -0.17909,-0.29848 -0.35817,-1.43269 -0.11939,-1.19391 -0.17909,-2.14904 l -0.0597,-1.01482 q 0,-0.29848 0,-0.41787 0.0597,-0.17908 0.23878,-0.35817 0.17908,-0.17909 0.23878,-0.23878 0.11939,-0.0597 0.53726,-0.23878 0.41787,-0.17909 0.65665,-0.29848 4.29807,-1.91025 9.37217,-1.91025 6.80528,0 9.55127,2.5669 2.80568,2.5669 2.80568,7.40223 v 15.69989 q 0,2.68629 -2.68629,2.68629 h -2.86538 q -1.3133,0 -1.91025,-0.71634 -0.53726,-0.71635 -0.53726,-1.67147 -3.9399,3.04446 -9.19309,3.04446 -3.99959,0 -6.38741,-2.74599 -2.32812,-2.74598 -2.32812,-6.08893 z m 7.8201,0 q 0,1.73117 1.13421,3.10416 1.13421,1.373 2.98477,1.373 2.02964,0 3.9399,-1.25361 1.91025,-1.31329 1.91025,-4.23837 v -4.65624 q -1.85056,0.17909 -3.16386,0.41787 -1.3133,0.17908 -3.10416,0.77604 -1.79086,0.53726 -2.74599,1.73116 -0.95512,1.13422 -0.95512,2.74599 z m 25.07204,-29.19105 v -2.98477 q 0,-0.95512 0.17909,-1.55208 0.23878,-0.59695 0.77604,-0.83573 0.53726,-0.23879 0.77604,-0.23879 0.29848,-0.0597 0.95513,-0.11939 h 3.04446 q 1.25361,0 1.96995,0.59696 0.77604,0.53726 0.77604,2.14903 v 3.10416 q 0,0.47757 -0.11939,0.89543 -0.0597,0.35818 -0.23878,0.65665 -0.11939,0.23878 -0.35817,0.47757 -0.17909,0.17908 -0.41787,0.29847 -0.17909,0.0597 -0.47756,0.17909 -0.23879,0.0597 -0.41787,0.0597 -0.11939,0 -0.35817,0.0597 h -0.23879 -3.10416 q -1.2536,0 -2.02964,-0.53726 -0.71635,-0.59695 -0.71635,-2.20873 z m 0.23879,34.38455 v -21.66943 q 0,-2.68629 2.62659,-2.68629 h 2.44752 q 1.31329,0 1.96994,0.47756 0.71635,0.47757 0.83574,1.01482 0.11939,0.53726 0.11939,1.49239 v 21.66943 q 0,2.68629 -2.6266,2.68629 h -2.74599 q -1.2536,0 -1.91025,-0.59695 -0.59695,-0.59696 -0.65665,-1.07452 -0.0597,-0.47756 -0.0597,-1.3133 z m 13.4911,0 q 0,-0.23878 0.71635,-4.17868 0.17909,-1.37299 0.83573,-1.37299 0.29848,0 1.373,1.13421 1.13421,1.07452 3.28325,2.20873 2.14903,1.13422 4.95471,1.13422 4.65625,0 4.65625,-3.16386 0,-1.67147 -1.43269,-2.44751 -1.43269,-0.77604 -4.17868,-1.19391 -2.74599,-0.47756 -3.70112,-0.83574 -2.32812,-0.89543 -4.29807,-2.86537 -1.91025,-1.96995 -1.91025,-5.1935 0,-8.35736 10.02883,-8.59614 h 1.55208 q 3.8205,0.0597 7.28284,1.49238 0.89543,0.35818 1.13421,0.59696 0.29848,0.23878 0.29848,0.83573 0,0.35817 -0.59696,3.76081 -0.23878,0.89543 -0.71634,0.89543 -0.41787,0 -1.43269,-0.77604 -0.95513,-0.83573 -2.80568,-1.61177 -1.85056,-0.83574 -4.41746,-0.83574 -4.41746,0 -4.41746,2.86538 0,1.55208 1.67147,2.26843 1.67147,0.71634 4.47715,1.2536 2.86538,0.47756 4.17868,1.19391 1.13421,0.53726 2.14903,1.37299 1.01483,0.83574 2.02965,2.68629 1.07452,1.79087 1.07452,3.9996 0,5.01441 -2.86538,7.04405 -2.86538,1.96995 -7.8798,1.96995 -6.20832,0 -10.68547,-2.86538 l -0.23879,-0.29847 q -0.11939,-0.35818 -0.11939,-0.47757 z m 25.13182,-22.86334 q 0,-1.49238 2.02965,-1.49238 h 2.02964 q 2.14903,0 3.22355,1.43269 0.29848,0.29848 1.73117,3.40264 1.49238,3.04446 3.16385,7.40223 1.67147,4.29807 2.08934,6.92466 0.23878,-3.10416 4.47716,-15.69989 0.83573,-2.26842 1.49238,-2.80568 0.83574,-0.65665 2.38782,-0.65665 h 1.67147 q 2.08934,0 2.08934,1.61178 0,0.41786 -0.23878,1.13421 l -9.25279,26.92262 q -0.77604,2.20873 -1.19391,3.04447 -3.46233,6.92467 -10.14822,6.92467 -3.76081,0 -4.53685,-0.77605 -0.29847,-0.29847 -0.59695,-4.11898 -0.0597,-1.13421 0.29848,-1.49238 l 0.29847,-0.11939 h 0.23879 q 0.23878,0.0597 0.89543,0.41786 0.71634,0.41787 1.61177,0.65665 0.89543,0.29848 1.96995,0.29848 1.2536,0 2.14903,-0.53726 0.95513,-0.53726 1.49239,-1.49238 0.59695,-0.95513 1.01482,-2.02965 0.41787,-1.01482 0.77604,-2.14903 0.11939,-0.41787 0.17909,-0.65665 0.0597,-0.53726 -0.23878,-1.13421 l -10.56609,-23.3409 q -0.53726,-1.19391 -0.53726,-1.67148 z"
id="text2099-9-3-6-4-2"
style="font-weight:bold;font-size:59.6954px;font-family:'CMU Sans Serif';-inkscape-font-specification:'CMU Sans Serif, Bold';font-variant-ligatures:no-contextual;white-space:pre;fill:#ffffff;stroke-width:15.1181;stroke-linecap:round;stroke-linejoin:bevel"
transform="matrix(1.2936576,0,0,1.2936576,-401.03067,-669.54324)"
aria-label="Daisy" /></g></svg>

After

Width:  |  Height:  |  Size: 11 KiB

137
misc/daisy-dark.svg Normal file
View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1463.4203"
height="400.00003"
viewBox="0 0 387.19659 105.83335"
version="1.1"
id="svg3246"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="daisy-dark.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview3248"
pagecolor="#9e9e9e"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="true"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
showgrid="false"
showborder="true"
borderlayer="false"
shape-rendering="auto"
inkscape:zoom="0.19458888"
inkscape:cx="881.34533"
inkscape:cy="-418.83174"
inkscape:window-width="2560"
inkscape:window-height="1384"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" /><defs
id="defs3243"><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9-6" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-27" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-7" /></defs><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-18.308946,-133.59209)"><g
id="g1657-2-9"
transform="matrix(4.4337012,0,0,4.4337012,-486.12826,763.96674)"
style="stroke:#a60d66;stroke-opacity:1"><g
id="g2349-6-0-3"
style="stroke:#ea004d;stroke-opacity:1"
transform="translate(102.69737,-168.67264)"><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 26.115101,47.660493 c 1.853776,0.96137 4.1474,0.53544 5.680504,-1.05487 1.410359,-1.46298 1.804214,-3.05883 1.179203,-4.77799 -0.966718,-2.6591 -3.720953,-3.9058 -8.552213,-3.87115 l -1.673694,0.012 0.11351,2.11848 c 0.142919,2.66699 0.428255,4.15648 1.018046,5.31437 0.567689,1.11447 1.136825,1.68985 2.234644,2.25917 z"
id="path302-3-1-7-2-9-7-6-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 12.940109,34.959413 c -1.028597,-1.81733 -0.686937,-4.12501 0.846167,-5.71532 1.410353,-1.46298 2.990719,-1.915 4.731608,-1.35336 2.692707,0.86871 4.039427,3.57545 4.181707,8.40473 l 0.04931,1.67302 -2.121224,-0.0359 c -2.670426,-0.0452 -4.169372,-0.27577 -5.348089,-0.82278 -1.134496,-0.5265 -1.730333,-1.07418 -2.339471,-2.15042 z"
id="path302-3-1-2-0-0-8-5-8-0"
sodipodi:nodetypes="sssscsss" /></g><g
id="g1649-9-62"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"
transform="translate(-22.721851,-0.67464498)"><path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 144.80192,-120.3375 c -1.85377,0.96136 -4.1474,0.53544 -5.6805,-1.05487 -1.41036,-1.46298 -1.80422,-3.05883 -1.1792,-4.77799 0.96671,-2.6591 3.72095,-3.9058 8.55221,-3.87116 l 1.67369,0.012 -0.11351,2.11849 c -0.14291,2.66698 -0.42825,4.15648 -1.01805,5.31437 -0.56768,1.11446 -1.13682,1.68985 -2.23464,2.25917 z"
id="path302-3-1-7-6-6-8-3-2-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 157.9769,-133.03859 c 1.0286,-1.81733 0.68693,-4.12501 -0.84616,-5.71532 -1.41036,-1.46298 -2.99072,-1.915 -4.73161,-1.35336 -2.69271,0.86871 -4.03943,3.57545 -4.18171,8.40473 l -0.0493,1.67302 2.12122,-0.0359 c 2.67043,-0.0452 4.16938,-0.27577 5.34809,-0.82278 1.1345,-0.5265 1.73033,-1.07418 2.33947,-2.15042 z"
id="path302-3-1-2-0-2-8-0-5-6-1"
sodipodi:nodetypes="sssscsss" /></g></g><path
d="m 152.46104,212.70512 v -63.97971 q 0,-5.10986 4.47113,-5.10986 h 25.5493 q 6.28086,0 11.17781,0.7452 5.00341,0.74519 10.21972,3.08721 5.32277,2.34202 8.8358,6.38731 3.51303,3.93885 5.74859,10.96492 2.23555,6.9196 2.23555,16.39413 0,9.90034 -2.76784,17.03287 -2.76784,7.13251 -6.60022,10.75198 -3.72594,3.61948 -9.47453,5.74859 -5.64214,2.02265 -9.47453,2.44849 -3.8324,0.31935 -8.72935,0.31935 h -26.29448 q -2.34202,0 -3.61948,-0.9581 -1.27747,-0.95808 -1.27747,-3.83238 z m 14.7973,-4.36467 h 11.81655 q 5.21632,0 8.62289,-0.31938 3.40657,-0.42582 7.55833,-2.44846 4.25822,-2.02265 6.81315,-5.74859 3.61948,-5.53568 3.83239,-16.50059 v -1.17101 q 0,-5.10986 -0.31936,-8.30352 -0.21291,-3.19366 -1.49038,-7.45188 -1.17101,-4.36467 -3.51303,-6.9196 -2.34203,-2.55493 -6.9196,-4.47113 -4.47112,-2.02265 -10.85845,-2.23556 H 167.3648 l -0.10646,3.08721 z m 63.23458,-5.42924 q 0,-4.15176 2.44846,-7.23895 2.44849,-3.08721 5.85506,-4.79051 3.51303,-1.70327 8.19707,-2.66137 4.79049,-1.06457 8.19705,-1.38392 3.51304,-0.31937 7.02607,-0.31937 v -2.23556 q 0,-4.57758 -1.49039,-7.23897 -1.49036,-2.66138 -6.06796,-2.66138 -4.15176,0 -7.55833,1.17101 -3.40656,1.06455 -5.10986,2.44847 -1.59682,1.38392 -3.08719,2.55493 -1.38392,1.17101 -2.02267,1.17101 l -0.42581,-0.10647 -0.42582,-0.31935 q -0.31938,-0.53228 -0.63873,-2.55493 -0.21291,-2.12911 -0.31937,-3.83241 l -0.10647,-1.80973 q 0,-0.53229 0,-0.7452 0.10647,-0.31935 0.42582,-0.63872 0.31936,-0.31938 0.42582,-0.42582 0.21291,-0.10647 0.9581,-0.42582 0.74519,-0.31937 1.17101,-0.53228 7.66479,-3.40657 16.71348,-3.40657 12.13593,0 17.03288,4.57758 5.00339,4.57758 5.00339,13.20047 v 27.99777 q 0,4.79048 -4.79048,4.79048 h -5.10986 q -2.34202,0 -3.40657,-1.27745 -0.9581,-1.27748 -0.9581,-2.98075 -7.02606,5.42921 -16.39413,5.42921 -7.13251,0 -11.39073,-4.89695 -4.15176,-4.89693 -4.15176,-10.85845 z m 13.94566,0 q 0,3.08722 2.02265,5.53568 2.02264,2.44849 5.32277,2.44849 3.61947,0 7.02606,-2.23558 3.40657,-2.342 3.40657,-7.55833 v -8.30351 q -3.30013,0.31937 -5.64215,0.74519 -2.34202,0.31935 -5.53568,1.38392 -3.19365,0.9581 -4.89695,3.08719 -1.70327,2.02267 -1.70327,4.89695 z m 44.71122,-52.05668 v -5.32277 q 0,-1.70328 0.31937,-2.76784 0.42582,-1.06455 1.38392,-1.49037 0.9581,-0.42584 1.38392,-0.42584 0.53228,-0.10646 1.70329,-0.2129 h 5.42922 q 2.23557,0 3.51303,1.06456 1.38392,0.9581 1.38392,3.83239 v 5.53568 q 0,0.85165 -0.21291,1.59682 -0.10647,0.63875 -0.42582,1.17101 -0.21291,0.42582 -0.63873,0.85166 -0.31937,0.31936 -0.74519,0.53226 -0.31937,0.10647 -0.85164,0.31938 -0.42583,0.10646 -0.74519,0.10646 -0.21291,0 -0.63873,0.10646 h -0.42583 -5.53568 q -2.23556,0 -3.61948,-0.9581 -1.27747,-1.06454 -1.27747,-3.93885 z m 0.42583,61.3183 v -38.64331 q 0,-4.79048 4.68403,-4.79048 h 4.36468 q 2.34201,0 3.51302,0.85163 1.27747,0.85166 1.49038,1.80974 0.21291,0.9581 0.21291,2.6614 v 38.64331 q 0,4.79048 -4.68404,4.79048 h -4.89695 q -2.23556,0 -3.40657,-1.06454 -1.06455,-1.06457 -1.17101,-1.91621 -0.10647,-0.85163 -0.10647,-2.34202 z m 24.05881,0 q 0,-0.42582 1.27748,-7.45188 0.31937,-2.44846 1.49036,-2.44846 0.53229,0 2.44849,2.02264 2.02265,1.91621 5.85505,3.93885 3.83239,2.02267 8.83578,2.02267 8.30354,0 8.30354,-5.64214 0,-2.98075 -2.55493,-4.36467 -2.55493,-1.38392 -7.45188,-2.12911 -4.89695,-0.85164 -6.60025,-1.49039 -4.15176,-1.59683 -7.66479,-5.10984 -3.40656,-3.51303 -3.40656,-9.26162 0,-14.90376 17.88451,-15.32958 h 2.76784 q 6.81313,0.10646 12.98756,2.66137 1.59683,0.63875 2.02264,1.06457 0.53229,0.42582 0.53229,1.49037 0,0.63872 -1.06457,6.70668 -0.42582,1.59683 -1.27745,1.59683 -0.7452,0 -2.55493,-1.38392 -1.7033,-1.49036 -5.0034,-2.87428 -3.30012,-1.49038 -7.8777,-1.49038 -7.8777,0 -7.8777,5.10986 0,2.76784 2.98075,4.04531 2.98075,1.27746 7.98414,2.23556 5.10986,0.85163 7.45189,2.12911 2.02264,0.9581 3.83238,2.44846 1.80976,1.49039 3.6195,4.79049 1.9162,3.19368 1.9162,7.13253 0,8.94224 -5.10986,12.56172 -5.10986,3.51303 -14.05213,3.51303 -11.07136,0 -19.0555,-5.10986 l -0.42584,-0.53226 q -0.21291,-0.63875 -0.21291,-0.85166 z m 44.81783,-40.77242 q 0,-2.66137 3.61949,-2.66137 h 3.61948 q 3.83238,0 5.74859,2.55493 0.53228,0.53228 3.08721,6.06796 2.66137,5.42921 5.64212,13.20047 2.98075,7.66479 3.72594,12.34881 0.42582,-5.53568 7.98417,-27.99777 1.49036,-4.04529 2.66137,-5.00339 1.49039,-1.17101 4.25823,-1.17101 h 2.98075 q 3.72594,0 3.72594,2.8743 0,0.74517 -0.42582,2.02265 l -16.50059,48.01137 q -1.38392,3.93885 -2.12912,5.42924 -6.1744,12.34883 -18.09742,12.34883 -6.70669,0 -8.09061,-1.38394 -0.53226,-0.53226 -1.06454,-7.34542 -0.10647,-2.02265 0.53228,-2.66137 l 0.53226,-0.21291 h 0.42584 q 0.42582,0.10646 1.59683,0.74517 1.27746,0.74519 2.87429,1.17101 1.59682,0.53228 3.51303,0.53228 2.23555,0 3.83238,-0.9581 1.7033,-0.9581 2.6614,-2.66137 1.06454,-1.7033 1.80974,-3.6195 0.74519,-1.80974 1.38391,-3.83238 0.21291,-0.7452 0.31938,-1.17101 0.10646,-0.95811 -0.42582,-2.02265 l -18.84261,-41.62406 q -0.9581,-2.12911 -0.9581,-2.98077 z"
id="text2099-9-3-6-4-8"
style="font-weight:bold;font-size:59.6954px;font-family:'CMU Sans Serif';-inkscape-font-specification:'CMU Sans Serif, Bold';font-variant-ligatures:no-contextual;white-space:pre;stroke-width:26.9603;stroke-linecap:round;stroke-linejoin:bevel"
aria-label="Daisy" /></g></svg>

After

Width:  |  Height:  |  Size: 11 KiB

137
misc/daisy-light.svg Normal file
View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1463.4203"
height="400.00003"
viewBox="0 0 387.19659 105.83335"
version="1.1"
id="svg3246"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
sodipodi:docname="daisy-light.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview3248"
pagecolor="#9e9e9e"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="true"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
showgrid="false"
showborder="true"
borderlayer="false"
shape-rendering="auto"
inkscape:zoom="0.31455847"
inkscape:cx="650.11761"
inkscape:cy="364.00228"
inkscape:window-width="2560"
inkscape:window-height="1384"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" /><defs
id="defs3243"><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9-6" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-27" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-7" /></defs><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-18.308946,-133.59209)"><g
id="g1657-2-9"
transform="matrix(4.4337012,0,0,4.4337012,-486.12826,763.96674)"
style="stroke:#a60d66;stroke-opacity:1"><g
id="g2349-6-0-3"
style="stroke:#ea004d;stroke-opacity:1"
transform="translate(102.69737,-168.67264)"><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 26.115101,47.660493 c 1.853776,0.96137 4.1474,0.53544 5.680504,-1.05487 1.410359,-1.46298 1.804214,-3.05883 1.179203,-4.77799 -0.966718,-2.6591 -3.720953,-3.9058 -8.552213,-3.87115 l -1.673694,0.012 0.11351,2.11848 c 0.142919,2.66699 0.428255,4.15648 1.018046,5.31437 0.567689,1.11447 1.136825,1.68985 2.234644,2.25917 z"
id="path302-3-1-7-2-9-7-6-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 12.940109,34.959413 c -1.028597,-1.81733 -0.686937,-4.12501 0.846167,-5.71532 1.410353,-1.46298 2.990719,-1.915 4.731608,-1.35336 2.692707,0.86871 4.039427,3.57545 4.181707,8.40473 l 0.04931,1.67302 -2.121224,-0.0359 c -2.670426,-0.0452 -4.169372,-0.27577 -5.348089,-0.82278 -1.134496,-0.5265 -1.730333,-1.07418 -2.339471,-2.15042 z"
id="path302-3-1-2-0-0-8-5-8-0"
sodipodi:nodetypes="sssscsss" /></g><g
id="g1649-9-62"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"
transform="translate(-22.721851,-0.67464498)"><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 144.80192,-120.3375 c -1.85377,0.96136 -4.1474,0.53544 -5.6805,-1.05487 -1.41036,-1.46298 -1.80422,-3.05883 -1.1792,-4.77799 0.96671,-2.6591 3.72095,-3.9058 8.55221,-3.87116 l 1.67369,0.012 -0.11351,2.11849 c -0.14291,2.66698 -0.42825,4.15648 -1.01805,5.31437 -0.56768,1.11446 -1.13682,1.68985 -2.23464,2.25917 z"
id="path302-3-1-7-6-6-8-3-2-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 157.9769,-133.03859 c 1.0286,-1.81733 0.68693,-4.12501 -0.84616,-5.71532 -1.41036,-1.46298 -2.99072,-1.915 -4.73161,-1.35336 -2.69271,0.86871 -4.03943,3.57545 -4.18171,8.40473 l -0.0493,1.67302 2.12122,-0.0359 c 2.67043,-0.0452 4.16938,-0.27577 5.34809,-0.82278 1.1345,-0.5265 1.73033,-1.07418 2.33947,-2.15042 z"
id="path302-3-1-2-0-2-8-0-5-6-1"
sodipodi:nodetypes="sssscsss" /></g></g><path
d="m 152.46104,212.70512 v -63.97971 q 0,-5.10986 4.47113,-5.10986 h 25.5493 q 6.28086,0 11.17781,0.7452 5.00341,0.74519 10.21972,3.08721 5.32277,2.34202 8.8358,6.38731 3.51303,3.93885 5.74859,10.96492 2.23555,6.9196 2.23555,16.39413 0,9.90034 -2.76784,17.03287 -2.76784,7.13251 -6.60022,10.75198 -3.72594,3.61948 -9.47453,5.74859 -5.64214,2.02265 -9.47453,2.44849 -3.8324,0.31935 -8.72935,0.31935 h -26.29448 q -2.34202,0 -3.61948,-0.9581 -1.27747,-0.95808 -1.27747,-3.83238 z m 14.7973,-4.36467 h 11.81655 q 5.21632,0 8.62289,-0.31938 3.40657,-0.42582 7.55833,-2.44846 4.25822,-2.02265 6.81315,-5.74859 3.61948,-5.53568 3.83239,-16.50059 v -1.17101 q 0,-5.10986 -0.31936,-8.30352 -0.21291,-3.19366 -1.49038,-7.45188 -1.17101,-4.36467 -3.51303,-6.9196 -2.34203,-2.55493 -6.9196,-4.47113 -4.47112,-2.02265 -10.85845,-2.23556 H 167.3648 l -0.10646,3.08721 z m 63.23458,-5.42924 q 0,-4.15176 2.44846,-7.23895 2.44849,-3.08721 5.85506,-4.79051 3.51303,-1.70327 8.19707,-2.66137 4.79049,-1.06457 8.19705,-1.38392 3.51304,-0.31937 7.02607,-0.31937 v -2.23556 q 0,-4.57758 -1.49039,-7.23897 -1.49036,-2.66138 -6.06796,-2.66138 -4.15176,0 -7.55833,1.17101 -3.40656,1.06455 -5.10986,2.44847 -1.59682,1.38392 -3.08719,2.55493 -1.38392,1.17101 -2.02267,1.17101 l -0.42581,-0.10647 -0.42582,-0.31935 q -0.31938,-0.53228 -0.63873,-2.55493 -0.21291,-2.12911 -0.31937,-3.83241 l -0.10647,-1.80973 q 0,-0.53229 0,-0.7452 0.10647,-0.31935 0.42582,-0.63872 0.31936,-0.31938 0.42582,-0.42582 0.21291,-0.10647 0.9581,-0.42582 0.74519,-0.31937 1.17101,-0.53228 7.66479,-3.40657 16.71348,-3.40657 12.13593,0 17.03288,4.57758 5.00339,4.57758 5.00339,13.20047 v 27.99777 q 0,4.79048 -4.79048,4.79048 h -5.10986 q -2.34202,0 -3.40657,-1.27745 -0.9581,-1.27748 -0.9581,-2.98075 -7.02606,5.42921 -16.39413,5.42921 -7.13251,0 -11.39073,-4.89695 -4.15176,-4.89693 -4.15176,-10.85845 z m 13.94566,0 q 0,3.08722 2.02265,5.53568 2.02264,2.44849 5.32277,2.44849 3.61947,0 7.02606,-2.23558 3.40657,-2.342 3.40657,-7.55833 v -8.30351 q -3.30013,0.31937 -5.64215,0.74519 -2.34202,0.31935 -5.53568,1.38392 -3.19365,0.9581 -4.89695,3.08719 -1.70327,2.02267 -1.70327,4.89695 z m 44.71122,-52.05668 v -5.32277 q 0,-1.70328 0.31937,-2.76784 0.42582,-1.06455 1.38392,-1.49037 0.9581,-0.42584 1.38392,-0.42584 0.53228,-0.10646 1.70329,-0.2129 h 5.42922 q 2.23557,0 3.51303,1.06456 1.38392,0.9581 1.38392,3.83239 v 5.53568 q 0,0.85165 -0.21291,1.59682 -0.10647,0.63875 -0.42582,1.17101 -0.21291,0.42582 -0.63873,0.85166 -0.31937,0.31936 -0.74519,0.53226 -0.31937,0.10647 -0.85164,0.31938 -0.42583,0.10646 -0.74519,0.10646 -0.21291,0 -0.63873,0.10646 h -0.42583 -5.53568 q -2.23556,0 -3.61948,-0.9581 -1.27747,-1.06454 -1.27747,-3.93885 z m 0.42583,61.3183 v -38.64331 q 0,-4.79048 4.68403,-4.79048 h 4.36468 q 2.34201,0 3.51302,0.85163 1.27747,0.85166 1.49038,1.80974 0.21291,0.9581 0.21291,2.6614 v 38.64331 q 0,4.79048 -4.68404,4.79048 h -4.89695 q -2.23556,0 -3.40657,-1.06454 -1.06455,-1.06457 -1.17101,-1.91621 -0.10647,-0.85163 -0.10647,-2.34202 z m 24.05881,0 q 0,-0.42582 1.27748,-7.45188 0.31937,-2.44846 1.49036,-2.44846 0.53229,0 2.44849,2.02264 2.02265,1.91621 5.85505,3.93885 3.83239,2.02267 8.83578,2.02267 8.30354,0 8.30354,-5.64214 0,-2.98075 -2.55493,-4.36467 -2.55493,-1.38392 -7.45188,-2.12911 -4.89695,-0.85164 -6.60025,-1.49039 -4.15176,-1.59683 -7.66479,-5.10984 -3.40656,-3.51303 -3.40656,-9.26162 0,-14.90376 17.88451,-15.32958 h 2.76784 q 6.81313,0.10646 12.98756,2.66137 1.59683,0.63875 2.02264,1.06457 0.53229,0.42582 0.53229,1.49037 0,0.63872 -1.06457,6.70668 -0.42582,1.59683 -1.27745,1.59683 -0.7452,0 -2.55493,-1.38392 -1.7033,-1.49036 -5.0034,-2.87428 -3.30012,-1.49038 -7.8777,-1.49038 -7.8777,0 -7.8777,5.10986 0,2.76784 2.98075,4.04531 2.98075,1.27746 7.98414,2.23556 5.10986,0.85163 7.45189,2.12911 2.02264,0.9581 3.83238,2.44846 1.80976,1.49039 3.6195,4.79049 1.9162,3.19368 1.9162,7.13253 0,8.94224 -5.10986,12.56172 -5.10986,3.51303 -14.05213,3.51303 -11.07136,0 -19.0555,-5.10986 l -0.42584,-0.53226 q -0.21291,-0.63875 -0.21291,-0.85166 z m 44.81783,-40.77242 q 0,-2.66137 3.61949,-2.66137 h 3.61948 q 3.83238,0 5.74859,2.55493 0.53228,0.53228 3.08721,6.06796 2.66137,5.42921 5.64212,13.20047 2.98075,7.66479 3.72594,12.34881 0.42582,-5.53568 7.98417,-27.99777 1.49036,-4.04529 2.66137,-5.00339 1.49039,-1.17101 4.25823,-1.17101 h 2.98075 q 3.72594,0 3.72594,2.8743 0,0.74517 -0.42582,2.02265 l -16.50059,48.01137 q -1.38392,3.93885 -2.12912,5.42924 -6.1744,12.34883 -18.09742,12.34883 -6.70669,0 -8.09061,-1.38394 -0.53226,-0.53226 -1.06454,-7.34542 -0.10647,-2.02265 0.53228,-2.66137 l 0.53226,-0.21291 h 0.42584 q 0.42582,0.10646 1.59683,0.74517 1.27746,0.74519 2.87429,1.17101 1.59682,0.53228 3.51303,0.53228 2.23555,0 3.83238,-0.9581 1.7033,-0.9581 2.6614,-2.66137 1.06454,-1.7033 1.80974,-3.6195 0.74519,-1.80974 1.38391,-3.83238 0.21291,-0.7452 0.31938,-1.17101 0.10646,-0.95811 -0.42582,-2.02265 l -18.84261,-41.62406 q -0.9581,-2.12911 -0.9581,-2.98077 z"
id="text2099-9-3-6-4-8"
style="font-weight:bold;font-size:59.6954px;font-family:'CMU Sans Serif';-inkscape-font-specification:'CMU Sans Serif, Bold';font-variant-ligatures:no-contextual;white-space:pre;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:26.9603;stroke-linecap:round;stroke-linejoin:bevel;stroke-opacity:1"
aria-label="Daisy" /></g></svg>

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,240 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="1200"
height="850"
viewBox="0 0 317.49998 224.89584"
version="1.1"
id="svg3246"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="daisy.svg"
xml:space="preserve"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview3248"
pagecolor="#9e9e9e"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="true"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="px"
showgrid="false"
showborder="true"
borderlayer="false"
shape-rendering="auto"
inkscape:zoom="0.39300486"
inkscape:cx="1349.8561"
inkscape:cy="-150.12537"
inkscape:window-width="2560"
inkscape:window-height="1384"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="layer1" /><defs
id="defs3243"><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9-6" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-0-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-9" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-2-2" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-8" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-3" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-27" /><rect
x="567.45734"
y="347.68021"
width="408.88004"
height="160.23911"
id="rect2101-9-8-3-8-7" /></defs><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"><rect
style="fill:#0d1117;fill-opacity:1;stroke:none;stroke-width:5.40518;stroke-linecap:round;stroke-linejoin:bevel;stroke-opacity:1"
id="rect1146-6"
width="317.5"
height="105.83333"
x="0"
y="0" /><rect
style="fill:#415472;fill-opacity:0.78596705;stroke:none;stroke-width:9.36205;stroke-linecap:round;stroke-linejoin:bevel;stroke-opacity:1"
id="rect1146-6-4"
width="952.5"
height="105.83333"
x="-93.034294"
y="-223.72656"
inkscape:export-filename="rect1146-6-4.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" /><g
id="g6067"
inkscape:export-filename="g6067.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
transform="translate(-11.12614,-1.0494528)"><g
id="g1657-2"
transform="matrix(3.2163178,0,0,3.2163178,-409.57698,470.69872)"
style="stroke:#a60d66;stroke-opacity:1"><g
id="g2349-6-0"
style="stroke:#ea004d;stroke-opacity:1"
transform="translate(125.41922,-167.998)"><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 26.115101,47.660493 c 1.853776,0.96137 4.1474,0.53544 5.680504,-1.05487 1.410359,-1.46298 1.804214,-3.05883 1.179203,-4.77799 -0.966718,-2.6591 -3.720953,-3.9058 -8.552213,-3.87115 l -1.673694,0.012 0.11351,2.11848 c 0.142919,2.66699 0.428255,4.15648 1.018046,5.31437 0.567689,1.11447 1.136825,1.68985 2.234644,2.25917 z"
id="path302-3-1-7-2-9-7-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 12.940109,34.959413 c -1.028597,-1.81733 -0.686937,-4.12501 0.846167,-5.71532 1.410353,-1.46298 2.990719,-1.915 4.731608,-1.35336 2.692707,0.86871 4.039427,3.57545 4.181707,8.40473 l 0.04931,1.67302 -2.121224,-0.0359 c -2.670426,-0.0452 -4.169372,-0.27577 -5.348089,-0.82278 -1.134496,-0.5265 -1.730333,-1.07418 -2.339471,-2.15042 z"
id="path302-3-1-2-0-0-8-5-8"
sodipodi:nodetypes="sssscsss" /></g><g
id="g1649-9"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 144.80192,-120.3375 c -1.85377,0.96136 -4.1474,0.53544 -5.6805,-1.05487 -1.41036,-1.46298 -1.80422,-3.05883 -1.1792,-4.77799 0.96671,-2.6591 3.72095,-3.9058 8.55221,-3.87116 l 1.67369,0.012 -0.11351,2.11849 c -0.14291,2.66698 -0.42825,4.15648 -1.01805,5.31437 -0.56768,1.11446 -1.13682,1.68985 -2.23464,2.25917 z"
id="path302-3-1-7-6-6-8-3-2"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 157.9769,-133.03859 c 1.0286,-1.81733 0.68693,-4.12501 -0.84616,-5.71532 -1.41036,-1.46298 -2.99072,-1.915 -4.73161,-1.35336 -2.69271,0.86871 -4.03943,3.57545 -4.18171,8.40473 l -0.0493,1.67302 2.12122,-0.0359 c 2.67043,-0.0452 4.16938,-0.27577 5.34809,-0.82278 1.1345,-0.5265 1.73033,-1.07418 2.33947,-2.15042 z"
id="path302-3-1-2-0-2-8-0-5-6"
sodipodi:nodetypes="sssscsss" /></g></g><text
xml:space="preserve"
transform="matrix(1.2936576,0,0,1.2936576,-614.37024,-444.76722)"
id="text2099-9-3-6-4"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:59.6954px;font-family:'CMU Sans Serif';-inkscape-font-specification:'CMU Sans Serif, Bold';font-variant-ligatures:no-contextual;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre;shape-inside:url(#rect2101-9-8-3-8);display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:15.1181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"><tspan
x="567.45703"
y="402.89793"
id="tspan3867">Daisy</tspan></text></g><g
id="g6067-9"
inkscape:export-filename="g6067.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
transform="translate(213.33957,-224.77602)"><g
id="g1657-2-2"
transform="matrix(3.2163178,0,0,3.2163178,-409.57698,470.69872)"
style="stroke:#a60d66;stroke-opacity:1"><g
id="g2349-6-0-0"
style="stroke:#ea004d;stroke-opacity:1"
transform="translate(125.41922,-167.998)"><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 26.115101,47.660493 c 1.853776,0.96137 4.1474,0.53544 5.680504,-1.05487 1.410359,-1.46298 1.804214,-3.05883 1.179203,-4.77799 -0.966718,-2.6591 -3.720953,-3.9058 -8.552213,-3.87115 l -1.673694,0.012 0.11351,2.11848 c 0.142919,2.66699 0.428255,4.15648 1.018046,5.31437 0.567689,1.11447 1.136825,1.68985 2.234644,2.25917 z"
id="path302-3-1-7-2-9-7-6-2"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 12.940109,34.959413 c -1.028597,-1.81733 -0.686937,-4.12501 0.846167,-5.71532 1.410353,-1.46298 2.990719,-1.915 4.731608,-1.35336 2.692707,0.86871 4.039427,3.57545 4.181707,8.40473 l 0.04931,1.67302 -2.121224,-0.0359 c -2.670426,-0.0452 -4.169372,-0.27577 -5.348089,-0.82278 -1.134496,-0.5265 -1.730333,-1.07418 -2.339471,-2.15042 z"
id="path302-3-1-2-0-0-8-5-8-3"
sodipodi:nodetypes="sssscsss" /></g><g
id="g1649-9-7"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 144.80192,-120.3375 c -1.85377,0.96136 -4.1474,0.53544 -5.6805,-1.05487 -1.41036,-1.46298 -1.80422,-3.05883 -1.1792,-4.77799 0.96671,-2.6591 3.72095,-3.9058 8.55221,-3.87116 l 1.67369,0.012 -0.11351,2.11849 c -0.14291,2.66698 -0.42825,4.15648 -1.01805,5.31437 -0.56768,1.11446 -1.13682,1.68985 -2.23464,2.25917 z"
id="path302-3-1-7-6-6-8-3-2-5"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 157.9769,-133.03859 c 1.0286,-1.81733 0.68693,-4.12501 -0.84616,-5.71532 -1.41036,-1.46298 -2.99072,-1.915 -4.73161,-1.35336 -2.69271,0.86871 -4.03943,3.57545 -4.18171,8.40473 l -0.0493,1.67302 2.12122,-0.0359 c 2.67043,-0.0452 4.16938,-0.27577 5.34809,-0.82278 1.1345,-0.5265 1.73033,-1.07418 2.33947,-2.15042 z"
id="path302-3-1-2-0-2-8-0-5-6-9"
sodipodi:nodetypes="sssscsss" /></g></g><text
xml:space="preserve"
transform="matrix(1.2936576,0,0,1.2936576,-614.37024,-444.76722)"
id="text2099-9-3-6-4-2"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:59.6954px;font-family:'CMU Sans Serif';-inkscape-font-specification:'CMU Sans Serif, Bold';font-variant-ligatures:no-contextual;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre;shape-inside:url(#rect2101-9-8-3-8-7);display:inline;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:15.1181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"><tspan
x="567.45703"
y="402.89793"
id="tspan3869">Daisy</tspan></text></g><rect
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5.40518;stroke-linecap:round;stroke-linejoin:bevel;stroke-opacity:1"
id="rect1146-6-2"
width="317.5"
height="105.83333"
x="0"
y="119.0625"
inkscape:export-filename="rect1146-6-2.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" /><g
id="g6067-0"
inkscape:export-filename="g6067.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
transform="translate(61.954552,120.18292)"><g
id="g1657-2-9"
transform="matrix(3.2163178,0,0,3.2163178,-409.57698,470.69872)"
style="stroke:#a60d66;stroke-opacity:1"><g
id="g2349-6-0-3"
style="stroke:#ea004d;stroke-opacity:1"
transform="translate(102.69737,-168.67264)"><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 26.115101,47.660493 c 1.853776,0.96137 4.1474,0.53544 5.680504,-1.05487 1.410359,-1.46298 1.804214,-3.05883 1.179203,-4.77799 -0.966718,-2.6591 -3.720953,-3.9058 -8.552213,-3.87115 l -1.673694,0.012 0.11351,2.11848 c 0.142919,2.66699 0.428255,4.15648 1.018046,5.31437 0.567689,1.11447 1.136825,1.68985 2.234644,2.25917 z"
id="path302-3-1-7-2-9-7-6-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#ea004d;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 12.940109,34.959413 c -1.028597,-1.81733 -0.686937,-4.12501 0.846167,-5.71532 1.410353,-1.46298 2.990719,-1.915 4.731608,-1.35336 2.692707,0.86871 4.039427,3.57545 4.181707,8.40473 l 0.04931,1.67302 -2.121224,-0.0359 c -2.670426,-0.0452 -4.169372,-0.27577 -5.348089,-0.82278 -1.134496,-0.5265 -1.730333,-1.07418 -2.339471,-2.15042 z"
id="path302-3-1-2-0-0-8-5-8-0"
sodipodi:nodetypes="sssscsss" /></g><g
id="g1649-9-62"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"
transform="translate(-22.721851,-0.67464498)"><path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 144.80192,-120.3375 c -1.85377,0.96136 -4.1474,0.53544 -5.6805,-1.05487 -1.41036,-1.46298 -1.80422,-3.05883 -1.1792,-4.77799 0.96671,-2.6591 3.72095,-3.9058 8.55221,-3.87116 l 1.67369,0.012 -0.11351,2.11849 c -0.14291,2.66698 -0.42825,4.15648 -1.01805,5.31437 -0.56768,1.11446 -1.13682,1.68985 -2.23464,2.25917 z"
id="path302-3-1-7-6-6-8-3-2-6"
sodipodi:nodetypes="sssscsss" /><path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.37083;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"
d="m 157.9769,-133.03859 c 1.0286,-1.81733 0.68693,-4.12501 -0.84616,-5.71532 -1.41036,-1.46298 -2.99072,-1.915 -4.73161,-1.35336 -2.69271,0.86871 -4.03943,3.57545 -4.18171,8.40473 l -0.0493,1.67302 2.12122,-0.0359 c 2.67043,-0.0452 4.16938,-0.27577 5.34809,-0.82278 1.1345,-0.5265 1.73033,-1.07418 2.33947,-2.15042 z"
id="path302-3-1-2-0-2-8-0-5-6-1"
sodipodi:nodetypes="sssscsss" /></g></g><text
xml:space="preserve"
transform="matrix(1.2936576,0,0,1.2936576,-687.45093,-446.93709)"
id="text2099-9-3-6-4-8"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:59.6954px;font-family:'CMU Sans Serif';-inkscape-font-specification:'CMU Sans Serif, Bold';font-variant-ligatures:no-contextual;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;white-space:pre;shape-inside:url(#rect2101-9-8-3-8-27);display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:15.1181;stroke-linecap:round;stroke-linejoin:bevel;stroke-dasharray:none;stroke-opacity:1"><tspan
x="567.45703"
y="402.89793"
id="tspan3871">Daisy</tspan></text></g></g></svg>

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,4 +1,5 @@
use std::ops::Add; use std::ops::Add;
use std::ops::AddAssign;
#[derive(Debug)] #[derive(Debug)]
@ -31,3 +32,9 @@ impl Add for FormattedText {
return FormattedText::new(format!("{}{}", self.text, other.text)); return FormattedText::new(format!("{}{}", self.text, other.text));
} }
} }
impl AddAssign for FormattedText where {
fn add_assign(&mut self, other: Self) {
self.text.push_str(&other.text);
}
}

View File

@ -8,33 +8,33 @@ use termion::style;
use termion::clear; use termion::clear;
use termion::cursor; use termion::cursor;
fn format_map_ansi(c: char) -> Option<String> { fn format_map_ansi(s: &str) -> Option<String> {
Some(match c { Some(match s {
'n' => { // Normal text "n" => { // Normal text
format!("{}{}", color::Fg(color::Reset), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::Reset), color::Bg(color::Reset))
}, },
'i' => { // Normal italic text "i" => { // Normal italic text
format!("{}{}", color::Fg(color::Reset), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::Reset), color::Bg(color::Reset))
}, },
't' => { // Title text (should be cyan) "t" => { // Title text (should be cyan)
format!("{}{}", color::Fg(color::AnsiValue(6)), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::AnsiValue(6)), color::Bg(color::Reset))
}, },
'a' => { // Colored text (should be pink) "a" => { // Colored text (should be pink)
format!("{}{}", color::Fg(color::AnsiValue(5)), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::AnsiValue(5)), color::Bg(color::Reset))
}, },
'e' => { // Error titles (should be red) "e" => { // Error titles (should be red)
format!("{}{}", color::Fg(color::AnsiValue(1)), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::AnsiValue(1)), color::Bg(color::Reset))
}, },
'c' => { // Console text (inverted black on white) "c" => { // Console text (inverted black on white)
format!("{}{}", color::Fg(color::AnsiValue(0)), color::Bg(color::AnsiValue(7))) format!("{}{}", color::Fg(color::AnsiValue(0)), color::Bg(color::AnsiValue(7)))
}, },
'p' => { // Input prompt (how ==> is styled) (should be blue) "p" => { // Input prompt (how ==> is styled) (should be blue)
format!("{}{}", color::Fg(color::AnsiValue(4)), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::AnsiValue(4)), color::Bg(color::Reset))
}, },
's' => { // Repeat prompt (how => is styled) (should be pink) "s" => { // Repeat prompt (how => is styled) (should be pink)
format!("{}{}", color::Fg(color::AnsiValue(5)), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::AnsiValue(5)), color::Bg(color::Reset))
}, },
'r' => { // Result prompt (how = is styled) (should be green) "r" => { // Result prompt (how = is styled) (should be green)
format!("{}{}", color::Fg(color::AnsiValue(2)), color::Bg(color::Reset)) format!("{}{}", color::Fg(color::AnsiValue(2)), color::Bg(color::Reset))
}, },
@ -44,11 +44,11 @@ fn format_map_ansi(c: char) -> Option<String> {
fn format_map_none(c: char) -> Option<String> { fn format_map_none(s: &str) -> Option<String> {
Some(match c { Some(match s {
'n'|'i'|'t'|'a'| "n"|"i"|"t"|"a"|
'e'|'c'|'s'|'r'| "e"|"c"|"s"|"r"|
'p' "p"
=> { "".to_string() }, => { "".to_string() },
_ => { return None } _ => { return None }
}) })
@ -56,33 +56,33 @@ fn format_map_none(c: char) -> Option<String> {
// style::reset also resets color. // style::reset also resets color.
// Make sure color comes AFTER style reset. // Make sure color comes AFTER style reset.
fn format_map_full(c: char) -> Option<String> { fn format_map_full(s: &str) -> Option<String> {
Some(match c { Some(match s {
'n' => { // Normal text "n" => { // Normal text
format!("{}{}", style::Reset, color::Fg(color::Reset)) format!("{}{}", style::Reset, color::Fg(color::Reset))
}, },
'i' => { // Normal italic text "i" => { // Normal italic text
format!("{}{}", color::Fg(color::Reset), style::Italic) format!("{}{}", color::Fg(color::Reset), style::Italic)
}, },
't' => { // Title text "t" => { // Title text
format!("{}{}", color::Fg(color::Magenta), style::Bold) format!("{}{}", color::Fg(color::Magenta), style::Bold)
}, },
'a' => { // Colored text "a" => { // Colored text
format!("{}{}", style::Reset, color::Fg(color::Magenta)) format!("{}{}", style::Reset, color::Fg(color::Magenta))
}, },
'e' => { // Error titles "e" => { // Error titles
format!("{}{}", color::Fg(color::Red), style::Bold) format!("{}{}", color::Fg(color::Red), style::Bold)
}, },
'c' => { // Console text "c" => { // Console text
format!("{}{}", color::Fg(color::LightBlack), style::Italic) format!("{}{}", color::Fg(color::LightBlack), style::Italic)
}, },
'p' => { // Input prompt (how ==> is styled) "p" => { // Input prompt (how ==> is styled)
format!("{}{}", color::Fg(color::Blue), style::Bold) format!("{}{}", color::Fg(color::Blue), style::Bold)
}, },
's' => { // Repeat prompt (how => is styled) "s" => { // Repeat prompt (how => is styled)
format!("{}{}", color::Fg(color::Magenta), style::Bold) format!("{}{}", color::Fg(color::Magenta), style::Bold)
}, },
'r' => { // Result prompt (how = is styled) "r" => { // Result prompt (how = is styled)
format!("{}{}", color::Fg(color::Green), style::Bold) format!("{}{}", color::Fg(color::Green), style::Bold)
}, },
@ -97,68 +97,83 @@ impl FormattedText {
return Ok(()); return Ok(());
} }
pub fn format_map(c: char, context: &Context) -> Option<String> { pub fn format_map(s: &str, context: &Context) -> Option<String> {
match context.config.term_color_type { match context.config.term_color_type {
0 => format_map_none(c), 0 => format_map_none(s),
1 => format_map_ansi(c), 1 => format_map_ansi(s),
2 => format_map_full(c), 2 => format_map_full(s),
_ => unreachable!("Invalid term_color_type") _ => unreachable!("Invalid term_color_type")
} }
} }
pub fn write(&self, context: &Context, stdout: &mut RawTerminal<std::io::Stdout>) -> Result<(), std::io::Error> { pub fn write(&self, context: &Context, stdout: &mut RawTerminal<std::io::Stdout>) -> Result<(), std::io::Error> {
if self.text == "[clear]" { let mut word = String::new();
write!( let mut reading = false; // are we reading a word?
stdout,
"{}{}",
clear::All,
cursor::Goto(1, 1)
)?;
return Ok(());
}
let mut s = String::new();
let mut chars = self.text.chars(); let mut chars = self.text.chars();
let mut out = String::new();
while let Some(c) = chars.next() { while let Some(c) = chars.next() {
match c { match c {
'[' => { '[' => {
let a = chars.next().unwrap(); if reading {
// Discard old word, start reading again.
out.push_str(&word);
word.clear();
}
// Treat double [[ as escaped [ // Start reading a new word
if a == '[' { s.push('['); } reading = true;
word.push(c);
},
let b = chars.next().unwrap(); ']' => {
if !reading {
out.push(c);
} else {
word.push(c);
match (a, b) {
(c, ']') => { // Normal text
let q = Self::format_map(c, context); let f = Self::format_map(&word[1..word.len()-1], context);
if q.is_some() { if f.is_some() {
s.push_str(&q.unwrap()); out.push_str(&f.unwrap());
} else { } else if word == "[clear]" {
s.push('['); out.push_str(&format!(
s.push(a); "{}{}",
s.push(b); clear::All,
} cursor::Goto(1, 1)
}, ));
} else if word.starts_with("[cursorright") {
_ => { let n: u16 = word[12..word.len()-1].parse().unwrap();
s.push('['); out.push_str(&format!(
s.push(a); "{}",
s.push(b); cursor::Right(n),
));
} else {
out.push_str(&word);
} }
reading = false;
word.clear();
} }
}, },
'\n' => { s.push_str("\r\n") },
_ => s.push(c) '\n' => {
if reading { word.push_str("\r\n"); }
else { out.push_str("\r\n"); }
},
_ => {
if reading { word.push(c); }
else { out.push(c); }
}
} }
} }
write!(stdout, "\r{}", s)?; write!(stdout, "\r{}", out)?;
stdout.flush()?;
return Ok(()); return Ok(());
} }
} }

View File

@ -1,12 +1,80 @@
use super::FormattedText; use super::FormattedText;
impl FormattedText { fn format_map(s: &str) -> Option<String> {
pub fn newline() -> Result<(), ()> { Some(match s {
print!("\n"); "n" => {"\x1B[0m"},
return Ok(()); "i" => {"\x1B[3m"},
} "t" => {"\x1B[1;35m"},
"a" => {"\x1B[0;35m"},
"e" => {"\x1B[1;31m"},
"c" => {"\x1B[3;90m"},
"p" => {"\x1B[1;34m"},
"s" => {"\x1B[1;35m"},
"r" => {"\x1B[1;32m"},
_ => { return None }
}.to_string())
}
impl FormattedText {
pub fn write(&self) -> String { pub fn write(&self) -> String {
return self.text.clone();
let mut word = String::new();
let mut reading = false; // are we reading a word?
let mut chars = self.text.chars();
let mut out = String::new();
while let Some(c) = chars.next() {
match c {
'[' => {
if reading {
// Discard old word, start reading again.
out.push_str(&word);
word.clear();
}
// Start reading a new word
reading = true;
word.push(c);
},
']' => {
if !reading {
out.push(c);
} else {
word.push(c);
let f = format_map(&word[1..word.len()-1]);
if f.is_some() {
out.push_str(&f.unwrap());
} else if word == "[clear]" {
out.push_str(&format!("\x1B[2J\x1B[H"));
} else if word.starts_with("[cursorright") {
let n: u16 = word[12..word.len()-1].parse().unwrap();
out.push_str(&format!("\x1B[{n}C"));
} else {
out.push_str(&word);
}
reading = false;
word.clear();
}
},
'\n' => {
if reading { word.push_str("\r\n"); }
else { out.push_str("\r\n"); }
},
_ => {
if reading { word.push(c); }
else { out.push(c); }
}
}
}
return out;
} }
} }

View File

@ -10,28 +10,92 @@ mod context;
mod formattedtext; mod formattedtext;
mod errors; mod errors;
mod evaluate; mod evaluate;
mod promptbuffer;
pub use crate::formattedtext::FormattedText; pub use crate::formattedtext::FormattedText;
pub use crate::context::Context; pub use crate::context::Context;
pub use crate::errors::DaisyError; pub use crate::errors::DaisyError;
pub use crate::evaluate::evaluate; pub use crate::evaluate::evaluate;
pub use crate::promptbuffer::PromptBuffer;
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] { if #[cfg(target_arch = "wasm32")] {
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[derive(Debug)]
pub fn dostr(x: String) -> String{ pub struct State {
let mut context = Context::new(); pub context: Context,
let x = x.trim().to_string(); pub promptbuffer: PromptBuffer
let r = do_string(&mut context, &x); }
match r { #[wasm_bindgen]
Ok(t) | Err(t) => { pub extern fn daisy_init() -> *mut State {
return t.write(); Box::into_raw(Box::new(State {
} context: Context::new(),
} promptbuffer: PromptBuffer::new(64)
}))
}
#[wasm_bindgen]
pub extern fn daisy_free(state: *mut State) {
unsafe { drop(Box::from_raw(state)) };
}
#[wasm_bindgen]
pub fn daisy_prompt(state: *mut State) -> String {
let t = unsafe { (*state).promptbuffer.write_prompt(&mut (*state).context) };
return t.write();
}
#[wasm_bindgen]
pub fn daisy_char(state: *mut State, s: String) -> String {
let mut out = FormattedText::new("".to_string());
match &s[..] {
"\r" => {
// Print again without cursor, in case we pressed enter
// while inside a substitution
let t = unsafe { (*state).promptbuffer.write_prompt_nocursor(&mut (*state).context) };
out += t;
let in_str = unsafe { (*state).promptbuffer.enter() };
out += FormattedText::new("\n".to_string());
if in_str == "" {
return format!("\r\n{}", daisy_prompt(state));
}
if in_str.trim() == "quit" {
return "[quit]".to_string();
} else {
let r = crate::do_string( unsafe { &mut (*state).context }, &in_str);
match r {
Ok(t) | Err(t) => {
out += t;
}
}
}
},
"\x7F" => { unsafe { (*state).promptbuffer.backspace(); } },
"\x1B[3~" => { unsafe { (*state).promptbuffer.delete(); } },
"\x1B[D" => { unsafe { (*state).promptbuffer.cursor_left(); } },
"\x1B[C" => { unsafe { (*state).promptbuffer.cursor_right(); } },
"\x1B[A" => { unsafe { (*state).promptbuffer.hist_up(); } },
"\x1B[B" => { unsafe { (*state).promptbuffer.hist_down(); } },
//'\x04' | '\x03'
//=> { break 'outer; },
_ => { unsafe { (*state).promptbuffer.add_char(s.chars().next().unwrap()); } },
};
let t = unsafe { (*state).promptbuffer.write_prompt(&mut (*state).context) };
return (out + t).write();
} }
} }
} }

View File

@ -1,5 +1,3 @@
pub mod promptbuffer;
use std::io::stdout; use std::io::stdout;
use std::io::stdin; use std::io::stdin;
use std::env; use std::env;
@ -11,11 +9,10 @@ use termion::{
color::DetectColors color::DetectColors
}; };
use promptbuffer::PromptBuffer; use daisycalc::PromptBuffer;
use daisycalc::command; use daisycalc::command;
use daisycalc::Context; use daisycalc::Context;
use daisycalc::FormattedText; use daisycalc::FormattedText;
use daisycalc::do_string; use daisycalc::do_string;
#[cfg(test)] #[cfg(test)]
@ -70,7 +67,8 @@ pub fn main() -> Result<(), std::io::Error> {
'outer: loop { 'outer: loop {
pb.write_prompt(&mut context, &mut stdout)?; let t = pb.write_prompt(&mut context);
t.write(&context, &mut stdout)?;
let stdin = stdin(); let stdin = stdin();
for c in stdin.keys() { for c in stdin.keys() {
@ -79,7 +77,10 @@ pub fn main() -> Result<(), std::io::Error> {
'\n' => { '\n' => {
// Print again without cursor, in case we pressed enter // Print again without cursor, in case we pressed enter
// while inside a substitution // while inside a substitution
pb.write_prompt_nocursor(&mut context, &mut stdout)?; let t = pb.write_prompt_nocursor(&mut context);
t.write(&context, &mut stdout)?;
let in_str = pb.enter(); let in_str = pb.enter();
FormattedText::newline(&mut stdout)?; FormattedText::newline(&mut stdout)?;
if in_str == "" { break; } if in_str == "" { break; }
@ -115,7 +116,8 @@ pub fn main() -> Result<(), std::io::Error> {
}; };
}; };
pb.write_prompt(&mut context, &mut stdout)?; let t = pb.write_prompt(&mut context);
t.write(&context, &mut stdout)?;
} }
} }

View File

@ -1,9 +1,7 @@
use std::collections::VecDeque; use std::collections::VecDeque;
use std::io::Write; use crate::FormattedText;
use termion::raw::RawTerminal; use crate::parser::substitute_cursor;
use daisycalc::FormattedText; use crate::Context;
use daisycalc::parser::substitute_cursor;
use daisycalc::Context;
const PROMPT_STR: &str = "==> "; const PROMPT_STR: &str = "==> ";
@ -18,12 +16,49 @@ pub struct PromptBuffer {
// 1 means "on last item of history" // 1 means "on last item of history"
hist_cursor: usize, hist_cursor: usize,
buffer: String, pub buffer: String,
buffer_changed: bool, buffer_changed: bool,
cursor: usize, cursor: usize,
last_print_len: usize last_print_len: usize
} }
impl PromptBuffer {
// Same as write_primpt, but pretends there is no cursor
pub fn write_prompt_nocursor(&mut self, context: &Context) -> FormattedText {
let tmp = self.cursor;
self.cursor = 0;
let r = self.write_prompt(context);
self.cursor = tmp;
return r;
}
pub fn write_prompt(&mut self, context: &Context) -> FormattedText {
let l = self.buffer.chars().count();
let i = if l == 0 {0} else {l - self.cursor};
// Draw prettyprinted expression
let (display_c, s) = substitute_cursor(context, &self.get_contents(), i);
let mut tx = FormattedText::new("".to_string());
tx.push(&format!("\r[p]{PROMPT_STR}[n]{s}"));
// If this string is shorter, clear the remaining old one.
if s.chars().count() < self.last_print_len {
tx.push(&" ".repeat(self.last_print_len - s.chars().count()));
}
let q = (display_c + PROMPT_STR.chars().count()) as u16;
tx.push(&format!("\r[cursorright{q}]"));
self.last_print_len = s.chars().count();
return tx;
}
}
impl PromptBuffer { impl PromptBuffer {
pub fn new(maxlen: usize) -> PromptBuffer { pub fn new(maxlen: usize) -> PromptBuffer {
return PromptBuffer { return PromptBuffer {
@ -37,48 +72,6 @@ impl PromptBuffer {
}; };
} }
// Same as write_primpt, but pretends there is no cursor
pub fn write_prompt_nocursor(&mut self, context: &Context, stdout: &mut RawTerminal<std::io::Stdout>) -> Result<(), std::io::Error> {
let tmp = self.cursor;
self.cursor = 0;
let r = self.write_prompt(context, stdout);
self.cursor = tmp;
return r;
}
pub fn write_prompt(&mut self, context: &Context, stdout: &mut RawTerminal<std::io::Stdout>) -> Result<(), std::io::Error> {
let l = self.buffer.chars().count();
let i = if l == 0 {0} else {l - self.cursor};
// Draw prettyprinted expression
let (display_c, s) = substitute_cursor(context, &self.get_contents(), i);
write!(
stdout, "\r{}{PROMPT_STR}{}{}",
FormattedText::format_map('p', context).unwrap(),
FormattedText::format_map('n', context).unwrap(),
s
)?;
// If this string is shorter, clear the remaining old one.
if s.chars().count() < self.last_print_len {
write!(
stdout, "{}",
" ".repeat(self.last_print_len - s.chars().count()),
)?;
}
write!(
stdout, "\r{}",
termion::cursor::Right((display_c + PROMPT_STR.chars().count()) as u16)
)?;
stdout.flush()?;
self.last_print_len = s.chars().count();
return Ok(());
}
// Prompt methods // Prompt methods
pub fn get_contents(&self) -> &String {&self.buffer} pub fn get_contents(&self) -> &String {&self.buffer}