about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2020-12-26 14:25:35 -0500
committerZach DeCook <zachdecook@librem.one>2020-12-26 14:25:59 -0500
commit7ab3bc051e951d83d88a6784a0b94b17be64cf86 (patch)
treeb46f571b4c793838d445823b7203a5d88159014e
parenteca943d619f2c2172253d78a8bdbdb0c75e07328 (diff)
downloadccharter-c-7ab3bc051e951d83d88a6784a0b94b17be64cf86.tar.gz
SVG: Show title by adjusting viewBox
-rw-r--r--ccharter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ccharter.c b/ccharter.c
index 7887447..bb4c786 100644
--- a/ccharter.c
+++ b/ccharter.c
@@ -1,7 +1,12 @@
 #include <stdio.h>
 #include <string.h>
 int main(int argc, char **argv) {
-		printf("<svg width=\"50px\" height=\"60px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" overflow=\"visible\" style=\"stroke-width:2; stroke:black;\">");
+		printf("<svg width=\"60px\" height=\"75px\" "
+			"version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" overflow=\"visible\" "
+			"style=\"stroke-width:2; stroke:black;\" "
+			"viewBox=\"-5 -15 50 75\" "
+			">"
+		);
 		int fretsCount = strlen(argv[1]);
 
 		//var origin = { x: 0, y: 0};
@@ -25,7 +30,7 @@ int main(int argc, char **argv) {
 		}
 	
 		// label
-		printf("<text x=\"%d\" y=\"%d\">%s</text>",
+		printf("<text x=\"%d\" y=\"%d\" style=\"stroke-width:0; text-anchor:middle;\">%s</text>",
 		    0 + 50/2, 0 - 5, argv[2]
 		);