cjsaylor / chessimage

Golang library for rendering chess board images in a specific state.
https://godoc.org/github.com/cjsaylor/chessimage
MIT License
5 stars 5 forks source link

borad coordinates can't be seen on linux #11

Open udvarid opened 4 months ago

udvarid commented 4 months ago

I can't find why but when I use this with windows os, the coordinates at the PNG file can be seen. When I use the same code in a linux machine, there are no any coordinates..

I'm not sure how could be this fixed..

cjsaylor commented 3 months ago

@udvarid Can you leave a code snippet to illustrate the issue?

udvarid commented 3 months ago

at the 'drawRankFile' function a font is used (airal.ttf) which is not installed by default at linux system, that was the problem.

cjsaylor commented 3 months ago

@udvarid Thanks for finding that. Do you know a good fallback font to use on linux? The way the function is currently used is swallowing errors. Maybe an alternative would be to allow for a font to be configured via the Options object that gets passed in.

udvarid commented 3 months ago

Yes, it seems to be a good solution. Currently I copied that ttf file to my project so your library can find it, but it is just a workaround. At least some log messages should be written if no font file can be found