kicad-developers team mailing list archive
Mailing list archive
Re: Tab handling in text rendering and bbox calculation
On 2019-11-11 17:48, Andrew Lutsenko wrote:
> Hi Seth, Jeff,
> I see you have touched this code recently. I've noticed that tabs are handled differently for bbox calculation resulting in slightly oversized bbox.
> When rendering tabs we count them as whatever width is needed to align to multiple of 4 and +1 additional space but when calculating bbox it is align to 4 spaces + '?' width, which is a bit wider.
> I attached a patch that fixes this particular issue to count tab as align to 4 spaces + 1 space.
> But I think this is confusing in general, why do we still render another space after aligning width to multiple of 4?
> Here is a picture of left-justified text in pcbnew. First line is "a<tab>b", second "<4 spaces>b", third "<5 spaces>b".
Good catch. I hadn't noticed that. The intention (in the comments) was
to align to the 4th column. I pushed a fix as well as yours to the
code. Thank you for your contribution to KiCad!
KiCad Services Corporation
www.kipro-pcb.com  info@xxxxxxxxxxxxx