svg: improve text alignment of board coordinates - chess-puzzles - chess puzzle… | |
git clone git://git.codemadness.org/chess-puzzles | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 59753af31b403f30db84f07562d2614460a2d9ab | |
parent 9a5e1b026219ea4a2b320c21bac8284832f852e3 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Mon, 18 Dec 2023 00:38:36 +0100 | |
svg: improve text alignment of board coordinates | |
A bit hacky by hardcoding the y coordinate offset, but this works better with | |
gimp and ImageMagick also. | |
Diffstat: | |
M fen_to_svg.c | 6 +++--- | |
1 file changed, 3 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/fen_to_svg.c b/fen_to_svg.c | |
@@ -165,8 +165,8 @@ showboard(void) | |
color = highlight[y][x] ? lightsquarehi : ligh… | |
else | |
color = highlight[y][x] ? darksquarehi : darks… | |
- printf("<text x=\"%d\" y=\"%d\" fill=\"%s\" dominant-b… | |
- (x * 45) + 37, (y * 45) + 3, color, '8' - y); | |
+ printf("<text x=\"%d\" y=\"%d\" fill=\"%s\" text-ancho… | |
+ (x + 1) * 45 - 2, (y * 45) + 10, color, '8' - … | |
} | |
y = 7; | |
for (x = 0; x < 8; x++) { | |
@@ -174,7 +174,7 @@ showboard(void) | |
color = highlight[y][x] ? lightsquarehi : ligh… | |
else | |
color = highlight[y][x] ? darksquarehi : darks… | |
- printf("<text x=\"%d\" y=\"%d\" fill=\"%s\" dominant-b… | |
+ printf("<text x=\"%d\" y=\"%d\" fill=\"%s\" text-ancho… | |
(x * 45) + 2, (y + 1) * 45 - 3, color, x + 'a'… | |
} | |
} |