kicad-library-utils icon indicating copy to clipboard operation
kicad-library-utils copied to clipboard

Handle footprint name as string

Open akosmarton opened this issue 5 years ago • 6 comments

If the footprint name contains only numeric characters, it should be converted to string to ensure the proper rules checking.

akosmarton avatar Sep 13 '20 13:09 akosmarton

That is not a valid footprint name for this library. See our footprint naming scheme at https://kicad-pcb.org/libraries/klc/F3.6/. And these check scripts are for those guidelines/rules. So as @cpresser said, this doesn't hurt anything but it's not needed when building footprints that conform to the rules of this library.

evanshultz avatar Sep 14 '20 14:09 evanshultz

I think this is a use full addition anyway. The scripts should not throw a cryptic error message just because the user put in stupid input.

The next logical step is to create a F3.py that actually checks that rule. I just skimmed over the F3 section of KLC, and it seems there is no way a footprint can only contain numbers. So we could check that. And perhaps throw a warning if its number of characters is <3. And throw errors if it contains evil code-points (thinking of emojis, german umlauts, ...)

cpresser avatar Sep 14 '20 15:09 cpresser

german umlauts

Those are still considered evil? SCNR

chschlue avatar Sep 14 '20 15:09 chschlue

Bad jokes aside, we might have to (and be able to) relax naming rules. See https://github.com/KiCad/kicad-symbols/pull/2938

chschlue avatar Sep 14 '20 15:09 chschlue

Nevertheless, we can have a script output a warning if non latin chars are used. A good check would verify that any char is present in the kicad font. Basically an explicit whitelist.

Somewhat off-topic Footprint-names are also file-names. Yay! I have no clue how the Pi would do as filename for windows/linux/mac users. With different locales even more complication could arise.

cpresser avatar Sep 14 '20 16:09 cpresser

Yes, I'm not opposed to this PR.

OT: True, the π example is a symbol. But all supported platforms can handle multibyte filenames and assuming there have already been users calling their schematics MyCool80'sHeävÿMëtälPCB.sch or something without issue, I guess KiCad's codebase isn't too brittle.

Even more OT: I wonder how many ERP systems these π parts broke along the supply chain ;)

Edit: Not to mention Cyrillic/Greek/Arabic/whatever users in general.

chschlue avatar Sep 14 '20 16:09 chschlue