← Back to team overview

kicad-developers team mailing list archive

Re: Tab handling in text rendering and bbox calculation

 

Howdy guys,

hate to burst your bubble. The tab/space issue appears consistent,
however the actual character alignment kind of sucks. Lower case a, b
etc. are only part of the equation. The big guys still seem to have some
sway.

Screen shot attached.

Cheers

On 12/11/19 5:24 pm, Seth Hillbrand wrote:
>
> 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".
>>  
>>  
>> image.png
>>  
>> 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!
>
>
> Best-
>
> Seth
>
>
> KiCad Services Corporation KiCad Services Corporation Logo
> Seth Hillbrand
> *Lead Developer*
> +1-530-302-5483‬ <tel:+12126039372>
> Davis, CA
> www.kipro-pcb.com <http://www.kipro-pcb.com/>    info@xxxxxxxxxxxxx
> <mailto:info@xxxxxxxxxxxxx>
> https://twitter.com/KiProEDA <https://twitter.com/KiProEDA>
> https://www.linkedin.com/company/kicad
> <https://www.linkedin.com/company/kicad>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

Attachment: text_box_alignment_Screenshot_2019-11-13_00-51-28.png
Description: PNG image

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References