← Back to team overview

kicad-developers team mailing list archive

Re: Questionably useful code

 

Le 11/03/2016 00:01, Jon Neal a écrit :
> Oh, I should add that to prevent breaking backwards compatibility the
> parser could just continue interpreting a missing size and thickness value
> with the current defaults hard coded there.

No problem for me to always store the text font size, especially in
board and fp files.

Of course, as you say, to avoid breaking backwards compatibility, the
default values (when the size is missing) must be not modified.

I am thinking this optimization was made more for the schematic (for new
schematic file format using S expr) than for Pcbnew.

In Pcbnew files, the thickness is never 0 and most of time the size of
texts is not 60 mils.

So we need the Wayne's opinion.

But, to tell the true, I do not understand why changing this current
code helps the library team.
In schematic files the text size is always stored.

Adding an option in the component editor to set the default component
text size (like for pin sizes) is better, very easy and allows each user
to choose this size.
Moreover, this option could be different for ref and value and for other
fields (especially the footprint field, which could be smaller)

> 
> On Thu, Mar 10, 2016 at 5:59 PM Jon Neal <reportingsjr@xxxxxxxxx> wrote:
> 
>> Hi,
>>
>> I was looking in to helping the library team by changing the default kicad
>> text size to 50 mils rather than the current 60 mils.
>>
>> Well, I discovered that the s-expr formatter and parser omits certain text
>> settings if they are the default. I assume this is to make kicad files
>> smaller which yay, but it means that we basically can't change the default
>> text size without breaking backwards compatibility. Huge, resounding BOOOOO.
>>
>> What I would like to request is that we remove the bit of code that omits
>> text size and thickness if they are default. This increases file size by
>> about 40ish chars/bytes. I think it is reasonable to still omit bold,
>> italic, justification, and whether the text is hidden or not.
>>
>> On a fairly dense board (thanks Andrew Zonenberg) there are about 1.3k
>> fp_text's so this would theoretically add ~50kB to a several MB file.
>>
>> Except it doesn't add nearly that much, because the kicad library doesn't
>> use the current default size anyways. So for a large portion of text this
>> code is useless anyways.
>>
>> Offending code is in common/eda_text.cpp:407
>>
>> Thoughts?
>> Jon
>>
> 
> 
> 
> _______________________________________________
> 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
> 


-- 
Jean-Pierre CHARRAS


Follow ups

References