julianandrews / sgf-render

Sgf Rendering CLI written in Rust
MIT License
32 stars 8 forks source link

kifu mode ko additions at bottom not centred #29

Closed AprilInParis closed 6 months ago

AprilInParis commented 6 months ago

4

The text moves in the box at the bottom are not centered in the box. Some text is on the top line.

the box is off to the right, when coordinates are not on , but ok when coordinates are on.

nice program by the way.

Not many good native options on linux.

Mybe have an option to include sgf header section such as players, komi, result, etc.

I like to have 4 diagrams, 1 to 50, 51 to 100, 101 to 150, 151 to end. On one page in two columns.

And a convert to pdf option but I can use rsvg-convert which works well to centre the svg on a page.

All the best, Neil

julianandrews commented 6 months ago

Hi! Could you attach the SGF you used to generate this image and the specific arguments used? It would save me a bunch of time to have a simple reproduction of the bug to look at.

Typesetting is finicky, and I haven't done a ton of hands on testing of the kifu mode so this isn't too surprising.

Mybe have an option to include sgf header section such as players, komi, result, etc.

I definitely have plans to add an option to show any text annotations in a box. Ideally there'd be a section to display game info properties and another to display node specific comments and annotations. It's a bigger/more finicky task than you might think though, so I'm not sure when I'll get around to it.

I like to have 4 diagrams, 1 to 50, 51 to 100, 101 to 150, 151 to end. On one page in two columns.

This is definitely out of scope for what I want sgf-render to be doing. There are a lot of tools that can be used to combine SVGs. For a one-off, I'd recommend using Inkscape. For something more scriptable, I'd check out svg_stack. You could probably achieve this directly using lpr and printing to a pdf with multiple pages per sheet.

And a convert to pdf option but I can use rsvg-convert

This is definitely another out-of-scope feature. There are tons of good tools for converting svgs into other formats, and I'm not likely to improve on those tools without a lot of work!

AprilInParis commented 6 months ago

Totally agree, lots of small simple tools that combine. Saves a lot of head ache for the developer to maintain. 4.sgf.zip I'm lazy, I'll check out svg_stack and lpr, thanks. Probably get a little script together to get it exactly how I like it.

Edit: noticed in your repo you finished all 25days for AoC'23. Nice, only managed about 38 stars in C here, respect.

AprilInParis commented 6 months ago

sorry, another bug...

When doing something like this:

for m in {50,100,150}; do sgf-render input.sgf -o move-$m.svg --move-numbers --node $m --first-move-number $(( $m - 49 )); done

The annotations at the bottom box keep the original move numbering in the sgf, and not the --first-move-number change.

julianandrews commented 6 months ago

I've got a fix pushed for the first issue - it turns out it was a fairly simple bug.

I've opened a separate issue to address the renumbering of moves for --first-move-number in Kifu mode.

I hope to put out a release with the fixes to both issues once I get the second one fixed.

julianandrews commented 6 months ago

There's a new release out now. I think the issue should be fixed, but if it's still not working, please re-open the issue and ping me!

AprilInParis commented 6 months ago

Tried v2.4.2 and the box is centered.

However the first line of the annotations is still outside the box, the box line is going through the middle of the text.

Mybe it's something specific to my pc setup? Are you able to replicate?

julianandrews commented 6 months ago

I think I can replicate. I've opened a new issue - does it look like this: #31 (potentially without the weird character for the arrow)? What software are you using to render the SVG? And does the same thing happen in your web browser?

I think this may be a long standing issue that I haven't noticed because my web browser renders the SVG the way I'd expect, but I think the formatting may be a little off.