KiCommand discussion and development - Easy pcbnew command line; 4.07 & 5.1.5/.6

The KiCommand version that includes preliminary font support has been published to github. You should plan to struggle with figuring it out. But here are the basic steps. Fonts can only be placed in the install directory. I know this is not optimal, but I plan to add search in user directory.

  1. Install fonttools in your system version of Python3. This should be installable with “pip install fonttools” into your main Python3 installation (or suitable virtual environment).
  2. Use fontimport.py command with Python3 with the installed fonttools. Use something similar to “python fontimport.py” on your command line to get help with the command.
  3. Output font files into location of kicommand plugin directory under “fontdata” (which you must manually create).
  4. The font name is pulled from the font file with dashes replacing spaces and first letter capitalized: something like “Noto-sans-regular”.
  5. Go into KiCommand and execute the following command:
    • Noto-sans-regular setfont
  6. Now enter your text similar to the following command:
    • “Here is the text on the board!” stringtogeom newdrawing refresh
  7. You should now see the text with the lower left baseline at 0, 0 and the size of text approximately 10/72" (3.5mm) tall.
  8. Use scaling and/or translation commands to resize and move the text.
    • S,4,Tmm,200,150 split “Text just right” stringtogeom append newdrawing refresh
  9. Use rotation commands to put the text on an angle:
    • S,4,R,45,Tmm,200,150 split “Rotated text” stringtogeom append newdrawing refresh

Edit: I forgot to include the brief update text

Initial font support, see “Font helpcat” and the independent Python script fontimport.py. Params is now a stack. Printing number of stack elements deferred to end of command. wxPointUtil no longer creates wxPoints, uses tuples instead. Added pprint (pretty print), toggleselect, getsymbolgeom. Added 2d transformations within geoms. Updated fcallargs to repeat shortest list. Added geoms “Polygon.” and “Hole” which extend a previous “Polygon”. New transformation commands in a geom: “S,Sx,Sy,R,Z,+T,T,Tmm,Tmil,Tmils,T+,T-” and removed mm, mil, and mils.