convert -size 300x300 -fill black -font chessfont.TTF caption:@boardstring.txt out.png

As you can see, the image is not a nicely filled square, but instead has blank space on the right and bottom that I'm forced to chop off. What's more, the chopped image isn't perfectly square, so I'm forced to do a resize to adjust for that.
Setting the font size instead of the image size didn't help:
convert -pointsize 36 -fill black -font chessfont.TTF caption:@boardstring.txt out.png
Having to work out the correct chop numbers for every image size is a big problem. Could someone let me know why the basic converted image isn't coming out right?