← Back to team overview

kicad-developers team 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". 
> Regards, 
> Andrew

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 

 		Seth Hillbrand


 		+1-530-302-5483‬ [1]

 		Davis, CA

 		www.kipro-pcb.com [2]    info@xxxxxxxxxxxxx

 		https://twitter.com/KiProEDA [3]
 		https://www.linkedin.com/company/kicad [4]


[1] tel:+12126039372
[2] http://www.kipro-pcb.com/
[3] https://twitter.com/KiProEDA
[4] https://www.linkedin.com/company/kicad

Follow ups