The width depends on the number of characters in the Refdes, the font height and the type of font
For most fonts the character width is about the same as the height (and the same for all characters) but not for all.
Width = LEN(Refdes) * TextHeight
Example to calculate text height:
TextHeight = Placementoutlinewidth / LEN(Refdes) If textheight > placementoutlineHeight then TextHeight = placementoutlineHeight end if TextHeight = TextHeight * 0.9 'shrink 10%
Your information helped me on finding a way to calculate the aspect ratio's for the Refdes. Now I can resize the refdes and it wil fit
nicely inside the placement outline, more or less like it used to be in Boardstation.
Although there is an issue with non-rectangular outlines, but we will work on that.