scottbez1 / splitflap

DIY split-flap display
https://scottbez1.github.io/splitflap
Other
3.09k stars 256 forks source link

Letter horizontal misalignement in generate_fonts.py #216

Closed acosta001 closed 8 months ago

acosta001 commented 1 year ago

Hi Scott, I am designing some flaps using a new font and I configured both flap_fonts.scad and generate_fonts.py to generate the final svg file. However, although the letters are perfectly aligned vertically, they are not centered horizontally. Rather, they are shifted by an apparently random number of mm mostly to the right. As for the font, I am sure the letters are correctly centered in the .otf file as I modified them in FontLab 8 for this purpose. Just to let you understand, these are the shifts in mm of the symmetric letters in the svg file with respect to the center of the flaps: +1.0 +0.7 +0.7 +1.17 +1.15 +1.15 +0.3 +0.4 +1.07 +1.17 -1.07 +0.9 +1.04 +0.9 +1.14 +0.86 +2.54 +1.04 +1.02 +1.03 Do you have any idea on where to look to solve the issue? Thank you very much!

scottbez1 commented 8 months ago

Sorry for not responding for so long. I suspect this might be an issue with the way the centering in OpenSCAD works. Would you be able to test some text rendering in OpenSCAD by itself with your font and see if the issue is coming from there? Going to close this in the meantime, but please open a new issue if the issue is in the splitflap font generation as opposed to in OpenSCAD text alignment.