← Back to team overview

kicad-developers team mailing list archive

Re: Tab handling in text rendering and bbox calculation

 

The artificial fattening of the middle of the character strokes suggests that Johannes has one of the subpixel anti-aliasing methods turned on.  While it doesn’t seem like that would have a cumulative effect of more than a single pixel, maybe it's somehow involved.

Johannes, does it change any if you set anti-aliasing to one of the supersampling methods?  (Preferences > Common > Accelerated Graphics)

> On 12 Nov 2019, at 11:57, Johannes Sprigode <jos@xxxxxxxxxxx> wrote:
> 
> 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".
>>>  
>>>  
>>> 
>>>  
>>> 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
>> 
>> 
>> 
>>  
>> 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 <https://launchpad.net/~kicad-developers>
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
>> More help   : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
> <text_box_alignment_Screenshot_2019-11-13_00-51-28.png>_______________________________________________
> 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


References