I’m trying to generate some footprints using KicadModTree, and some of them are very small. I have the reference designator on the F.Fab layer, and I need to automatically reduce the size of the text based on the total size of the footprint if it is a very small one. I’m trying to work out how the “width” setting in the kicad footprint text dialog box actually maps to the width of the characters and I can’t quite work it out. What I have discovered so far is that it is not a fixed width font, but I’m still struggling to work out how the width factors in to the kerning of the letters.
The font is in the source code in helpers/tools_to_build_newstroke-font/. You can open the font.pro project there and it includes the font.lib symbol library. Symbols look like this: