← Back to team overview

kicad-developers team mailing list archive

Re: Questionably useful code

 

I'm not opposed to adding a global font definition but adding the
default parameters for every single text definition would be
unacceptable.  I'm assuming you are going to include the font, weight,
italics, orientation, etc. information to this as well as they all have
default values which are currently not saved.

On 3/11/2016 3:05 PM, Adam Wolf wrote:
> I hope we don't add more things like this in the future.
> 
> Adding a header to the file with "default font size is 60 mils" or
> whatever, and setting omitted font size in the file to use the header
> value, would add only a few bytes over what the current is--except there
> wouldn't be a magic constant in KiCad we can't change without breaking
> backwards compatibility.
> 
> Adam Wolf
> 
> On Fri, Mar 11, 2016 at 7:34 AM, Wayne Stambaugh <stambaughw@xxxxxxxxx
> <mailto:stambaughw@xxxxxxxxx>> wrote:
> 
>     On 3/11/2016 2:55 AM, jp charras wrote:
>     > 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.
> 
>     You cannot change the default values or anyone who used the default
>     value text size and line width will end up with changes to their board.
>      How much of a problem this would be is questionable.  I doubt many
>     users use the default text size but it is the policy of the project not
>     to break backwards compatibility.  The short answer is you cannot
>     change it.
> 
>     >
>     > I am thinking this optimization was made more for the schematic (for new
>     > schematic file format using S expr) than for Pcbnew.
> 
>     The optimization is for the board because footprints are embedded in the
>     board file.  This can make a significant difference in board file size
>     on boards with lots of footprints.  It makes virtually no difference on
>     the footprint library files.  You are free to set them to whatever you
>     want.  If the footprint library devs decide to use something other than
>     the default for the all of the footprint text, I have no issues with
>     that.
> 
>     >
>     > 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.
> 
>     I honestly don't see what problem we are trying to solve. There is
>     nothing preventing you from using any text size you want in footprint
>     files.  You can always configure your footprint library editor to make
>     the default size for text to any value you would like.  That way you
>     don't have to go back and edit the text sizes after you create them.
> 
>     > 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
>     <mailto: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
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     >> Unsubscribe : https://launchpad.net/~kicad-developers
>     >> More help   : https://help.launchpad.net/ListHelp
>     >>
>     >
>     >
> 
> 
>     _______________________________________________
>     Mailing list: https://launchpad.net/~kicad-developers
>     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~kicad-developers
>     More help   : https://help.launchpad.net/ListHelp
> 
> 



Follow ups

References