How does the font "width" field actually map to the width of the characters in text?

Hi,

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.

Does anyone have any information on this?

Thanks,
Jeremy

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:

So each of them sees to have their own left and right margins. They are calculated from the stroke lines, not from the outlines of the segments.

As far as I can tell each “kerning” between two characters, A and B, is (right_margin_of_A + left_margin_of_B) * Width * some_multiplier.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.