Commit 0f250cba authored by Matthieu Cattin's avatar Matthieu Cattin

mec: add glass text design and howto create kicad module from bitmap.

parent 6c0535d0
1) Create text in inkscape at final size
2) Scale it up (e.g 1500%)
3) Select scale up version, File > Export bitmap...
4) Choose a file name (.png), default 300dpi is fine, Export
5) Open KiCad
6) In the project explorer, open Bitmap2Component
7) Load the bitmap
8) Select negative, Threshold = 50, Export
9) Scale down the generated module using scale_kicad_mod.py
scale_kicad_mod.py 0.0666 < old.kicad_mod > new.kicad_mod
10) Open KiCad's module editor
11) Select a library
12) Import the module
13) Save it (change the module name)
\ No newline at end of file
update=Thu 04 Sep 2014 12:47:38 AM CEST
version=1
last_client=kicad
[cvpcb]
version=1
NetIExt=net
[cvpcb/libraries]
EquName1=devcms
[eeschema]
version=1
LibDir=
NetFmtName=
RptD_X=0
RptD_Y=100
RptLab=1
LabSize=60
[eeschema/libraries]
LibName1=power
LibName2=device
LibName3=transistors
LibName4=conn
LibName5=linear
LibName6=regul
LibName7=74xx
LibName8=cmos4000
LibName9=adc-dac
LibName10=memory
LibName11=xilinx
LibName12=special
LibName13=microcontrollers
LibName14=dsp
LibName15=microchip
LibName16=analog_switches
LibName17=motorola
LibName18=texas
LibName19=intel
LibName20=audio
LibName21=interface
LibName22=digital-audio
LibName23=philips
LibName24=display
LibName25=cypress
LibName26=siliconi
LibName27=opto
LibName28=atmel
LibName29=contrib
LibName30=valves
[pcbnew]
version=1
LastNetListRead=
UseCmpFile=1
PadDrill=0.600000000000
PadDrillOvalY=0.600000000000
PadSizeH=1.500000000000
PadSizeV=1.500000000000
PcbTextSizeV=1.500000000000
PcbTextSizeH=1.500000000000
PcbTextThickness=0.300000000000
ModuleTextSizeV=1.000000000000
ModuleTextSizeH=1.000000000000
ModuleTextSizeThickness=0.150000000000
SolderMaskClearance=0.000000000000
SolderMaskMinWidth=0.000000000000
DrawSegmentWidth=0.200000000000
BoardOutlineThickness=0.100000000000
ModuleOutlineThickness=0.150000000000
[pcbnew/libraries]
LibDir=
LibName1=sockets
LibName2=connect
LibName3=discret
LibName4=pin_array
LibName5=divers
LibName6=smd_capacitors
LibName7=smd_resistors
LibName8=smd_crystal&oscillator
LibName9=smd_dil
LibName10=smd_transistors
LibName11=libcms
LibName12=display
LibName13=led
LibName14=dip_sockets
LibName15=pga_sockets
LibName16=valves
[general]
version=1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1052.3622"
height="744.09448"
id="svg4452"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="glass_text_fwatch.svg"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text/glass_text_fwatch.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300">
<defs
id="defs4454" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.5"
inkscape:cx="-228.60928"
inkscape:cy="-115.36857"
inkscape:document-units="px"
inkscape:current-layer="g3865"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1176"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1" />
<metadata
id="metadata4457">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-242.80627,590.46148)">
<g
style="display:inline"
id="g3865"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text/glass_text_fwatch.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300"
transform="translate(239.78016,-847.49014)">
<g
style="display:inline"
id="g3865-6"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text/glass_text_fwatch.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300"
transform="matrix(15,0,0,15,-139.81525,-14122.923)">
<text
inkscape:export-ydpi="300"
inkscape:export-xdpi="300"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text.png"
id="text3629-3-6-0"
y="987.14398"
x="11.807518"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;display:inline;font-family:'8BIT WONDER';-inkscape-font-specification:'8BIT WONDER'"
xml:space="preserve"><tspan
style="font-size:10px"
y="987.14398"
x="11.807518"
id="tspan3631-8-3-4"
sodipodi:role="line">F</tspan></text>
<text
inkscape:export-ydpi="300"
inkscape:export-xdpi="300"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text.png"
id="text3629-47-2-1"
y="987.14398"
x="32.263115"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;display:inline;font-family:'8BIT WONDER';-inkscape-font-specification:'8BIT WONDER'"
xml:space="preserve"><tspan
style="font-size:10px"
y="987.14398"
x="32.263115"
id="tspan3631-3-1-4"
sodipodi:role="line">watch</tspan></text>
<text
id="text3861-1"
y="986.40833"
x="22.647295"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:DejaVu Sans"
xml:space="preserve"><tspan
style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Verdana;-inkscape-font-specification:Verdana Bold"
y="986.40833"
x="22.647295"
id="tspan3863-0"
sodipodi:role="line">*</tspan></text>
</g>
<g
style="display:inline"
id="g3865-6-4"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text/glass_text_fwatch.png"
inkscape:export-xdpi="300"
inkscape:export-ydpi="300"
transform="translate(161.82413,-28.354171)">
<text
inkscape:export-ydpi="300"
inkscape:export-xdpi="300"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text.png"
id="text3629-3-6-0-4"
y="987.14398"
x="11.807518"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;display:inline;font-family:'8BIT WONDER';-inkscape-font-specification:'8BIT WONDER'"
xml:space="preserve"><tspan
style="font-size:10px"
y="987.14398"
x="11.807518"
id="tspan3631-8-3-4-3"
sodipodi:role="line">F</tspan></text>
<text
inkscape:export-ydpi="300"
inkscape:export-xdpi="300"
inkscape:export-filename="/home/mcattin/Documents/freewatch/mec/glass_text.png"
id="text3629-47-2-1-4"
y="987.14398"
x="32.263115"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;display:inline;font-family:'8BIT WONDER';-inkscape-font-specification:'8BIT WONDER'"
xml:space="preserve"><tspan
style="font-size:10px"
y="987.14398"
x="32.263115"
id="tspan3631-3-1-4-4"
sodipodi:role="line">watch</tspan></text>
<text
id="text3861-1-2"
y="986.40833"
x="22.647295"
style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:DejaVu Sans"
xml:space="preserve"><tspan
style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:Verdana;-inkscape-font-specification:Verdana Bold"
y="986.40833"
x="22.647295"
id="tspan3863-0-5"
sodipodi:role="line">*</tspan></text>
</g>
</g>
</g>
</svg>
#! /bin/sh
# given the scaled up module is 1500% bigger than final size
./scale_kicad_mod.py 0.0666 < glass_text_big.kicad_mod > glass_text.kicad_mod
#!/usr/bin/env python
"""
Scale kicad_mod format footprint.
$ scale_kicad_mod.py 0.3 < old.kicad_mod > new.kicad_mod
The MIT License
Copyright (c) 2013 David Siroky (siroky@dasir.cz)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
# $ scale_kicad_mod.py 0.25 < old.kicad_mod > new.kicad_mod
import sys
import re
###########################################################################
###########################################################################
def scale(kicad_mod, ratio):
def scale_xy(match):
return "xy %f %f" % (float(match.group(1)) * ratio,
float(match.group(2)) * ratio)
def scale_width(match):
return "width %f" % (float(match.group(1)) * ratio)
buf = re.sub(r"xy +(-?\d+.\d+) (-?\d+.\d+)", scale_xy, kicad_mod)
buf = re.sub(r"width +(\d+.\d+)", scale_width, buf)
return buf
###########################################################################
###########################################################################
print scale(sys.stdin.read(), float(sys.argv[1]))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment