summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-23 23:36:49 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-23 23:36:49 +0000
commit0969085ddf607a7a98cf7fd6d9b10da5fbebe62d (patch)
tree59b2bc9ed3412ab2de4c703ef30342dfe2401704 /share/extensions
parentrefactor from lastApplied (diff)
parentFixed a bug pointed by suv running from comand line, also removed another des... (diff)
downloadinkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.tar.gz
inkscape-0969085ddf607a7a98cf7fd6d9b10da5fbebe62d.zip
fixing to trunk
(bzr r12588.1.34)
Diffstat (limited to 'share/extensions')
-rw-r--r--share/extensions/Barcode/Base.py31
-rw-r--r--share/extensions/Barcode/Code128.py49
-rw-r--r--share/extensions/Barcode/Code25i.py3
-rw-r--r--share/extensions/Barcode/Code39.py7
-rw-r--r--share/extensions/Barcode/Code39Ext.py6
-rw-r--r--share/extensions/Barcode/Code93.py2
-rw-r--r--share/extensions/Barcode/Ean13.py (renamed from share/extensions/Barcode/EAN13.py)2
-rw-r--r--share/extensions/Barcode/Ean5.py (renamed from share/extensions/Barcode/EAN5.py)6
-rw-r--r--share/extensions/Barcode/Ean8.py (renamed from share/extensions/Barcode/EAN8.py)2
-rw-r--r--share/extensions/Barcode/Makefile.am12
-rw-r--r--share/extensions/Barcode/Rm4scc.py (renamed from share/extensions/Barcode/RM4CC.py)2
-rw-r--r--share/extensions/Barcode/Upca.py (renamed from share/extensions/Barcode/UPCA.py)2
-rw-r--r--share/extensions/Barcode/Upce.py (renamed from share/extensions/Barcode/UPCE.py)6
-rw-r--r--share/extensions/Barcode/__init__.py61
-rw-r--r--share/extensions/Makefile.am4
-rw-r--r--share/extensions/README18
-rw-r--r--share/extensions/color_blackandwhite.inx1
-rwxr-xr-xshare/extensions/color_blackandwhite.py9
-rw-r--r--share/extensions/colors.xml1
-rw-r--r--share/extensions/dimension.inx2
-rw-r--r--share/extensions/dpiswitcher.inx29
-rw-r--r--share/extensions/dpiswitcher.py236
-rw-r--r--share/extensions/dxf_input.inx14
-rwxr-xr-xshare/extensions/dxf_input.py30
-rw-r--r--share/extensions/dxf_outlines.inx16
-rwxr-xr-xshare/extensions/dxf_outlines.py4
-rw-r--r--share/extensions/empty_business_card.inx32
-rw-r--r--share/extensions/empty_business_card.py45
-rw-r--r--share/extensions/empty_desktop.inx39
-rw-r--r--share/extensions/empty_desktop.py46
-rw-r--r--share/extensions/empty_dvd_cover.inx31
-rw-r--r--share/extensions/empty_dvd_cover.py64
-rw-r--r--share/extensions/empty_generic.inx47
-rw-r--r--share/extensions/empty_generic.py82
-rw-r--r--share/extensions/empty_icon.inx24
-rw-r--r--share/extensions/empty_icon.py36
-rw-r--r--share/extensions/empty_page.inx21
-rw-r--r--share/extensions/empty_page.py101
-rw-r--r--share/extensions/empty_video.inx35
-rw-r--r--share/extensions/empty_video.py46
-rwxr-xr-xshare/extensions/gcodetools.py4
-rw-r--r--share/extensions/gcodetools_area.inx2
-rw-r--r--share/extensions/gcodetools_dxf_points.inx2
-rw-r--r--share/extensions/gcodetools_engraving.inx2
-rw-r--r--share/extensions/gcodetools_graffiti.inx2
-rw-r--r--share/extensions/gcodetools_lathe.inx2
-rw-r--r--share/extensions/gcodetools_path_to_gcode.inx2
-rw-r--r--share/extensions/gimp_xcf.inx2
-rwxr-xr-xshare/extensions/gimp_xcf.py2
-rw-r--r--share/extensions/grid_polar.inx2
-rw-r--r--share/extensions/guides_creator.inx189
-rwxr-xr-xshare/extensions/guides_creator.py4
-rw-r--r--share/extensions/hershey.inx66
-rw-r--r--share/extensions/hpgl_decoder.py15
-rw-r--r--share/extensions/hpgl_input.inx38
-rw-r--r--share/extensions/hpgl_input.py4
-rw-r--r--share/extensions/hpgl_output.inx86
-rwxr-xr-xshare/extensions/inkex.py6
-rw-r--r--share/extensions/inkscape_help_relnotes.inx2
-rw-r--r--share/extensions/inkscape_help_reportabug.inx2
-rw-r--r--share/extensions/layout_nup.inx4
-rwxr-xr-xshare/extensions/layout_nup_pageframe.py2
-rw-r--r--share/extensions/measure.inx7
-rwxr-xr-xshare/extensions/measure.py87
-rwxr-xr-xshare/extensions/perfectboundcover.py2
-rw-r--r--share/extensions/plotter.inx158
-rw-r--r--share/extensions/print_win32_vector.py2
-rw-r--r--share/extensions/render_barcode.inx22
-rwxr-xr-xshare/extensions/render_barcode.py79
-rwxr-xr-xshare/extensions/render_barcode_datamatrix.py2
-rw-r--r--share/extensions/scour.inx2
-rw-r--r--share/extensions/scour.py10
-rw-r--r--share/extensions/seamless_pattern.inx20
-rw-r--r--share/extensions/seamless_pattern.py159
-rw-r--r--share/extensions/seamless_pattern.svg86
-rw-r--r--share/extensions/seamless_pattern_procedural.inx25
-rw-r--r--share/extensions/setup_typography_canvas.inx10
-rwxr-xr-xshare/extensions/setup_typography_canvas.py7
-rw-r--r--share/extensions/simplestyle.py1
-rwxr-xr-xshare/extensions/svg2fxg.xsl12
-rw-r--r--share/extensions/svg2xaml.inx1
-rwxr-xr-xshare/extensions/svg2xaml.xsl37
-rwxr-xr-xshare/extensions/svg_transform.py9
-rwxr-xr-xshare/extensions/synfig_prepare.py10
-rw-r--r--share/extensions/test/Makefile.am1
-rwxr-xr-xshare/extensions/test/render_barcode.test.py32
-rw-r--r--share/extensions/test/svg/default-inkscape-SVG.svg4
-rw-r--r--share/extensions/test/svg/default-plain-SVG.svg4
-rw-r--r--share/extensions/test/svg/empty-SVG.svg4
-rw-r--r--share/extensions/webslicer_create_rect.inx2
-rwxr-xr-xshare/extensions/yocto_css.py9
91 files changed, 1842 insertions, 606 deletions
diff --git a/share/extensions/Barcode/Base.py b/share/extensions/Barcode/Base.py
index b86185388..b7429f84f 100644
--- a/share/extensions/Barcode/Base.py
+++ b/share/extensions/Barcode/Base.py
@@ -34,6 +34,7 @@ class Barcode(object):
"""Cause an error to be reported"""
sys.stderr.write(
"Error encoding '%s' as %s barcode: %s\n" % (bar, self.name, msg))
+ return "ERROR"
def __init__(self, param={}):
self.document = param.get('document', None)
@@ -50,29 +51,33 @@ class Barcode(object):
self.width = len(self.string)
self.data = self.graphicalArray(self.string)
- def generate(self):
- """Generate the actual svg from the coding"""
- svg_uri = u'http://www.w3.org/2000/svg'
- if not self.string or not self.data:
- return
+ def get_id(self):
+ """Get the next useful id"""
if not self.document:
- return self.error("No document defined")
-
- data = self.data
- # Collect document ids
+ return "barcode"
doc_ids = {}
docIdNodes = self.document.xpath('//@id')
for m in docIdNodes:
doc_ids[m] = 1
- # We don't have svg documents so lets do something raw:
name = 'barcode'
- # Make sure that the id/name is inique
index = 0
while (doc_ids.has_key(name)):
- name = 'barcode' + str(index)
- index = index + 1
+ index += 1
+ name = 'barcode%d' % index
+ return name
+
+ def generate(self):
+ """Generate the actual svg from the coding"""
+ svg_uri = u'http://www.w3.org/2000/svg'
+ if self.string == 'ERROR':
+ return
+ if not self.string or not self.data:
+ raise ValueError("No string specified for barcode.")
+
+ data = self.data
+ name = self.get_id()
# use an svg group element to contain the barcode
barcode = etree.Element('{%s}%s' % (svg_uri,'g'))
diff --git a/share/extensions/Barcode/Code128.py b/share/extensions/Barcode/Code128.py
index 8734fc330..618ce7817 100644
--- a/share/extensions/Barcode/Code128.py
+++ b/share/extensions/Barcode/Code128.py
@@ -27,7 +27,29 @@ from Base import Barcode
import math
import re
-map = [ '11011001100','11001101100','11001100110','10010011000','10010001100','10001001100','10011001000','10011000100','10001100100','11001001000','11001000100','11000100100','10110011100','10011011100','10011001110','10111001100','10011101100','10011100110','11001110010','11001011100','11001001110','11011100100','11001110100','11101101110','11101001100','11100101100','11100100110','11101100100','11100110100','11100110010','11011011000','11011000110','11000110110','10100011000','10001011000','10001000110','10110001000','10001101000','10001100010','11010001000','11000101000','11000100010','10110111000','10110001110','10001101110','10111011000','10111000110','10001110110','11101110110','11010001110','11000101110','11011101000','11011100010','11011101110','11101011000','11101000110','11100010110','11101101000','11101100010','11100011010','11101111010','11001000010','11110001010','10100110000','10100001100','10010110000','10010000110','10000101100','10000100110','10110010000','10110000100','10011010000','10011000010','10000110100','10000110010','11000010010','11001010000','11110111010','11000010100','10001111010','10100111100','10010111100','10010011110','10111100100','10011110100','10011110010','11110100100','11110010100','11110010010','11011011110','11011110110','11110110110','10101111000','10100011110','10001011110','10111101000','10111100010','11110101000','11110100010','10111011110','10111101110','11101011110','11110101110','11010000100','11010010000','11010011100','11000111010','11' ]
+codeMap = [
+ '11011001100','11001101100','11001100110','10010011000','10010001100',
+ '10001001100','10011001000','10011000100','10001100100','11001001000',
+ '11001000100','11000100100','10110011100','10011011100','10011001110',
+ '10111001100','10011101100','10011100110','11001110010','11001011100',
+ '11001001110','11011100100','11001110100','11101101110','11101001100',
+ '11100101100','11100100110','11101100100','11100110100','11100110010',
+ '11011011000','11011000110','11000110110','10100011000','10001011000',
+ '10001000110','10110001000','10001101000','10001100010','11010001000',
+ '11000101000','11000100010','10110111000','10110001110','10001101110',
+ '10111011000','10111000110','10001110110','11101110110','11010001110',
+ '11000101110','11011101000','11011100010','11011101110','11101011000',
+ '11101000110','11100010110','11101101000','11101100010','11100011010',
+ '11101111010','11001000010','11110001010','10100110000','10100001100',
+ '10010110000','10010000110','10000101100','10000100110','10110010000',
+ '10110000100','10011010000','10011000010','10000110100','10000110010',
+ '11000010010','11001010000','11110111010','11000010100','10001111010',
+ '10100111100','10010111100','10010011110','10111100100','10011110100',
+ '10011110010','11110100100','11110010100','11110010010','11011011110',
+ '11011110110','11110110110','10101111000','10100011110','10001011110',
+ '10111101000','10111100010','11110101000','11110100010','10111011110',
+ '10111101110','11101011110','11110101110','11010000100','11010010000',
+ '11010011100','11000111010','11' ]
def mapExtra(sd, chars):
result = list(sd)
@@ -44,7 +66,8 @@ charAB = list(' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^
charA = mapExtra(charAB, range(0, 31)) # Offset 64
charB = mapExtra(charAB, range(96, 125)) # Offset -32
-class Object(Barcode):
+class Code128(Barcode):
+ """Main barcode object, generates the encoding bits here"""
def encode(self, text):
result = ''
blocks = []
@@ -65,7 +88,7 @@ class Object(Barcode):
if block:
blocks.append(self.bestBlock(block))
block = '';
-
+
self.inclabel = text
return self.encodeBlocks(blocks)
@@ -74,12 +97,12 @@ class Object(Barcode):
if block.upper() == block:
return [ 'A', block ]
return [ 'B', block ]
-
+
def encodeBlocks(self, blocks):
total = 0
pos = 0
encode = '';
-
+
for block in blocks:
set = block[0]
datum = block[1]
@@ -103,7 +126,7 @@ class Object(Barcode):
i = 1
total = total + num * i
- encode = encode + map[num]
+ encode = encode + codeMap[num]
pos = pos + 1
if set == 'A' or set == 'B':
@@ -113,18 +136,18 @@ class Object(Barcode):
for char in datum:
total = total + (chars.index(char) * pos)
- encode = encode + map[chars.index(char)]
+ encode = encode + codeMap[chars.index(char)]
pos = pos + 1
else:
for char in (datum[i:i+2] for i in range(0, len(datum), 2)):
total = total + (int(char) * pos)
- encode = encode + map[int(char)]
+ encode = encode + codeMap[int(char)]
pos = pos + 1
-
+
checksum = total % 103
- encode = encode + map[checksum]
- encode = encode + map[106]
- encode = encode + map[107]
-
+ encode = encode + codeMap[checksum]
+ encode = encode + codeMap[106]
+ encode = encode + codeMap[107]
+
return encode
diff --git a/share/extensions/Barcode/Code25i.py b/share/extensions/Barcode/Code25i.py
index 518a306f2..51346be60 100644
--- a/share/extensions/Barcode/Code25i.py
+++ b/share/extensions/Barcode/Code25i.py
@@ -34,14 +34,13 @@ encoding = {
'7' : '00011',
'8' : '10010',
'9' : '01010',
-
}
# Start and stop code are already encoded into white (0) and black(1) bars
start_code = '1010'
stop_code = '1101'
-class Object(Barcode):
+class Code25i(Barcode):
# Convert a text into string binary of black and white markers
def encode(self, number):
self.label = number
diff --git a/share/extensions/Barcode/Code39.py b/share/extensions/Barcode/Code39.py
index 64b22f352..ade397463 100644
--- a/share/extensions/Barcode/Code39.py
+++ b/share/extensions/Barcode/Code39.py
@@ -68,7 +68,7 @@ encoding = {
' ' : '011000100',
}
-class Object(Barcode):
+class Code39(Barcode):
# Convert a text into string binary of black and white markers
def encode(self, text):
text = text.upper()
@@ -93,10 +93,7 @@ class Object(Barcode):
encoded = encoded + colour + colour
else:
encoded = encoded + colour
- if colour == '1':
- colour = '0'
- else:
- colour = '1'
+ colour = colour == '1' and '0' or '1'
self.inclabel = text
return encoded;
diff --git a/share/extensions/Barcode/Code39Ext.py b/share/extensions/Barcode/Code39Ext.py
index 8f1e77826..b6df47de2 100644
--- a/share/extensions/Barcode/Code39Ext.py
+++ b/share/extensions/Barcode/Code39Ext.py
@@ -19,7 +19,7 @@
Python barcode renderer for Code39 Extended barcodes. Designed for Inkscape.
"""
-import Code39
+from Code39 import Code39
encode = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
@@ -46,7 +46,7 @@ mapB = getMap(range(1, 26)) # $
mapC = getMap(range(33, 58)) # /
mapD = getMap(range(97, 122)) # +
-class Object(Code39.Object):
+class Code39Ext(Code39):
def encode(self, text):
# We are only going to extend the Code39 barcodes
result = ''
@@ -61,5 +61,5 @@ class Object(Code39.Object):
char = '+' + mapD[char]
result = result + char
- return Code39.Object.encode(self, result);
+ return Code39.encode(self, result);
diff --git a/share/extensions/Barcode/Code93.py b/share/extensions/Barcode/Code93.py
index 76cbf683b..866ec6036 100644
--- a/share/extensions/Barcode/Code93.py
+++ b/share/extensions/Barcode/Code93.py
@@ -56,7 +56,7 @@ mapD = getMap(range(97, 122)) # +
encoding = '100010100 101001000 101000100 101000010 100101000 100100100 100100010 101010000 100010010 100001010 110101000 110100100 110100010 110010100 110010010 110001010 101101000 101100100 101100010 100110100 100011010 101011000 101001100 101000110 100101100 100010110 110110100 110110010 110101100 110100110 110010110 110011010 101101100 101100110 100110110 100111010 100101110 111010100 111010010 111001010 101101110 101110110 110101110 100100110 111011010 111010110 100110010 101011110'.split()
-class Object(Barcode):
+class Code93(Barcode):
def encode(self, text):
# start marker
bits = self.encode93('MARKER')
diff --git a/share/extensions/Barcode/EAN13.py b/share/extensions/Barcode/Ean13.py
index 41681173b..3bad5d6e5 100644
--- a/share/extensions/Barcode/EAN13.py
+++ b/share/extensions/Barcode/Ean13.py
@@ -23,7 +23,7 @@ Python barcode renderer for EAN13 barcodes. Designed for use with Inkscape.
from BaseEan import EanBarcode
-class Object(EanBarcode):
+class Ean13(EanBarcode):
"""Provide an Ean13 barcode generator"""
name = 'ean13'
lengths = [ 12 ]
diff --git a/share/extensions/Barcode/EAN5.py b/share/extensions/Barcode/Ean5.py
index 68ff99738..1bd26a4bd 100644
--- a/share/extensions/Barcode/EAN5.py
+++ b/share/extensions/Barcode/Ean5.py
@@ -25,14 +25,14 @@ from BaseEan import EanBarcode
FAMS = [ '11000','10100','10010','10001','01100','00110','00011','01010','01001','00101' ]
START = '01011'
-class Object(EanBarcode):
+class Ean5(EanBarcode):
"""Provide an Ean5 barcode generator"""
name = 'ean5'
length = 5
def _encode(self, number):
- self.x += 110.0 # horiz offset so it does not overlap EAN13
- self.y -= self.height + 5 # move the text to the top
+ self.x += 110.0*self.scale # horiz offset so it does not overlap EAN13
+ self.y -= (self.height + 5)*self.scale # move the text to the top
self.label = ' '.join(self.space(number))
family = sum([int(n)*int(m) for n,m in zip(number, '39393')]) % 10
return START + '01'.join(self.encode_interleaved(family, number, FAMS))
diff --git a/share/extensions/Barcode/EAN8.py b/share/extensions/Barcode/Ean8.py
index 05b4d7bb7..83e82814a 100644
--- a/share/extensions/Barcode/EAN8.py
+++ b/share/extensions/Barcode/Ean8.py
@@ -21,7 +21,7 @@ Python barcode renderer for EAN8 barcodes. Designed for use with Inkscape.
from BaseEan import EanBarcode
-class Object(EanBarcode):
+class Ean8(EanBarcode):
"""Provide an EAN8 barcode generator"""
name = 'ean8'
lengths = [ 7 ]
diff --git a/share/extensions/Barcode/Makefile.am b/share/extensions/Barcode/Makefile.am
index 691120cb6..7a1e889c0 100644
--- a/share/extensions/Barcode/Makefile.am
+++ b/share/extensions/Barcode/Makefile.am
@@ -9,13 +9,13 @@ barcode_DATA = \
Code39.py \
Code25i.py \
Code93.py \
- EAN13.py \
- EAN8.py \
- EAN5.py \
+ Ean13.py \
+ Ean8.py \
+ Ean5.py \
__init__.py \
- RM4CC.py \
- UPCA.py \
- UPCE.py
+ Rm4scc.py \
+ Upca.py \
+ Upce.py
EXTRA_DIST = \
$(barcode_DATA)
diff --git a/share/extensions/Barcode/RM4CC.py b/share/extensions/Barcode/Rm4scc.py
index d980c6c86..0fb154280 100644
--- a/share/extensions/Barcode/RM4CC.py
+++ b/share/extensions/Barcode/Rm4scc.py
@@ -65,7 +65,7 @@ map = {
check = ['ZUVWXY','501234','B6789A','HCDEFG','NIJKLM','TOPQRS']
(BAR_TRACK, BAR_DOWN, BAR_UP, BAR_FULL, BAR_NONE, WHITE_SPACE) = range(6)
-class Object(Barcode):
+class Rm4scc(Barcode):
def encode(self, text):
result = ''
diff --git a/share/extensions/Barcode/UPCA.py b/share/extensions/Barcode/Upca.py
index 6ac10943c..d69ed11e6 100644
--- a/share/extensions/Barcode/UPCA.py
+++ b/share/extensions/Barcode/Upca.py
@@ -21,7 +21,7 @@ Python barcode renderer for UPCA barcodes. Designed for use with Inkscape.
from BaseEan import EanBarcode
-class Object(EanBarcode):
+class Upca(EanBarcode):
"""Provides a renderer for EAN12 aka UPC-A Barcodes"""
name = 'upca'
lengths = [ 11 ]
diff --git a/share/extensions/Barcode/UPCE.py b/share/extensions/Barcode/Upce.py
index dba5d48ea..eee2a739c 100644
--- a/share/extensions/Barcode/UPCE.py
+++ b/share/extensions/Barcode/Upce.py
@@ -27,7 +27,7 @@ import sys
FAMS = [ '111000', '110100', '110010', '110001', '101100',
'100110', '100011', '101010', '101001', '100101' ]
-class Object(EanBarcode):
+class Upce(EanBarcode):
"""Generate EAN6/UPC-E barcode generator"""
name = 'upce'
lengths = [ 6, 11 ]
@@ -56,7 +56,7 @@ class Object(EanBarcode):
# All UPC-E Numbers use number system 0
if number[0] != '0' or len(number)!=11:
# If not then the code is invalid
- return None
+ raise ValueError("Invalid UPC Number")
# Most of the conversions deal
# with the specific code parts
@@ -83,7 +83,7 @@ class Object(EanBarcode):
return manufacturer + product[4]
else:
# Invalid UPC-A Numbe
- return None
+ raise ValueError("Invalid UPC Number")
def ConvertEtoA(self, number):
"""Convert UPC-E to UPC-A by padding with zeros"""
diff --git a/share/extensions/Barcode/__init__.py b/share/extensions/Barcode/__init__.py
index 370839f45..e4e328ae3 100644
--- a/share/extensions/Barcode/__init__.py
+++ b/share/extensions/Barcode/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2010 Martin Owens
+# Copyright (C) 2014 Martin Owens
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,10 +16,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""
-Renderer for barcodes, SVG extention for Inkscape.
+Renderer for barcodes, SVG extention for Inkscape.
For supported barcodes see Barcode module directory.
-
"""
# This lists all known Barcodes missing from this package
@@ -40,45 +39,19 @@ For supported barcodes see Barcode module directory.
import sys
-def getBarcode(format, param={}):
- if format:
- format = str(format).lower()
- format = format.replace('-', '')
- format = format.replace(' ', '')
- if format=='code25i':
- import Code25i
- return Code25i.Object(param)
- elif format=='code39':
- import Code39
- return Code39.Object(param)
- elif format=='code39ext':
- import Code39Ext
- return Code39Ext.Object(param)
- elif format=='code93':
- import Code93
- return Code93.Object(param)
- elif format=='code128':
- import Code128
- return Code128.Object(param)
-
- elif format in ['rm4cc', 'rm4scc']:
- import RM4CC
- return RM4CC.Object(param)
-
- elif format == 'upca':
- import UPCA
- return UPCA.Object(param)
- elif format == 'upce':
- import UPCE
- return UPCE.Object(param)
- elif format == 'ean5':
- import EAN5
- return EAN5.Object(param)
- elif format in ['ean8', 'ucc8']:
- import EAN8
- return EAN8.Object(param)
- elif format in ['ean13', 'ucc13','jan']:
- import EAN13
- return EAN13.Object(param)
- sys.stderr.write("Invalid format for barcode: " + str(format) + "\n")
+def getBarcode(code, **kwargs):
+ """Gets a barcode from a list of available barcode formats"""
+ if not code:
+ return sys.stderr.write("No barcode format given!\n")
+
+
+ code = str(code).replace('-', '').strip()
+ try:
+ barcode = getattr(__import__('Barcode.'+code, fromlist=['Barcode']), code)
+ return barcode(kwargs)
+ except ImportError:
+ sys.stderr.write("Invalid type of barcode: %s\n" % code)
+ except AttributeError:
+ raise
+ sys.stderr.write("Barcode module is missing the barcode class: %s\n" % code)
diff --git a/share/extensions/Makefile.am b/share/extensions/Makefile.am
index 2c1e23954..d9d56a362 100644
--- a/share/extensions/Makefile.am
+++ b/share/extensions/Makefile.am
@@ -24,9 +24,11 @@ otherstuff_DATA = \
aisvg.xslt \
colors.xml \
jessyInk_video.svg \
+ seamless_pattern.svg \
svg2fxg.xsl \
svg2xaml.xsl \
- xaml2svg.xsl
+ xaml2svg.xsl \
+ inkscape.extension.rng
module_DATA = $(wildcard $(srcdir)/*.inx)
diff --git a/share/extensions/README b/share/extensions/README
index ba0251dc4..0d6e544e8 100644
--- a/share/extensions/README
+++ b/share/extensions/README
@@ -1,10 +1,12 @@
-This folder contains Inkscape extensions, i.e. the scripts
-that implement some commands that you can use from within
-Inkscape. Most of these commands are in the Effects menu.
+This folder contains Inkscape extensions, i.e. the scripts that
+implement some commands that you can use from within Inkscape. Most of
+these commands are in the Extensions menu.
-Each *.inx file describes an extension,
-listing its name, purpose, prerequisites, etc. These
-files are read by Inkscape on launch. Other files are
-the scripts themselves (Perl, Python, and Ruby are
-supported, as well as shell scripts).
+Each *.inx file describes an extension, listing its name, purpose,
+prerequisites, location within the menu, etc. These files are read by
+Inkscape on launch. Other files are the scripts themselves (Perl,
+Python, and Ruby are supported, as well as shell scripts).
+Only include extensions here which are GPL-compatible. This includes
+Apache-2, MPL 1.1, certain Creative Commons licenses, and more. See
+https://www.gnu.org/licenses/license-list.html for guidance.
diff --git a/share/extensions/color_blackandwhite.inx b/share/extensions/color_blackandwhite.inx
index 8432ab2d3..0fa58a128 100644
--- a/share/extensions/color_blackandwhite.inx
+++ b/share/extensions/color_blackandwhite.inx
@@ -5,6 +5,7 @@
<dependency type="executable" location="extensions">coloreffect.py</dependency>
<dependency type="executable" location="extensions">color_blackandwhite.py</dependency>
<dependency type="executable" location="extensions">simplestyle.py</dependency>
+ <param name="threshold" type="int" min="1" max="255" _gui-text="Threshold Color (1-255):">127</param>
<effect>
<object-type>all</object-type>
<effects-menu>
diff --git a/share/extensions/color_blackandwhite.py b/share/extensions/color_blackandwhite.py
index 57e6e2ae8..fcee057c7 100755
--- a/share/extensions/color_blackandwhite.py
+++ b/share/extensions/color_blackandwhite.py
@@ -2,12 +2,19 @@
import coloreffect,sys
class C(coloreffect.ColorEffect):
+ def __init__(self):
+ coloreffect.ColorEffect.__init__(self)
+ self.OptionParser.add_option("-t", "--threshold",
+ action="store", type="int",
+ dest="threshold", default=127,
+ help="Threshold Color Level")
+
def colmod(self,r,g,b):
#ITU-R Recommendation BT.709
#l = 0.2125 * r + 0.7154 * g + 0.0721 * b
#NTSC and PAL
l = 0.299 * r + 0.587 * g + 0.114 * b
- if l > 127:
+ if l > self.options.threshold:
ig = 255
else:
ig = 0
diff --git a/share/extensions/colors.xml b/share/extensions/colors.xml
index 51167fdd7..7ed8592d5 100644
--- a/share/extensions/colors.xml
+++ b/share/extensions/colors.xml
@@ -119,6 +119,7 @@
<color name="plum" hex="#dda0dd" rgb="221,160,221" />
<color name="powderblue" hex="#b0e0e6" rgb="176,224,230" />
<color name="purple" hex="#800080" rgb="128,0,128" />
+<color name="rebeccapurple" hex="#663399" rgb="102,51,153" />
<color name="red" hex="#ff0000" rgb="255,0,0" />
<color name="rosybrown" hex="#bc8f8f" rgb="188,143,143" />
<color name="royalblue" hex="#4169e1" rgb="65,105,225" />
diff --git a/share/extensions/dimension.inx b/share/extensions/dimension.inx
index 343ad27bf..d89e5afa4 100644
--- a/share/extensions/dimension.inx
+++ b/share/extensions/dimension.inx
@@ -7,7 +7,7 @@
<dependency type="executable" location="extensions">pathmodifier.py</dependency>
<param name="xoffset" type="float" min="0" max="1000" _gui-text="X Offset:">50</param>
<param name="yoffset" type="float" min="0" max="1000" _gui-text="Y Offset:">50</param>
- <param name="type" type="enum" _gui-text="Bounding box type :">
+ <param name="type" type="enum" _gui-text="Bounding box type:">
<_item value="geometric">Geometric</_item>
<_item value="visual">Visual</_item>
</param>
diff --git a/share/extensions/dpiswitcher.inx b/share/extensions/dpiswitcher.inx
new file mode 100644
index 000000000..a4f487c97
--- /dev/null
+++ b/share/extensions/dpiswitcher.inx
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <inkscape-extension xmlns=
+ "http://www.inkscape.org/namespace/inkscape/extension">
+ <_name>DPI Switcher</_name>
+ <id>org.inkscape.dpiswitcher</id>
+ <dependency type="executable" location="extensions">dpiswitcher.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+ <param name="action" type="notebook">
+ <page name="dpi_swicher" _gui-text="Switch DPI">
+ <param name="switcher" type="enum" _gui-text="Type of convert:">
+ <_item value="0">DPI Switch from 90 to 96</_item>
+ <_item value="1">DPI Switch from 96 to 90</_item>
+ </param>
+ </page>
+ <page name="page_info" _gui-text="Show page info">
+ <_param name="d" type="description">Choose this tab if you would like to see page info previously to apply DPI Switcher.</_param>
+ </page>
+ </param>
+
+ <effect needs-live-preview="false" needs-document="no">
+ <object-type>all</object-type>
+ <effects-menu>
+ <submenu _name="Document"/>
+ </effects-menu>
+ </effect>
+ <script>
+ <command reldir="extensions" interpreter="python">dpiswitcher.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/dpiswitcher.py b/share/extensions/dpiswitcher.py
new file mode 100644
index 000000000..b110c259f
--- /dev/null
+++ b/share/extensions/dpiswitcher.py
@@ -0,0 +1,236 @@
+#!/usr/bin/env python
+'''
+This extension scale or reduce a document to fit diferent SVG DPI -90/96-
+
+Copyright (C) 2012 Jabiertxo Arraiza, jabier.arraiza@marker.es
+
+Version 0.4 - DPI Switcher
+
+TODO:
+Comment Better!!!
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+'''
+
+import inkex, sys, re, string
+from lxml import etree
+
+class DPISwitcher(inkex.Effect):
+
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("--switcher", action="store",
+ type="string", dest="switcher", default="0",
+ help="Select the DPI switch you want")
+ self.OptionParser.add_option("--action", action="store",
+ type="string", dest="action",
+ default=None, help="")
+ self.factor = 90.0/96.0
+ self.units = "px"
+ self.unitExponent = 1.0
+
+ def scaleRoot(self, svg):
+ widthNumber = re.sub("[a-zA-Z]", "", svg.get('width'))
+ heightNumber = re.sub("[a-zA-Z]", "", svg.get('height'))
+ if svg.get('viewBox'):
+ widthNumber = svg.get('viewBox').split(" ")[2]
+ heightNumber = svg.get('viewBox').split(" ")[3]
+ widthDoc = str(float(widthNumber) * self.factor * self.unitExponent)
+ heightDoc = str(float(heightNumber) * self.factor * self.unitExponent)
+ if svg.get('height'):
+ svg.set('height', heightDoc)
+ if svg.get('width'):
+ svg.set('width', widthDoc)
+ svg.set('viewBox',"0 0 " + widthDoc + " " + heightDoc)
+ self.scaleGuides(svg)
+ self.scaleGrid(svg)
+ if self.options.switcher == "1":
+ self.factor = self.factor * self.unitExponent
+ xpathStr = '//svg:rect | //svg:image | //svg:path | //svg:circle | //svg:ellipse | //svg:text'
+ elements = svg.xpath(xpathStr, namespaces=inkex.NSS)
+ for element in elements:
+ box3DSide = element.get(inkex.addNS('box3dsidetype', 'inkscape'))
+ if box3DSide:
+ continue
+ if element.get('transform'):
+ if "matrix" in str(element.get('transform')):
+ result = re.sub(r".*?matrix( \(|\()(.*?)\)", self.matrixElement, str(element.get('transform')))
+ element.set('transform', result)
+ if "scale" in str(element.get('transform')):
+ result = re.sub(r".*?scale( \(|\()(.*?)\)", self.scaleElement, str(element.get('transform')))
+ element.set('transform', result)
+ if "translate" in str(element.get('transform')):
+ result = re.sub(r".*?translate( \(|\()(.*?)\)", self.translateElement, str(element.get('transform')))
+ element.set('transform', result)
+ if "skew" in str(element.get('transform')):
+ result = re.sub(r".*?skew( \(|\()(.*?)\)", self.skewElement, str(element.get('transform')))
+ element.set('transform', result)
+ if "scale" not in str(element.get('transform')) and "matrix" not in str(element.get('transform')):
+ element.set('transform', str(element.get('transform')) + "scale(" + str(self.factor) + ", " + str(self.factor) + ")")
+ else:
+ element.set('transform', "scale(" + str(self.factor) + ", " + str(self.factor) + ")")
+ xpathStr = '//svg:g'
+ elements = svg.xpath(xpathStr, namespaces=inkex.NSS)
+ for element in elements:
+ if element.get('transform'):
+ if "matrix" in str(element.get('transform')):
+ result = re.sub(r".*?matrix( \(|\()(.*?)\)", self.matrixGroupElement, str(element.get('transform')))
+ element.set('transform', result)
+ if "translate" in str(element.get('transform')):
+ result = re.sub(r".*?translate( \(|\()(.*?)\)", self.translateElement, str(element.get('transform')))
+ element.set('transform', result)
+ if "skew" in str(element.get('transform')):
+ result = re.sub(r".*?skew( \(|\()(.*?)\)", self.skewElement, str(element.get('transform')))
+ element.set('transform', result)
+
+ def scaleGuides(self, svg):
+ xpathStr = '//sodipodi:guide'
+ guides = svg.xpath(xpathStr, namespaces=inkex.NSS)
+ for guide in guides:
+ point = string.split(guide.get("position"), ",")
+ guide.set("position", str(float(point[0].strip()) * self.factor ) + "," + str(float(point[1].strip()) * self.factor ))
+
+ def scaleGrid(self, svg):
+ xpathStr = '//inkscape:grid'
+ grids = svg.xpath(xpathStr, namespaces=inkex.NSS)
+ for grid in grids:
+ if self.options.switcher == "0":
+ self.unitExponent = 1.0/(self.factor/self.__uuconv[grid.get("units")])
+ self.factor = self.factor * self.unitExponent
+ grid.set("units", "px")
+ if grid.get("spacingx"):
+ spacingx = str(float(re.sub("[a-zA-Z]", "", grid.get("spacingx"))) * self.factor) + "px"
+ grid.set("spacingx", str(spacingx))
+ if grid.get("spacingy"):
+ spacingy = str(float(re.sub("[a-zA-Z]", "", grid.get("spacingy"))) * self.factor) + "px"
+ grid.set("spacingy", str(spacingy))
+ if grid.get("originx"):
+ originx = str(float(re.sub("[a-zA-Z]", "", grid.get("originx"))) * self.factor) + "px"
+ grid.set("originx", str(originx))
+ if grid.get("originy"):
+ originy = str(float(re.sub("[a-zA-Z]", "", grid.get("originy"))) * self.factor) + "px"
+ grid.set("originy", str(originy))
+
+ #a dictionary of unit to user unit conversion factors
+ __uuconv = {'in':96.0, 'pt':1.33333333333, 'px':1.0, 'mm':3.77952755913, 'cm':37.7952755913,
+ 'm':3779.52755913, 'km':3779527.55913, 'pc':16.0, 'yd':3456.0 , 'ft':1152.0}
+
+ __uuconvLegazy = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'm':3543.3070866,
+ 'km':3543307.0866, 'pc':15.0, 'yd':3240 , 'ft':1080}
+
+ def scaleElement(self, m):
+ scaleVal = m.group(2).replace(" ","")
+ total = scaleVal.count(',')
+ if total == 1:
+ scaleVal = scaleVal.split(",")
+ return "scale(" + str(float(scaleVal[0]) * self.factor) + "," + str(float(scaleVal[1]) * self.factor) + ")"
+ else:
+ return "scale(" + str(float(scaleVal) * self.factor) + ")"
+
+
+ def translateElement(self, m):
+ translateVal = m.group(2).replace(" ","")
+ total = translateVal.count(',')
+ if total == 1:
+ translateVal = translateVal.split(",")
+ return "translate(" + str(float(translateVal[0]) * self.factor) + "," + str(float(translateVal[1]) * self.factor) + ")"
+ else:
+ return "translate(" + str(float(translateVal) * self.factor) + ")"
+
+ def skewElement(self, m):
+ skeweVal = m.group(2).replace(" ","")
+ total = skewVal.count(',')
+ if total == 1:
+ skeweVal = skewVal.split(",")
+ return "skew(" + str(float(skewVal[0]) * self.factor) + "," + str(float(skewVal[1]) * self.factor) + ")"
+ else:
+ return "skew(" + str(float(skewVal) * self.factor) + ")"
+
+ def matrixElement(self, m):
+ matrixVal = m.group(2).replace(" ","")
+ total = matrixVal.count(',')
+ matrixVal = matrixVal.split(",")
+ if total > 2:
+ return "matrix(" + str(float(matrixVal[0]) * self.factor) + "," + str(float(matrixVal[1]) * self.factor) + "," + str(float(matrixVal[2]) * self.factor) + "," + str(float(matrixVal[3]) * self.factor) + "," + str(float(matrixVal[4]) * self.factor) + "," + str(float(matrixVal[5]) * self.factor) + ")"
+ else:
+ return "matrix(" + str(float(matrixVal[0]) * self.factor) + "," + str(float(matrixVal[1]) * self.factor) + "," + str(float(matrixVal[2]) * self.factor) + ")"
+
+ def matrixGroupElement(self, m):
+ matrixVal = m.group(2).replace(" ","")
+ total = matrixVal.count(',')
+ matrixVal = matrixVal.split(",")
+ if total > 2:
+ return "matrix(" + matrixVal[0] + "," + str(float(matrixVal[1]) * self.factor) + "," + matrixVal[2] + "," + str(float(matrixVal[3]) * self.factor) + "," + str(float(matrixVal[4]) * self.factor) + "," + str(float(matrixVal[5]) * self.factor) + ")"
+ else:
+ return "matrix(" + matrixVal[0] + "," + str(float(matrixVal[1]) * self.factor) + "," + str(float(matrixVal[2]) * self.factor) + ")"
+
+ def effect(self):
+ action = self.options.action.strip("\"") # TODO Is this a bug? (Extra " characters)
+ saveout = sys.stdout
+ sys.stdout = sys.stderr
+ svg = self.document.getroot()
+ if action == "page_info":
+ print ":::SVG document related info:::"
+ width = svg.get('width')
+ if width:
+ print "width: " + width
+ height = svg.get('height')
+ if height:
+ print "height: " + height
+ viewBox = svg.get('viewBox')
+ if viewBox:
+ print "viewBox: " + viewBox
+ namedview = svg.find(inkex.addNS('namedview', 'sodipodi'))
+ docunits= namedview.get(inkex.addNS('document-units', 'inkscape'))
+ if docunits:
+ print "document-units: " + docunits
+ units = namedview.get('units')
+ if units:
+ print "units: " + units
+ xpathStr = '//sodipodi:guide'
+ guides = svg.xpath(xpathStr, namespaces=inkex.NSS)
+ xpathStr = '//inkscape:grid'
+ if guides:
+ numberGuides = len(guides)
+ print "Document has " + str(numberGuides) + " guides"
+ grids = svg.xpath(xpathStr, namespaces=inkex.NSS)
+ i = 1
+ for grid in grids:
+ print "Grid number " + str(i) + ": Units: " + grid.get("units")
+ i = i+1
+ else:
+ if self.options.switcher == "0":
+ self.factor = 96.0/90.0
+ namedview = svg.find(inkex.addNS('namedview', 'sodipodi'))
+ namedview.set(inkex.addNS('document-units', 'inkscape'), "px")
+ self.units = re.sub("[0-9]*\.?[0-9]", "", svg.get('width'))
+ if self.units and self.units <> "px":
+ if self.options.switcher == "0":
+ self.unitExponent = 1.0/(self.factor/self.__uuconv[self.units])
+ else:
+ self.unitExponent = 1.0/(self.factor/self.__uuconvLegazy[self.units])
+ '''
+ else:
+ self.scaleGuides(svg)
+ self.unitExponent = 1.0
+ self.scaleGrid(svg)
+ sys.stdout = saveout
+ return
+ '''
+ self.scaleRoot(svg);
+ sys.stdout = saveout
+
+effect = DPISwitcher()
+effect.affect()
diff --git a/share/extensions/dxf_input.inx b/share/extensions/dxf_input.inx
index 0ba38252a..4488774a3 100644
--- a/share/extensions/dxf_input.inx
+++ b/share/extensions/dxf_input.inx
@@ -6,8 +6,12 @@
<dependency type="executable" location="extensions">inkex.py</dependency>
<param name="tab" type="notebook">
<page name="options" _gui-text="Options">
- <param name="auto" type="boolean" _gui-text="Use automatic scaling to size A4">true</param>
- <param name="scale" type="string" _gui-text="Or, use manual scale factor:">1.0</param>
+ <param name="scalemethod" type="optiongroup" _gui-text="Method of Scaling:">
+ <option value="manual">Manual scale</option>
+ <option value="auto">Automatic scaling to size A4</option>
+ <option value="file">Read from file</option>
+ </param>
+ <param name="scale" type="string" _gui-text="Manual scale factor:">1.0</param>
<param name="xmin" type="string" _gui-text="Manual x-axis origin (mm):">0.0</param>
<param name="ymin" type="string" _gui-text="Manual y-axis origin (mm):">0.0</param>
<param name="gcodetoolspoints" type="boolean" _gui-text="Gcodetools compatible point import">false</param>
@@ -22,9 +26,11 @@
</page>
<page name="help" _gui-text="Help">
<_param name="inputhelp" type="description" xml:space="preserve">- AutoCAD Release 13 and newer.
-- assume dxf drawing is in mm.
-- assume svg drawing is in pixels, at 90 dpi.
+- for manual scaling, assume dxf drawing is in mm.
+- assume svg drawing is in pixels, at 96 dpi.
- scale factor and origin apply only to manual scaling.
+- 'Automatic scaling' will fit the width of an A4 page.
+- 'Read from file' uses the variable $MEASUREMENT.
- layers are preserved only on File->Open, not Import.
- limited support for BLOCKS, use AutoCAD Explode Blocks instead, if needed.</_param>
</page>
diff --git a/share/extensions/dxf_input.py b/share/extensions/dxf_input.py
index da81ff78c..f0a1296f1 100755
--- a/share/extensions/dxf_input.py
+++ b/share/extensions/dxf_input.py
@@ -279,14 +279,14 @@ def export_INSERT():
if vals[groups['2']] and vals[groups['10']] and vals[groups['20']]:
x = vals[groups['10']][0] + scale*xmin
y = vals[groups['20']][0] - scale*ymin - height
- attribs = {'x': '%f' % x, 'y': '%f' % y, inkex.addNS('href','xlink'): '#' + quote(vals[groups['2']][0].encode("utf-8"))}
+ attribs = {'x': '%f' % x, 'y': '%f' % y, inkex.addNS('href','xlink'): '#' + quote(vals[groups['2']][0].replace(" ", "_").encode("utf-8"))}
inkex.etree.SubElement(layer, 'use', attribs)
def export_BLOCK():
# mandatory group codes : (2) (block name)
if vals[groups['2']]:
global block
- block = inkex.etree.SubElement(defs, 'symbol', {'id': vals[groups['2']][0]})
+ block = inkex.etree.SubElement(defs, 'symbol', {'id': vals[groups['2']][0].replace(" ", "_")})
def export_ENDBLK():
global block
@@ -322,7 +322,7 @@ def generate_ellipse(xc, yc, xm, ym, w, a1, a2):
def generate_gcodetools_point(xc, yc):
path= 'm %s,%s 2.9375,-6.34375 0.8125,1.90625 6.84375,-6.84375 0,0 0.6875,0.6875 -6.84375,6.84375 1.90625,0.8125 z' % (xc,yc)
- attribs = {'d': path, inkex.addNS('dxfpoint','inkscape'):'1', 'style': 'stroke:#ff0000;fill:#ff0000'}
+ attribs = {'d': path, inkex.addNS('dxfpoint','inkscape'):'1', 'style': 'stroke:none;fill:#ff0000'}
inkex.etree.SubElement(layer, 'path', attribs)
def get_line():
@@ -344,7 +344,7 @@ colors = { 1: '#FF0000', 2: '#FFFF00', 3: '#00FF00', 4: '#00FFFF', 5: '
250: '#333333', 251: '#505050', 252: '#696969', 253: '#828282', 254: '#BEBEBE', 255: '#FFFFFF'}
parser = inkex.optparse.OptionParser(usage="usage: %prog [options] SVGfile", option_class=inkex.InkOption)
-parser.add_option("--auto", action="store", type="inkbool", dest="auto", default=True)
+parser.add_option("--scalemethod", action="store", type="string", dest="scalemethod", default="manual")
parser.add_option("--scale", action="store", type="string", dest="scale", default="1.0")
parser.add_option("--xmin", action="store", type="string", dest="xmin", default="0.0")
parser.add_option("--ymin", action="store", type="string", dest="ymin", default="0.0")
@@ -354,7 +354,7 @@ parser.add_option("--font", action="store", type="string", dest="font", default=
parser.add_option("--tab", action="store", type="string", dest="tab", default="Options")
parser.add_option("--inputhelp", action="store", type="string", dest="inputhelp", default="")
(options, args) = parser.parse_args(inkex.sys.argv[1:])
-doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" width="%s" height="%s"></svg>' % (210*90/25.4, 297*90/25.4)))
+doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" width="%s" height="%s"></svg>' % (210*96/25.4, 297*96/25.4)))
desc = inkex.etree.SubElement(doc.getroot(), 'desc', {})
defs = inkex.etree.SubElement(doc.getroot(), 'defs', {})
marker = inkex.etree.SubElement(defs, 'marker', {'id': 'DistanceX', 'orient': 'auto', 'refX': '0.0', 'refY': '0.0', 'style': 'overflow:visible'})
@@ -365,7 +365,8 @@ inkex.etree.SubElement(pattern, 'path', {'d': 'M6 2 l-4,4', 'stroke': '#000000',
inkex.etree.SubElement(pattern, 'path', {'d': 'M4 0 l-4,4', 'stroke': '#000000', 'stroke-width': '0.25', 'linecap': 'square'})
stream = open(args[0], 'r')
xmax = xmin = ymin = 0.0
-height = 297.0*90.0/25.4 # default A4 height in pixels
+height = 297.0*96.0/25.4 # default A4 height in pixels
+measurement = 0 # default inches
line = get_line()
polylines = 0
flag = 0 # (0, 1, 2, 3) = (none, LAYER, LTYPE, DIMTXT)
@@ -376,7 +377,10 @@ DIMTXT = {} # store DIMENSION text sizes
while line[0] and line[1] != 'BLOCKS':
line = get_line()
- if options.auto:
+ if options.scalemethod == 'file':
+ if line[1] == '$MEASUREMENT':
+ measurement = get_group('70')
+ elif options.scalemethod == 'auto':
if line[1] == '$EXTMIN':
xmin = get_group('10')
ymin = get_group('20')
@@ -406,7 +410,11 @@ while line[0] and line[1] != 'BLOCKS':
if line[0] == '0' and line[1] == 'ENDTAB':
flag = 0
-if options.auto:
+if options.scalemethod == 'file':
+ scale = 25.4 # default inches
+ if measurement == 1.0:
+ scale = 1.0 # use mm
+elif options.scalemethod == 'auto':
scale = 1.0
if xmax > xmin:
scale = 210.0/(xmax - xmin) # scale to A4 width
@@ -414,8 +422,8 @@ else:
scale = float(options.scale) # manual scale factor
xmin = float(options.xmin)
ymin = float(options.ymin)
-desc.text = '%s - scale = %f, origin = (%f, %f), auto = %s' % (unicode(args[0], options.input_encode), scale, xmin, ymin, options.auto)
-scale *= 90.0/25.4 # convert from mm to pixels
+desc.text = '%s - scale = %f, origin = (%f, %f), method = %s' % (unicode(args[0], options.input_encode), scale, xmin, ymin, options.scalemethod)
+scale *= 96.0/25.4 # convert from mm to pixels
if not layer_nodes.has_key('0'):
attribs = {inkex.addNS('groupmode','inkscape'): 'layer', inkex.addNS('label','inkscape'): '0'}
@@ -487,7 +495,7 @@ while line[0] and (line[1] != 'ENDSEC' or not inENTITIES):
w = 0.5 # default lineweight for POINT
if vals[groups['370']]: # Common Lineweight
if vals[groups['370']][0] > 0:
- w = 90.0/25.4*vals[groups['370']][0]/100.0
+ w = 96.0/25.4*vals[groups['370']][0]/100.0
if w < 0.5:
w = 0.5
style = simplestyle.formatStyle({'stroke': '%s' % color, 'fill': 'none', 'stroke-width': '%.1f' % w})
diff --git a/share/extensions/dxf_outlines.inx b/share/extensions/dxf_outlines.inx
index ad3aef17f..c6f71d269 100644
--- a/share/extensions/dxf_outlines.inx
+++ b/share/extensions/dxf_outlines.inx
@@ -10,14 +10,14 @@
<param name="ROBO" type="boolean" _gui-text="use ROBO-Master type of spline output">false</param>
<param name="POLY" type="boolean" _gui-text="use LWPOLYLINE type of line output">true</param>
<param name="units" type="enum" _gui-text="Base unit">
- <_item value="72./90">pt</_item>
- <_item value="1./15">pc</_item>
+ <_item value="72./96">pt</_item>
+ <_item value="1./16">pc</_item>
<_item value="1.">px</_item>
- <_item value="25.4/90">mm</_item>
- <_item value="2.54/90">cm</_item>
- <_item value=".0254/90">m</_item>
- <_item value="1./90">in</_item>
- <_item value="1./1080">ft</_item>
+ <_item value="25.4/96">mm</_item>
+ <_item value="2.54/96">cm</_item>
+ <_item value=".0254/96">m</_item>
+ <_item value="1./96">in</_item>
+ <_item value="1./1152">ft</_item>
</param>
<param name="encoding" type="enum" _gui-text="Character Encoding">
<_item value="latin_1">Latin 1</_item>
@@ -34,7 +34,7 @@
</page>
<page name="help" _gui-text="Help">
<_param name="inputhelp" type="description" xml:space="preserve">- AutoCAD Release 14 DXF format.
-- The base unit parameter specifies in what unit the coordinates are output (90 px = 1 in).
+- The base unit parameter specifies in what unit the coordinates are output (96 px = 1 in).
- Supported element types
- paths (lines and splines)
- rectangles
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index f5cf37aff..f7e57c32e 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -76,7 +76,7 @@ class MyEffect(inkex.Effect):
default=True)
self.OptionParser.add_option("--units", action="store",
type="string", dest="units",
- default="72./90") # Points
+ default="72./96") # Points
self.OptionParser.add_option("--encoding", action="store",
type="string", dest="char_encode",
default="latin_1")
@@ -324,7 +324,7 @@ class MyEffect(inkex.Effect):
scale = eval(self.options.units)
if not scale:
- scale = 25.4/90 # if no scale is specified, assume inch as baseunit
+ scale = 25.4/96 # if no scale is specified, assume inch as baseunit
h = self.unittouu(self.document.getroot().xpath('@height', namespaces=inkex.NSS)[0])
self.groupmat = [[[scale, 0.0, 0.0], [0.0, -scale, h*scale]]]
doc = self.document.getroot()
diff --git a/share/extensions/empty_business_card.inx b/share/extensions/empty_business_card.inx
new file mode 100644
index 000000000..e08cd9eef
--- /dev/null
+++ b/share/extensions/empty_business_card.inx
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>Business Card</_name>
+ <id>org.inkscape.render.empty_business_card</id>
+ <dependency type="executable" location="extensions">empty_business_card.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="size" _gui-text="Business card size:" type="enum">
+ <item value="74mmx52mm">74mm x 52mm (A8)</item>
+ <item value="85mmx55mm">85mm x 55mm (Europe)</item>
+ <item value="90mmx55mm">90mm x 55mm (Australia, India, ...)</item>
+ <item value="91mmx55mm">91mm x 55mm (Japan)</item>
+ <item value="90mmx54mm">90mm x 54mm (China, ...)</item>
+ <item value="90mmx50mm">90mm x 50mm (India, Russia, ...)</item>
+ <item value="3.5inx2in">3.5in x 2in (United States, Canada)</item>
+ </param>
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>Business Card...</inkscape:_name>
+ <inkscape:author>Tavmjong Bah</inkscape:author>
+ <inkscape:_shortdesc>Business card of chosen size.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-09</inkscape:date>
+ <inkscape:_keywords>business card</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">empty_business_card.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/empty_business_card.py b/share/extensions/empty_business_card.py
new file mode 100644
index 000000000..586c37abc
--- /dev/null
+++ b/share/extensions/empty_business_card.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+# Written by Tavmjong Bah
+
+import inkex
+import re
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-s", "--size", action="store", type="string", dest="card_size", default="90mmx55mm", help="Business card size")
+
+ def effect(self):
+
+ size = self.options.card_size
+
+ p = re.compile('([0-9.]*)([a-z][a-z])x([0-9.]*)([a-z][a-z])')
+ m = p.match( size )
+ width = m.group(1)
+ width_unit = m.group(2)
+ height = m.group(3)
+ height_unit = m.group(4)
+
+ root = self.document.getroot()
+ root.set("id", "SVGRoot")
+ root.set("width", width + width_unit)
+ root.set("height", height + height_unit)
+ root.set("viewBox", "0 0 " + width + " " + height )
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), width_unit)
+
+ width_int = int(self.uutounit(float(width), 'px'))
+ height_int = int(self.uutounit(float(height), 'px'))
+
+ namedview.set(inkex.addNS('zoom', 'inkscape'), str(2) )
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(width_int/2.0) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(height_int/2.0) )
+
+
+c = C()
+c.affect()
diff --git a/share/extensions/empty_desktop.inx b/share/extensions/empty_desktop.inx
new file mode 100644
index 000000000..75762b660
--- /dev/null
+++ b/share/extensions/empty_desktop.inx
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>Desktop</_name>
+ <id>org.inkscape.render.empty_desktop</id>
+ <dependency type="executable" location="extensions">empty_desktop.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="size" _gui-text="Desktop size:" type="enum">
+ <item value="Custom">Custom</item>
+ <item value="640x480">640x480 (VGA)</item>
+ <item value="800x600">800x600 (SVGA)</item>
+ <item value="1024x768">1024x768 (XGA)</item>
+ <item value="1366x768">1366x768 (HD)</item>
+ <item value="1600x900">1600x900 (HD+)</item>
+ <item value="1600x1200">1600x1200 (UXGA)</item>
+ <item value="1920x1080">1920x1080 (FHD)</item>
+ <item value="1920x1200">1920x1200 (WUXGA)</item>
+ <item value="2560x1600">2560x1600 (WQXGA)</item>
+ </param>
+
+ <!-- Maximum size is '16k' -->
+ <param name="width" _gui-text="Custom Width:" type="int" min="240" max="15360">1920</param>
+ <param name="height" _gui-text="Custom Height:" type="int" min="160" max="8640">1080</param>
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>Desktop...</inkscape:_name>
+ <inkscape:author>Tavmjong Bah</inkscape:author>
+ <inkscape:_shortdesc>Empty desktop of chosen size.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-09</inkscape:date>
+ <inkscape:_keywords>empty desktop</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">empty_desktop.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/empty_desktop.py b/share/extensions/empty_desktop.py
new file mode 100644
index 000000000..31cb35f9d
--- /dev/null
+++ b/share/extensions/empty_desktop.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+# Written by Tavmjong Bah
+
+import inkex
+import re
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-s", "--size", action="store", type="string", dest="desktop_size", default="16", help="Desktop size")
+
+ self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="desktop_width", default="1920", help="Custom width")
+ self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="desktop_height", default="1080", help="Custom height")
+
+ def effect(self):
+
+ size = self.options.desktop_size
+ width = self.options.desktop_width
+ height = self.options.desktop_height
+
+ if size != "Custom":
+ p = re.compile('([0-9]*)x([0-9]*)')
+ m = p.match( size )
+ width = int(m.group(1))
+ height = int(m.group(2))
+
+
+ root = self.document.getroot()
+ root.set("id", "SVGRoot")
+ root.set("width", str(width) + 'px')
+ root.set("height", str(height) + 'px')
+ root.set("viewBox", "0 0 " + str(width) + " " + str(height) )
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), 'px')
+
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(width/2.0) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(height/2.0) )
+
+
+c = C()
+c.affect()
diff --git a/share/extensions/empty_dvd_cover.inx b/share/extensions/empty_dvd_cover.inx
new file mode 100644
index 000000000..facb523d1
--- /dev/null
+++ b/share/extensions/empty_dvd_cover.inx
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>DVD Cover</_name>
+ <id>org.inkscape.render.empty_dvd_cover</id>
+ <dependency type="executable" location="extensions">empty_dvd_cover.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="spine" _gui-text="DVD spine width:" type="enum">
+ <item value="14">Normal (14mm)</item>
+ <item value="9">Slim (9mm)</item>
+ <item value="7">Super Slim (7mm)</item>
+ <item value="5">Ultra Slim (5mm)</item>
+ </param>
+
+ <param name="bleed" _gui-text="DVD cover bleed (mm):" type="float" min="0" max="25">3</param>
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>DVD Cover...</inkscape:_name>
+ <inkscape:author>Tavmjong Bah</inkscape:author>
+ <inkscape:_shortdesc>DVD cover of chosen size.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-10</inkscape:date>
+ <inkscape:_keywords>dvd cover</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">empty_dvd_cover.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/empty_dvd_cover.py b/share/extensions/empty_dvd_cover.py
new file mode 100644
index 000000000..1456de51d
--- /dev/null
+++ b/share/extensions/empty_dvd_cover.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+
+# Written by Tavmjong Bah
+
+import inkex
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-s", "--spine", action="store", type="string", dest="dvd_cover_spine", default="normal", help="Dvd spine width")
+ self.OptionParser.add_option("-b", "--bleed", action="store", type="float", dest="dvd_cover_bleed", default="3", help="Bleed (extra area around image")
+
+ def create_horizontal_guideline(self, name, position):
+ self.create_guideline(name, "0,1", 0, position)
+
+ def create_vertical_guideline(self, name, position):
+ self.create_guideline(name, "1,0", position, 0)
+
+ def create_guideline(self, label, orientation, x,y):
+ namedview = self.root.find(inkex.addNS('namedview', 'sodipodi'))
+ guide = inkex.etree.SubElement(namedview, inkex.addNS('guide', 'sodipodi'))
+ guide.set("orientation", orientation)
+ guide.set("position", str(x)+","+str(y))
+ # No need to set label (causes translation problems, etc.)
+ # guide.set(inkex.addNS('label', 'inkscape'), label)
+
+ def effect(self):
+
+ # Dimensions in mm
+ width = 259.0 # Before adding spine width or bleed
+ height = 183.0 # Before adding bleed
+
+ bleed = self.options.dvd_cover_bleed
+ spine = float( self.options.dvd_cover_spine )
+
+ width += spine
+ width += 2.0 * bleed
+ height += 2.0 * bleed
+
+ self.root = self.document.getroot()
+ self.root.set("id", "SVGRoot")
+ self.root.set("width", str(width) + 'mm')
+ self.root.set("height", str(height) + 'mm')
+ self.root.set("viewBox", "0 0 " + str(width) + " " + str(height) )
+
+ namedview = self.root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( self.root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), "mm")
+
+ # Until units are supported in 'cx', etc.
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(self.uutounit( width, 'px' )/2.0 ) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(self.uutounit( height, 'px' )/2.0 ) )
+
+ self.create_horizontal_guideline("bottom", str(self.uutounit( bleed, 'px' )) )
+ self.create_horizontal_guideline("top", str(self.uutounit( height-bleed, 'px' )) )
+ self.create_vertical_guideline("left edge", str(self.uutounit( bleed, 'px' )) )
+ self.create_vertical_guideline("left spline", str(self.uutounit( (width-spine)/2.0,'px' )) )
+ self.create_vertical_guideline("right spline", str(self.uutounit( (width+spine)/2.0,'px' )) )
+ self.create_vertical_guideline("left edge", str(self.uutounit( width-bleed, 'px' )) )
+
+c = C()
+c.affect()
diff --git a/share/extensions/empty_generic.inx b/share/extensions/empty_generic.inx
new file mode 100644
index 000000000..b430cfba5
--- /dev/null
+++ b/share/extensions/empty_generic.inx
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>Generic Canvas</_name>
+ <id>org.inkscape.render.empty_generic_canvas</id>
+ <dependency type="executable" location="extensions">empty_generic.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="width" _gui-text="Custom Width:" type="float" min="1" max="15360">800</param>
+ <param name="height" _gui-text="Custom Height:" type="float" min="1" max="8640">600</param>
+
+ <param name="unit" _gui-text="SVG Unit:" type="enum">
+ <item value="px">'px'</item>
+ <item value="in">'in'</item>
+ <item value="mm">'mm'</item>
+ <item value="cm">'cm'</item>
+ <item value="pc">'pc'</item>
+ <item value="pt">'pt'</item>
+ </param>
+
+ <param name="background" _gui-text="Canvas background:" type="enum">
+ <item value="normal">Normal</item>
+ <item value="black">Black Opaque</item>
+ <item value="gray">Gray Opaque</item>
+ <item value="white">White Opaque</item>
+ </param>
+
+ <param name="noborder" type="boolean" _gui-text="Hide border">false</param>
+
+ <!--
+ <param name="layer" type="boolean" _gui-text="Include default layer">true</param>
+ -->
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>Generic canvas...</inkscape:_name>
+ <inkscape:author>Tavmjong Bah</inkscape:author>
+ <inkscape:_shortdesc>Genric canvas of choosen size.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-09</inkscape:date>
+ <inkscape:_keywords>empty generic canvas</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">empty_generic.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/empty_generic.py b/share/extensions/empty_generic.py
new file mode 100644
index 000000000..62e27d220
--- /dev/null
+++ b/share/extensions/empty_generic.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+
+# Written by Tavmjong Bah
+
+import inkex
+import re
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="generic_width", default="1920", help="Custom width")
+ self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="generic_height", default="1080", help="Custom height")
+ self.OptionParser.add_option("-u", "--unit", action="store", type="string", dest="generic_unit", default="px", help="SVG Unit")
+ self.OptionParser.add_option("-b", "--background", action="store", type="string", dest="generic_background", default="normal", help="Canvas background")
+ self.OptionParser.add_option("-n", "--noborder", action="store", type="inkbool", dest="generic_noborder", default=False)
+ # self.OptionParser.add_option("-l", "--layer", action="store", type="inkbool", dest="generic_layer", default=True)
+
+ def effect(self):
+
+ width = self.options.generic_width
+ height = self.options.generic_height
+ unit = self.options.generic_unit
+
+ root = self.document.getroot()
+ root.set("id", "SVGRoot")
+ root.set("width", str(width) + unit)
+ root.set("height", str(height) + unit)
+ root.set("viewBox", "0 0 " + str(width) + " " + str(height) )
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), unit)
+
+ # Until units are supported in 'cx', etc.
+ namedview.set(inkex.addNS('zoom', 'inkscape'), str(512.0/self.uutounit( width, 'px' )) )
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(self.uutounit( width, 'px' )/2.0 ) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(self.uutounit( height, 'px' )/2.0 ) )
+
+ if self.options.generic_background == "white":
+ namedview.set( 'pagecolor', "#ffffff" )
+ namedview.set( 'bordercolor', "#666666" )
+ namedview.set(inkex.addNS('pageopacity', 'inkscape'), "1.0" )
+ namedview.set(inkex.addNS('pageshadow', 'inkscape'), "0" )
+
+ if self.options.generic_background == "gray":
+ namedview.set( 'pagecolor', "#808080" )
+ namedview.set( 'bordercolor', "#444444" )
+ namedview.set(inkex.addNS('pageopacity', 'inkscape'), "1.0" )
+ namedview.set(inkex.addNS('pageshadow', 'inkscape'), "0" )
+
+ if self.options.generic_background == "black":
+ namedview.set( 'pagecolor', "#000000" )
+ namedview.set( 'bordercolor', "#999999" )
+ namedview.set(inkex.addNS('pageopacity', 'inkscape'), "1.0" )
+ namedview.set(inkex.addNS('pageshadow', 'inkscape'), "0" )
+
+ if self.options.generic_noborder:
+ pagecolor = namedview.get( 'pagecolor' )
+ namedview.set( 'bordercolor', pagecolor )
+ namedview.set( 'borderopacity', "0" )
+
+ # This nees more thought... we need to set "Current layer" to (root), how?
+ # if self.options.generic_layer:
+ # # Add layer
+ # inkex.debug( "We want a layer" )
+ # else:
+ # # Remove layer id default document (assuming only one)
+ # inkex.debug( "We don't want a layer" )
+ # layer_node = self.current_layer
+ # if layer_node is not None:
+ # inkex.debug( "We have layer" )
+ # root.remove(layer_node)
+ # try:
+ # del namedview.attrib[ inkex.addNS('current-layer', 'inkscape') ]
+ # except:
+ # pass
+
+
+c = C()
+c.affect()
diff --git a/share/extensions/empty_icon.inx b/share/extensions/empty_icon.inx
new file mode 100644
index 000000000..9e36b9d20
--- /dev/null
+++ b/share/extensions/empty_icon.inx
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>Icon</_name>
+ <id>org.inkscape.render.empty_icon</id>
+ <dependency type="executable" location="extensions">empty_icon.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="size" _gui-text="Icon size:" type="int" min="8" max="256">16</param>
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>Icon...</inkscape:_name>
+ <inkscape:author>Tavmjong Bah</inkscape:author>
+ <inkscape:_shortdesc>Empty icon of chosen size.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-09</inkscape:date>
+ <inkscape:_keywords>empty icon</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">empty_icon.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/empty_icon.py b/share/extensions/empty_icon.py
new file mode 100644
index 000000000..979edbae4
--- /dev/null
+++ b/share/extensions/empty_icon.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+# Written by Tavmjong Bah
+
+import inkex
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-s", "--size", action="store", type="int", dest="icon_size", default="16", help="Icon size")
+
+ def effect(self):
+
+ size = self.options.icon_size
+
+ root = self.document.getroot()
+ root.set("id", "SVGRoot")
+ root.set("width", str(size) + 'px')
+ root.set("height", str(size) + 'px')
+ root.set("viewBox", "0 0 " + str(size) + " " + str(size) )
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), 'px')
+
+ namedview.set(inkex.addNS('zoom', 'inkscape'), str(256.0/size) )
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(size/2.0) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(size/2.0) )
+ namedview.set(inkex.addNS('grid-bbox', 'inkscape'), "true" )
+
+
+
+c = C()
+c.affect()
diff --git a/share/extensions/empty_page.inx b/share/extensions/empty_page.inx
index f3f60f796..6882b7273 100644
--- a/share/extensions/empty_page.inx
+++ b/share/extensions/empty_page.inx
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
- <_name>Empty Page</_name>
+ <_name>Page</_name>
<id>org.inkscape.render.empty_page</id>
<dependency type="executable" location="extensions">empty_page.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
@@ -16,17 +16,26 @@
<item value="horizontal">Horizontal</item>
<item value="vertical">Vertical</item>
</param>
-
+
+ <param name="background" _gui-text="Page background:" type="enum">
+ <item value="normal">Normal</item>
+ <item value="black">Black Opaque</item>
+ <item value="gray">Gray Opaque</item>
+ <item value="white">White Opaque</item>
+ </param>
+
+ <param name="noborder" type="boolean" _gui-text="Hide border">false</param>
+
<effect needs-live-preview="false">
<object-type>all</object-type>
<effects-menu hidden="true" />
</effect>
<inkscape:_templateinfo>
- <inkscape:_name>Empty page</inkscape:_name>
- <inkscape:author>Jan Darowski</inkscape:author>
+ <inkscape:_name>Page...</inkscape:_name>
+ <inkscape:author>Jan Darowski, updated by Tavmjong Bah</inkscape:author>
<inkscape:_shortdesc>Empty page of chosen size.</inkscape:_shortdesc>
- <inkscape:date>2013-09-10</inkscape:date>
- <inkscape:_keywords>empty sheet a4 a3 a5 letter</inkscape:_keywords>
+ <inkscape:date>2014-10-06</inkscape:date>
+ <inkscape:_keywords>empty sheet a4 a3 a5 letter black white opaque</inkscape:_keywords>
</inkscape:_templateinfo>
<script>
<command reldir="extensions" interpreter="python">empty_page.py</command>
diff --git a/share/extensions/empty_page.py b/share/extensions/empty_page.py
index dc16bab97..3c1f67041 100644
--- a/share/extensions/empty_page.py
+++ b/share/extensions/empty_page.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+# Rewritten by Tavmjong Bah to add correct viewBox, inkscape:cx, etc. attributes
+
import inkex
class C(inkex.Effect):
@@ -7,38 +9,77 @@ class C(inkex.Effect):
inkex.Effect.__init__(self)
self.OptionParser.add_option("-s", "--size", action="store", type="string", dest="page_size", default="a4", help="Page size")
self.OptionParser.add_option("-o", "--orientation", action="store", type="string", dest="page_orientation", default="vertical", help="Page orientation")
+ self.OptionParser.add_option("-b", "--background", action="store", type="string", dest="page_background", default="normal", help="Page background")
+ self.OptionParser.add_option("-n", "--noborder", action="store", type="inkbool", dest="page_noborder", default=False)
+
+ def effect(self):
+
+ width = 300
+ height = 300
+ units = 'px'
+
+ if self.options.page_size == "a5":
+ width = 148
+ height= 210
+ units = 'mm'
+
+ if self.options.page_size == "a4":
+ width = 210
+ height= 297
+ units = 'mm'
+
+ if self.options.page_size == "a3":
+ width = 297
+ height= 420
+ units = 'mm'
+
+ if self.options.page_size == "letter":
+ width = 8.5
+ height = 11
+ units = 'in'
+
+ if self.options.page_orientation == "horizontal":
+ width, height = height, width
- def effect(self):
root = self.document.getroot()
- root.set("width", "12in")
- root.set("height", "12in")
- if self.options.page_size == "a4" and self.options.page_orientation == "vertical":
- root.set("width", "210mm")
- root.set("height", "297mm")
- if self.options.page_size == "a4" and self.options.page_orientation == "horizontal":
- root.set("height", "210mm")
- root.set("width", "297mm")
-
- if self.options.page_size == "a5" and self.options.page_orientation == "vertical":
- root.set("width", "148mm")
- root.set("height", "210mm")
- if self.options.page_size == "a5" and self.options.page_orientation == "horizontal":
- root.set("width", "210mm")
- root.set("height", "148mm")
-
- if self.options.page_size == "a3" and self.options.page_orientation == "vertical":
- root.set("width", "297mm")
- root.set("height", "420mm")
- if self.options.page_size == "a3" and self.options.page_orientation == "horizontal":
- root.set("width", "420mm")
- root.set("height", "297mm")
-
- if self.options.page_size == "letter" and self.options.page_orientation == "vertical":
- root.set("width", "8.5in")
- root.set("height", "11in")
- if self.options.page_size == "letter" and self.options.page_orientation == "horizontal":
- root.set("width", "11in")
- root.set("height", "8.5in")
+ root.set("id", "SVGRoot")
+ root.set("width", str(width) + units)
+ root.set("height", str(height) + units)
+ root.set("viewBox", "0 0 " + str(width) + " " + str(height) )
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), units)
+
+ # Until units are supported in 'cx', etc.
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(self.uutounit( width, 'px' )/2.0 ) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(self.uutounit( height, 'px' )/2.0 ) )
+
+
+ if self.options.page_background == "white":
+ namedview.set( 'pagecolor', "#ffffff" )
+ namedview.set( 'bordercolor', "#666666" )
+ namedview.set(inkex.addNS('pageopacity', 'inkscape'), "1.0" )
+ namedview.set(inkex.addNS('pageshadow', 'inkscape'), "0" )
+
+ if self.options.page_background == "gray":
+ namedview.set( 'pagecolor', "#808080" )
+ namedview.set( 'bordercolor', "#444444" )
+ namedview.set(inkex.addNS('pageopacity', 'inkscape'), "1.0" )
+ namedview.set(inkex.addNS('pageshadow', 'inkscape'), "0" )
+
+ if self.options.page_background == "black":
+ namedview.set( 'pagecolor', "#000000" )
+ namedview.set( 'bordercolor', "#999999" )
+ namedview.set(inkex.addNS('pageopacity', 'inkscape'), "1.0" )
+ namedview.set(inkex.addNS('pageshadow', 'inkscape'), "0" )
+
+ if self.options.page_noborder:
+ pagecolor = namedview.get( 'pagecolor' )
+ namedview.set( 'bordercolor', pagecolor )
+ namedview.set( 'borderopacity', "0" )
c = C()
c.affect()
diff --git a/share/extensions/empty_video.inx b/share/extensions/empty_video.inx
new file mode 100644
index 000000000..8ca148cfc
--- /dev/null
+++ b/share/extensions/empty_video.inx
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>Video Screen</_name>
+ <id>org.inkscape.render.empty_video</id>
+ <dependency type="executable" location="extensions">empty_video.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="size" _gui-text="Video size:" type="enum">
+ <item value="Custom">Custom</item>
+ <item value="720x486">720x486 (NTSC)</item>
+ <item value="720x576">720x576 (PAL)</item>
+ <item value="1920x1080">1920x1080 (HDTV)</item>
+ <item value="3840x2160">3840x2160 (4K)</item>
+ <item value="7680x4320">7680x4320 (8K)</item>
+ </param>
+
+ <!-- Maximum size is '16k' -->
+ <param name="width" _gui-text="Custom Width:" type="int" min="240" max="15360">1920</param>
+ <param name="height" _gui-text="Custom Height:" type="int" min="160" max="8640">1080</param>
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>Video...</inkscape:_name>
+ <inkscape:author>Tavmjong Bah</inkscape:author>
+ <inkscape:_shortdesc>Video screen of chosen size.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-09</inkscape:date>
+ <inkscape:_keywords>empty video</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">empty_video.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/empty_video.py b/share/extensions/empty_video.py
new file mode 100644
index 000000000..4b440704c
--- /dev/null
+++ b/share/extensions/empty_video.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+# Written by Tavmjong Bah
+
+import inkex
+import re
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-s", "--size", action="store", type="string", dest="video_size", default="16", help="Video size")
+
+ self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="video_width", default="1920", help="Custom width")
+ self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="video_height", default="1080", help="Custom height")
+
+ def effect(self):
+
+ size = self.options.video_size
+ width = self.options.video_width
+ height = self.options.video_height
+
+ if size != "Custom":
+ p = re.compile('([0-9]*)x([0-9]*)')
+ m = p.match( size )
+ width = int(m.group(1))
+ height = int(m.group(2))
+
+
+ root = self.document.getroot()
+ root.set("id", "SVGRoot")
+ root.set("width", str(width) + 'px')
+ root.set("height", str(height) + 'px')
+ root.set("viewBox", "0 0 " + str(width) + " " + str(height) )
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), 'px')
+
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(width/2.0) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(height/2.0) )
+
+
+c = C()
+c.affect()
diff --git a/share/extensions/gcodetools.py b/share/extensions/gcodetools.py
index b9e6348f2..12f438cca 100755
--- a/share/extensions/gcodetools.py
+++ b/share/extensions/gcodetools.py
@@ -3321,7 +3321,7 @@ class Gcodetools(inkex.Effect):
self.error(_("No paths are selected! Trying to work on all available paths."),"warning")
if self.selected_paths == {}:
- self.error(_("Noting is selected. Please select something."),"warning")
+ self.error(_("Nothing is selected. Please select something."),"warning")
a = self.options.plasma_prepare_corners_tolerance
corner_tolerance = cross([1.,0.], [math.cos(a),math.sin(a)])
@@ -4664,7 +4664,7 @@ class Gcodetools(inkex.Effect):
################################################################################
def dxfpoints(self):
if self.selected_paths == {}:
- self.error(_("Noting is selected. Please select something to convert to drill point (dxfpoint) or clear point sign."),"warning")
+ self.error(_("Nothing is selected. Please select something to convert to drill point (dxfpoint) or clear point sign."),"warning")
for layer in self.layers :
if layer in self.selected_paths :
for path in self.selected_paths[layer]:
diff --git a/share/extensions/gcodetools_area.inx b/share/extensions/gcodetools_area.inx
index ad27ecee4..b487f2c54 100644
--- a/share/extensions/gcodetools_area.inx
+++ b/share/extensions/gcodetools_area.inx
@@ -88,7 +88,7 @@ For depth function c=color intensity from 0.0 (white) to 1.0 (black), d is the d
<_item value="G20 (All units in inches)">in</_item>
</param>
<param name="postprocessor" type="enum" _gui-text="Post-processor:">
- <_item value=" ">None</_item>
+ <_item msgctxt="GCode postprocessor" value=" ">None</_item>
<_item value="parameterize();">Parameterize Gcode</_item>
<_item value="flip(y);parameterize();">Flip y axis and parameterize Gcode</_item>
<_item value="round(4);">Round all values to 4 digits</_item>
diff --git a/share/extensions/gcodetools_dxf_points.inx b/share/extensions/gcodetools_dxf_points.inx
index e4534e8af..4367353b9 100644
--- a/share/extensions/gcodetools_dxf_points.inx
+++ b/share/extensions/gcodetools_dxf_points.inx
@@ -34,7 +34,7 @@ Also you can manually select object, open XML editor (Shift+Ctrl+X) and add or r
<_item value="G20 (All units in inches)">in</_item>
</param>
<param name="postprocessor" type="enum" _gui-text="Post-processor:">
- <_item value=" ">None</_item>
+ <_item msgctxt="GCode postprocessor" value=" ">None</_item>
<_item value="parameterize();">Parameterize Gcode</_item>
<_item value="flip(y);parameterize();">Flip y axis and parameterize Gcode</_item>
<_item value="round(4);">Round all values to 4 digits</_item>
diff --git a/share/extensions/gcodetools_engraving.inx b/share/extensions/gcodetools_engraving.inx
index 6885f32fd..a488f45a1 100644
--- a/share/extensions/gcodetools_engraving.inx
+++ b/share/extensions/gcodetools_engraving.inx
@@ -46,7 +46,7 @@ ellipse.(minor axis r, major 4r).....: math.sqrt(max(0,r**2-w**2))*4</_param>
<_item value="G20 (All units in inches)">in</_item>
</param>
<param name="postprocessor" type="enum" _gui-text="Post-processor:">
- <_item value=" ">None</_item>
+ <_item msgctxt="GCode postprocessor" value=" ">None</_item>
<_item value="parameterize();">Parameterize Gcode</_item>
<_item value="flip(y);parameterize();">Flip y axis and parameterize Gcode</_item>
<_item value="round(4);">Round all values to 4 digits</_item>
diff --git a/share/extensions/gcodetools_graffiti.inx b/share/extensions/gcodetools_graffiti.inx
index 7253b8fa4..bcaec76d4 100644
--- a/share/extensions/gcodetools_graffiti.inx
+++ b/share/extensions/gcodetools_graffiti.inx
@@ -73,7 +73,7 @@ Now press apply to create control points (independent set for each layer).
<_item value="G20 (All units in inches)">in</_item>
</param>
<param name="postprocessor" type="enum" _gui-text="Post-processor:">
- <_item value=" ">None</_item>
+ <_item msgctxt="GCode postprocessor" value=" ">None</_item>
<_item value="parameterize();">Parameterize Gcode</_item>
<_item value="flip(y);parameterize();">Flip y axis and parameterize Gcode</_item>
<_item value="round(4);">Round all values to 4 digits</_item>
diff --git a/share/extensions/gcodetools_lathe.inx b/share/extensions/gcodetools_lathe.inx
index d3c6916fd..c74ae267c 100644
--- a/share/extensions/gcodetools_lathe.inx
+++ b/share/extensions/gcodetools_lathe.inx
@@ -68,7 +68,7 @@ For depth function c=color intensity from 0.0 (white) to 1.0 (black), d is the d
<_item value="G20 (All units in inches)">in</_item>
</param>
<param name="postprocessor" type="enum" _gui-text="Post-processor:">
- <_item value=" ">None</_item>
+ <_item msgctxt="GCode postprocessor" value=" ">None</_item>
<_item value="parameterize();">Parameterize Gcode</_item>
<_item value="flip(y);parameterize();">Flip y axis and parameterize Gcode</_item>
<_item value="round(4);">Round all values to 4 digits</_item>
diff --git a/share/extensions/gcodetools_path_to_gcode.inx b/share/extensions/gcodetools_path_to_gcode.inx
index 8a79d6aae..39cc6571b 100644
--- a/share/extensions/gcodetools_path_to_gcode.inx
+++ b/share/extensions/gcodetools_path_to_gcode.inx
@@ -48,7 +48,7 @@ For depth function c=color intensity from 0.0 (white) to 1.0 (black), d is the d
<_item value="G20 (All units in inches)">in</_item>
</param>
<param name="postprocessor" type="enum" _gui-text="Post-processor:">
- <_item value=" ">None</_item>
+ <_item msgctxt="GCode postprocessor" value=" ">None</_item>
<_item value="parameterize();">Parameterize Gcode</_item>
<_item value="flip(y);parameterize();">Flip y axis and parameterize Gcode</_item>
<_item value="round(4);">Round all values to 4 digits</_item>
diff --git a/share/extensions/gimp_xcf.inx b/share/extensions/gimp_xcf.inx
index 10bcef627..30406b62d 100644
--- a/share/extensions/gimp_xcf.inx
+++ b/share/extensions/gimp_xcf.inx
@@ -11,7 +11,7 @@
<param name="guides" type="boolean" _gui-text="Save Guides">false</param>
<param name="grid" type="boolean" _gui-text="Save Grid">false</param>
<param name="background" type="boolean" _gui-text="Save Background">false</param>
- <param name="dpi" type="int" min="1" max="3000" _gui-text="File Resolution:">90</param>
+ <param name="dpi" type="int" min="1" max="3000" _gui-text="File Resolution:">96</param>
</page>
<page name="Help" _gui-text="Help">
<_param name="instructions" type="description" xml:space="preserve">This extension exports the document to Gimp XCF format according to the following options:
diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py
index c2a8cb274..11c9d041f 100755
--- a/share/extensions/gimp_xcf.py
+++ b/share/extensions/gimp_xcf.py
@@ -63,7 +63,7 @@ class MyEffect(inkex.Effect):
help="Add background color to each layer")
self.OptionParser.add_option("-i", "--dpi",
action="store", type="string",
- dest="resolution", default="90",
+ dest="resolution", default="96",
help="File resolution")
def output(self):
diff --git a/share/extensions/grid_polar.inx b/share/extensions/grid_polar.inx
index ee468fa34..ffc64a3d5 100644
--- a/share/extensions/grid_polar.inx
+++ b/share/extensions/grid_polar.inx
@@ -6,7 +6,7 @@
<dependency type="executable" location="extensions">inkex.py</dependency>
<param name="c_dot_dia" type="float" min="1" max="1000" _gui-text="Centre Dot Diameter (px):">5.0</param>
<param name="a_labels" type="enum" _gui-text="Circumferential Labels:">
- <_item value="none">None</_item>
+ <_item msgctxt="Label" value="none">None</_item>
<_item value="deg">Degrees</_item>
</param>
<param name="a_label_size" type="int" min="1" max="1000" _gui-text="Circumferential Label Size (px):">18</param>
diff --git a/share/extensions/guides_creator.inx b/share/extensions/guides_creator.inx
index ddc706097..baaa093c3 100644
--- a/share/extensions/guides_creator.inx
+++ b/share/extensions/guides_creator.inx
@@ -1,97 +1,96 @@
-<inkscape-extension>
- <_name>Guides creator</_name>
- <id>org.inkscape.effect.guidescreator</id>
- <dependency type="executable" location="extensions">guides_creator.py</dependency>
- <dependency type="executable" location="extensions">inkex.py</dependency>
- <param name="tab" type="notebook">
- <page name="regular_guides" _gui-text="Regular guides">
- <param name="guides_preset" type="enum" appearance="minimal" _gui-text="Guides preset">
- <item value="custom">Custom...</item>
- <item value="golden">Golden ratio</item>
- <item value="3;3">Rule-of-third</item>
- </param>
- <param name="vertical_guides" type="int" min="1" max="1000" _gui-text="Columns">2</param>
- <param name="horizontal_guides" type="int" min="1" max="1000" _gui-text="Rows">3</param>
- <param name="start_from_edges" type="boolean" _gui-text="Start from edges">false</param>
- <param name="delete_existing_guides" type="boolean" _gui-text="Delete existing guides">false</param>
- </page>
- <page name="diagonal_guides" _gui-text="Diagonal guides">
- <param name="ul" type="boolean" _gui-text="Upper left corner">false</param>
- <param name="ur" type="boolean" _gui-text="Upper right corner">false</param>
- <param name="ll" type="boolean" _gui-text="Lower left corner">false</param>
- <param name="lr" type="boolean" _gui-text="Lower right corner">false</param>
- <param name="delete_existing_guides2" type="boolean" _gui-text="Delete existing guides">false</param>
- </page>
- <page name="margins" _gui-text="Margins">
- <param name="margins_preset" type="enum" appearance="minimal" _gui-text="Margins preset">
- <item value="custom">Custom...</item>
- <item value="book_left">Left book page</item>
- <item value="book_right">Right book page</item>
- </param>
- <param name="header_margin" type="enum" appearance="minimal" _gui-text="Header margin">
- <item value="10">1/10</item>
- <item value="9">1/9</item>
- <item value="8">1/8</item>
- <item value="7">1/7</item>
- <item value="6">1/6</item>
- <item value="5">1/5</item>
- <item value="4">1/4</item>
- <item value="3">1/3</item>
- <item value="2">1/2</item>
- <item value="0">None</item>
- </param>
- <param name="footer_margin" type="enum" appearance="minimal" _gui-text="Footer margin">
- <item value="10">1/10</item>
- <item value="9">1/9</item>
- <item value="8">1/8</item>
- <item value="7">1/7</item>
- <item value="6">1/6</item>
- <item value="5">1/5</item>
- <item value="4">1/4</item>
- <item value="3">1/3</item>
- <item value="2">1/2</item>
- <item value="0">None</item>
- </param>
- <param name="left_margin" type="enum" appearance="minimal" _gui-text="Left margin">
- <item value="10">1/10</item>
- <item value="9">1/9</item>
- <item value="8">1/8</item>
- <item value="7">1/7</item>
- <item value="6">1/6</item>
- <item value="5">1/5</item>
- <item value="4">1/4</item>
- <item value="3">1/3</item>
- <item value="2">1/2</item>
- <item value="0">None</item>
- </param>
- <param name="right_margin" type="enum" appearance="minimal" _gui-text="Right margin">
- <item value="10">1/10</item>
- <item value="9">1/9</item>
- <item value="8">1/8</item>
- <item value="7">1/7</item>
- <item value="6">1/6</item>
- <item value="5">1/5</item>
- <item value="4">1/4</item>
- <item value="3">1/3</item>
- <item value="2">1/2</item>
- <item value="0">None</item>
- </param>
-
- <param name="vertical_subdivisions" type="int" min="1" max="1000" _gui-text="Columns">2</param>
- <param name="horizontal_subdivisions" type="int" min="1" max="1000" _gui-text="Rows">3</param>
- <param name="start_from_edges2" type="boolean" _gui-text="Start from edges">false</param>
- <param name="delete_existing_guides3" type="boolean" _gui-text="Delete existing guides">false</param>
-
- </page>
- </param>
- <effect>
- <object-type>all</object-type>
- <effects-menu>
- <submenu _name="Render"/>
- </effects-menu>
- </effect>
- <script>
- <command reldir="extensions" interpreter="python">guides_creator.py</command>
- </script>
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
+ <_name>Guides creator</_name>
+ <id>org.inkscape.effect.guidescreator</id>
+ <dependency type="executable" location="extensions">guides_creator.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+ <param name="tab" type="notebook">
+ <page name="regular_guides" _gui-text="Regular guides">
+ <param name="guides_preset" type="enum" appearance="minimal" _gui-text="Guides preset:">
+ <_item value="custom">Custom...</_item>
+ <_item value="golden">Golden ratio</_item>
+ <_item value="3;3">Rule-of-third</_item>
+ </param>
+ <param name="vertical_guides" type="int" min="1" max="1000" _gui-text="Columns:">2</param>
+ <param name="horizontal_guides" type="int" min="1" max="1000" _gui-text="Rows:">3</param>
+ <param name="start_from_edges" type="boolean" _gui-text="Start from edges">false</param>
+ <param name="delete_existing_guides" type="boolean" _gui-text="Delete existing guides">false</param>
+ </page>
+ <page name="diagonal_guides" _gui-text="Diagonal guides">
+ <param name="ul" type="boolean" _gui-text="Upper left corner">false</param>
+ <param name="ur" type="boolean" _gui-text="Upper right corner">false</param>
+ <param name="ll" type="boolean" _gui-text="Lower left corner">false</param>
+ <param name="lr" type="boolean" _gui-text="Lower right corner">false</param>
+ <param name="delete_existing_guides2" type="boolean" _gui-text="Delete existing guides">false</param>
+ </page>
+ <page name="margins" _gui-text="Margins">
+ <param name="margins_preset" type="enum" appearance="minimal" _gui-text="Margins preset:">
+ <_item value="custom">Custom...</_item>
+ <_item value="book_left">Left book page</_item>
+ <_item value="book_right">Right book page</_item>
+ </param>
+ <param name="header_margin" type="enum" appearance="minimal" _gui-text="Header margin:">
+ <item value="10">1/10</item>
+ <item value="9">1/9</item>
+ <item value="8">1/8</item>
+ <item value="7">1/7</item>
+ <item value="6">1/6</item>
+ <item value="5">1/5</item>
+ <item value="4">1/4</item>
+ <item value="3">1/3</item>
+ <item value="2">1/2</item>
+ <_item msgctxt="Margin" value="0">None</_item>
+ </param>
+ <param name="footer_margin" type="enum" appearance="minimal" _gui-text="Footer margin:">
+ <item value="10">1/10</item>
+ <item value="9">1/9</item>
+ <item value="8">1/8</item>
+ <item value="7">1/7</item>
+ <item value="6">1/6</item>
+ <item value="5">1/5</item>
+ <item value="4">1/4</item>
+ <item value="3">1/3</item>
+ <item value="2">1/2</item>
+ <_item msgctxt="Margin" value="0">None</_item>
+ </param>
+ <param name="left_margin" type="enum" appearance="minimal" _gui-text="Left margin:">
+ <item value="10">1/10</item>
+ <item value="9">1/9</item>
+ <item value="8">1/8</item>
+ <item value="7">1/7</item>
+ <item value="6">1/6</item>
+ <item value="5">1/5</item>
+ <item value="4">1/4</item>
+ <item value="3">1/3</item>
+ <item value="2">1/2</item>
+ <_item msgctxt="Margin" value="0">None</_item>
+ </param>
+ <param name="right_margin" type="enum" appearance="minimal" _gui-text="Right margin:">
+ <item value="10">1/10</item>
+ <item value="9">1/9</item>
+ <item value="8">1/8</item>
+ <item value="7">1/7</item>
+ <item value="6">1/6</item>
+ <item value="5">1/5</item>
+ <item value="4">1/4</item>
+ <item value="3">1/3</item>
+ <item value="2">1/2</item>
+ <_item msgctxt="Margin" value="0">None</_item>
+ </param>
+ <param name="vertical_subdivisions" type="int" min="1" max="1000" _gui-text="Columns:">2</param>
+ <param name="horizontal_subdivisions" type="int" min="1" max="1000" _gui-text="Rows:">3</param>
+ <param name="start_from_edges2" type="boolean" _gui-text="Start from edges">false</param>
+ <param name="delete_existing_guides3" type="boolean" _gui-text="Delete existing guides">false</param>
+ </page>
+ </param>
+ <effect>
+ <object-type>all</object-type>
+ <effects-menu>
+ <submenu _name="Render"/>
+ </effects-menu>
+ </effect>
+ <script>
+ <command reldir="extensions" interpreter="python">guides_creator.py</command>
+ </script>
</inkscape-extension>
diff --git a/share/extensions/guides_creator.py b/share/extensions/guides_creator.py
index 21df1cd50..77ece2e36 100755
--- a/share/extensions/guides_creator.py
+++ b/share/extensions/guides_creator.py
@@ -297,8 +297,8 @@ class Guides_Creator(inkex.Effect):
svg = self.document.getroot()
# getting the width and height attributes of the canvas
- width = float(svg.get('width'))
- height = float(svg.get('height'))
+ width = self.unittouu(svg.get('width'))/self.unittouu('1px')
+ height = self.unittouu(svg.get('height'))/self.unittouu('1px')
# getting edges coordinates
h_orientation = '0,' + str(round(width,4))
diff --git a/share/extensions/hershey.inx b/share/extensions/hershey.inx
index ed20c6bd3..4d923f046 100644
--- a/share/extensions/hershey.inx
+++ b/share/extensions/hershey.inx
@@ -10,42 +10,40 @@
<page name="splash" _gui-text="Render Text">
<param name="text" type="string" _gui-text="Text:">Hershey Text for Inkscape</param>
- <param name="action" type="optiongroup" appearance="minimal"
- _gui-text=" Action: ">
- <_option value="render">Typeset that text</_option>
- <_option value="table" >Write glyph table</_option>
+ <param name="action" type="enum" _gui-text="Action: ">
+ <_item value="render">Typeset that text</_item>
+ <_item value="table" >Write glyph table</_item>
</param>
- <param name="fontface" type="optiongroup" appearance="minimal"
- _gui-text=" Font face: ">
- <_option value="futural">Sans 1-stroke</_option>
- <_option value="futuram">Sans bold</_option>
-
- <_option value="timesr">Serif medium</_option>
- <_option value="timesi">Serif medium italic</_option>
- <_option value="timesib">Serif bold italic</_option>
- <_option value="timesrb">Serif bold</_option>
-
- <_option value="scripts">Script 1-stroke</_option>
- <_option value="cursive">Script 1-stroke (alt)</_option>
- <_option value="scriptc">Script medium</_option>
-
- <_option value="gothiceng">Gothic English</_option>
- <_option value="gothicger">Gothic German</_option>
- <_option value="gothicita">Gothic Italian</_option>
-
- <_option value="greek">Greek 1-stroke</_option>
- <_option value="timesg">Greek medium</_option>
- <_option value="cyrillic">Cyrillic</_option>
- <_option value="japanese">Japanese</_option>
-
- <_option value="astrology">Astrology</_option>
- <_option value="mathlow">Math (lower)</_option>
- <_option value="mathupp">Math (upper)</_option>
- <_option value="markers">Markers</_option>
- <_option value="meteorology">Meteorology</_option>
- <_option value="music">Music</_option>
- <_option value="symbolic">Symbolic</_option>
+ <param name="fontface" type="enum" _gui-text="Font face: ">
+ <_item value="futural">Sans 1-stroke</_item>
+ <_item value="futuram">Sans bold</_item>
+
+ <_item value="timesr">Serif medium</_item>
+ <_item value="timesi">Serif medium italic</_item>
+ <_item value="timesib">Serif bold italic</_item>
+ <_item value="timesrb">Serif bold</_item>
+
+ <_item value="scripts">Script 1-stroke</_item>
+ <_item value="cursive">Script 1-stroke (alt)</_item>
+ <_item value="scriptc">Script medium</_item>
+
+ <_item value="gothiceng">Gothic English</_item>
+ <_item value="gothicger">Gothic German</_item>
+ <_item value="gothicita">Gothic Italian</_item>
+
+ <_item value="greek">Greek 1-stroke</_item>
+ <_item value="timesg">Greek medium</_item>
+ <_item value="cyrillic">Cyrillic</_item>
+ <_item value="japanese">Japanese</_item>
+
+ <_item value="astrology">Astrology</_item>
+ <_item value="mathlow">Math (lower)</_item>
+ <_item value="mathupp">Math (upper)</_item>
+ <_item value="markers">Markers</_item>
+ <_item value="meteorology">Meteorology</_item>
+ <_item value="music">Music</_item>
+ <_item value="symbolic">Symbolic</_item>
</param>
<_param name="emptyspace" type="description" xml:space="preserve">
diff --git a/share/extensions/hpgl_decoder.py b/share/extensions/hpgl_decoder.py
index c195b21e3..e909790b7 100644
--- a/share/extensions/hpgl_decoder.py
+++ b/share/extensions/hpgl_decoder.py
@@ -37,20 +37,21 @@ class hpglDecoder:
'''
self.hpglString = hpglString
self.options = options
- self.scaleX = options.resolutionX / 90.0 # dots/inch to dots/pixels
- self.scaleY = options.resolutionY / 90.0 # dots/inch to dots/pixels
+ self.scaleX = options.resolutionX / 25.4 # dots/inch to dots/mm
+ self.scaleY = options.resolutionY / 25.4 # dots/inch to dots/mm
self.warning = ''
self.textMovements = _("Movements")
self.textPenNumber = _("Pen #")
def getSvg(self):
# prepare document
- self.doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" width="%s" height="%s"></svg>' %
- (self.options.docWidth, self.options.docHeight)))
+ self.doc = inkex.etree.parse(StringIO('<svg xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="%smm" height="%smm" viewBox="0 0 %s %s"></svg>' %
+ (self.options.docWidth, self.options.docHeight, self.options.docWidth, self.options.docHeight)))
+ inkex.etree.SubElement(self.doc.getroot(), inkex.addNS('namedview', 'sodipodi'), {inkex.addNS('document-units', 'inkscape'): 'mm'})
actualLayer = 0
self.layers = {}
if self.options.showMovements:
- self.layers[0] = inkex.etree.SubElement(self.doc.getroot(), 'g', {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textMovements})
+ self.layers[0] = inkex.etree.SubElement(self.doc.getroot(), 'g', {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textMovements, 'id': self.textMovements})
# parse paths
hpglData = self.hpglString.split(';')
if len(hpglData) < 3:
@@ -101,7 +102,7 @@ class hpglDecoder:
self.layers[layerNumber]
except KeyError:
self.layers[layerNumber] = inkex.etree.SubElement(self.doc.getroot(), 'g',
- {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textPenNumber + layerNumber})
+ {inkex.addNS('groupmode', 'inkscape'): 'layer', inkex.addNS('label', 'inkscape'): self.textPenNumber + layerNumber, 'id': self.textPenNumber + layerNumber})
def addPathToLayer(self, path, layerNumber):
lineColor = '000000'
@@ -112,7 +113,7 @@ class hpglDecoder:
def getParameters(self, parameterString):
# process coordinates
if parameterString.strip() == '':
- return []
+ parameterString = '0,0;'
# remove command delimiter
parameterString = parameterString.replace(';', '').strip()
# split parameter
diff --git a/share/extensions/hpgl_input.inx b/share/extensions/hpgl_input.inx
index f40fd4ec0..4cbbba812 100644
--- a/share/extensions/hpgl_input.inx
+++ b/share/extensions/hpgl_input.inx
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
- <_name>HPGL Input</_name>
- <id>org.inkscape.input.hpgl</id>
- <dependency type="executable" location="extensions">hpgl_input.py</dependency>
- <dependency type="executable" location="extensions">hpgl_decoder.py</dependency>
- <dependency type="executable" location="extensions">inkex.py</dependency>
- <_param name="introduction" type="description">Please note that you can only open HPGL files written by Inkscape, to open other HPGL files please change their file extension to .plt, make sure you have UniConverter installed and open them again.</_param>
- <param name="space" type="description">&#xa0;</param>
- <param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis. (Default: 1016.0)">1016.0</param>
- <param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis. (Default: 1016.0)">1016.0</param>
- <param name="showMovements" type="boolean" _gui-text="Show movements between paths" _gui-description="Check this to show movements between paths. (Default: Unchecked)">false</param>
- <input>
- <extension>.hpgl</extension>
- <mimetype>image/hpgl</mimetype>
- <_filetypename>HP Graphics Language file (*.hpgl)</_filetypename>
- <_filetypetooltip>Import an HP Graphics Language file</_filetypetooltip>
- </input>
- <script>
- <command reldir="extensions" interpreter="python">hpgl_input.py</command>
- </script>
+ <_name>HPGL Input</_name>
+ <id>org.inkscape.input.hpgl</id>
+ <dependency type="executable" location="extensions">hpgl_input.py</dependency>
+ <dependency type="executable" location="extensions">hpgl_decoder.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+ <_param name="introduction" type="description">Please note that you can only open HPGL files written by Inkscape, to open other HPGL files please change their file extension to .plt, make sure you have UniConverter installed and open them again.</_param>
+ <param name="space" type="description">&#xa0;</param>
+ <param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi):" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis (Default: 1016.0)">1016.0</param>
+ <param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi):" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis (Default: 1016.0)">1016.0</param>
+ <param name="showMovements" type="boolean" _gui-text="Show movements between paths" _gui-description="Check this to show movements between paths (Default: Unchecked)">false</param>
+ <input>
+ <extension>.hpgl</extension>
+ <mimetype>image/hpgl</mimetype>
+ <_filetypename>HP Graphics Language file (*.hpgl)</_filetypename>
+ <_filetypetooltip>Import an HP Graphics Language file</_filetypetooltip>
+ </input>
+ <script>
+ <command reldir="extensions" interpreter="python">hpgl_input.py</command>
+ </script>
</inkscape-extension>
diff --git a/share/extensions/hpgl_input.py b/share/extensions/hpgl_input.py
index d85a5edd6..a85c32b34 100644
--- a/share/extensions/hpgl_input.py
+++ b/share/extensions/hpgl_input.py
@@ -36,8 +36,8 @@ parser.add_option('--showMovements', action='store', type='inkbool', dest='showM
(options, args) = parser.parse_args(inkex.sys.argv[1:])
# needed to initialize the document
-options.docWidth = 210.0 * 3.5433070866 # 210mm to pixels (DIN A4)
-options.docHeight = 297.0 * 3.5433070866 # 297mm to pixels (DIN A4)
+options.docWidth = 210.0 # 210mm (DIN A4)
+options.docHeight = 297.0 # 297mm (DIN A4)
# read file
fobj = open(args[0], 'r')
diff --git a/share/extensions/hpgl_output.inx b/share/extensions/hpgl_output.inx
index d16cc55e5..bfb3e3567 100644
--- a/share/extensions/hpgl_output.inx
+++ b/share/extensions/hpgl_output.inx
@@ -1,46 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
- <_name>HPGL Output</_name>
- <id>org.ekips.output.hpgl</id>
- <dependency type="extension">org.inkscape.output.svg.inkscape</dependency>
- <dependency type="executable" location="extensions">hpgl_output.py</dependency>
- <dependency type="executable" location="extensions">hpgl_encoder.py</dependency>
- <dependency type="executable" location="extensions">inkex.py</dependency>
- <_param name="introduction" type="description">Please make sure that all objects you want to save are converted to paths. Please use the plotter extension (Extensions menu) to plot directly over a serial connection.</_param>
- <param name="tab" type="notebook">
- <page name="plotter" _gui-text="Plotter Settings ">
- <param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis. (Default: 1016.0)">1016.0</param>
- <param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis. (Default: 1016.0)">1016.0</param>
- <param name="pen" type="int" min="0" max="99" _gui-text="Pen number" _gui-description="The number of the pen (tool) to use. (Standard: '1')">1</param>
- <param name="force" type="int" min="0" max="1000" _gui-text="Pen force (g)" _gui-description="The amount of force pushing down the pen in grams, set to 0 to omit command. Most plotters ignore this command. (Default: 0)">0</param>
- <param name="speed" type="int" min="0" max="10000" _gui-text="Pen speed (cm/s or mm/s)" _gui-description="The speed the pen will move with in centimeters or millimeters per second (depending on your plotter model), set to 0 to omit command. Most plotters ignore this command. (Default: 0)">0</param>
- <param name="orientation" type="optiongroup" appearance="minimal" _gui-text="Rotation (Clockwise)" _gui-description="Rotation of the drawing. (Default: 0°)">
- <option value="0">0°</option>
- <option value="90">90°</option>
- <option value="180">180°</option>
- <option value="270">270°</option>
- </param>
- <param name="mirrorX" type="boolean" _gui-text="Mirror X axis" _gui-description="Check this to mirror the X axis. (Default: Unchecked)">false</param>
- <param name="mirrorY" type="boolean" _gui-text="Mirror Y axis" _gui-description="Check this to mirror the Y axis. (Default: Unchecked)">false</param>
- <param name="center" type="boolean" _gui-text="Center zero point" _gui-description="Check this if your plotter uses a centered zero point. (Default: Unchecked)">false</param>
- </page>
- <page name="overcutToolOffset" _gui-text="Plot Features ">
- <param name="overcut" type="float" min="0.0" max="100.0" precision="2" _gui-text="Overcut (mm)" _gui-description="The distance in mm that will be cut over the starting point of the path to prevent open paths, set to 0.0 to omit command. (Default: 1.00)">1.00</param>
- <param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm)" _gui-description="The offset from the tool tip to the tool axis in mm, set to 0.0 to omit command. (Default: 0.25)">0.25</param>
- <param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing starts to correctly align the tool orientation. (Default: Checked)">true</param>
- <param name="flat" type="float" min="0.1" max="10.0" precision="1" _gui-text="Curve flatness" _gui-description="Curves are divided into lines, this number controls how fine the curves will be reproduced, the smaller the finer. (Default: '1.2')">1.2</param>
- <param name="autoAlign" type="boolean" _gui-text="Auto align" _gui-description="Check this to auto align the drawing to the zero point (Plus the tool offset if used). If unchecked you have to make sure that all parts of your drawing are within the document border! (Default: Checked)">true</param>
- </page>
- </param>
- <_param name="settingsHelp" type="description">All these settings depend on the plotter you use, for more information please consult the manual or homepage for your plotter.</_param>
- <output>
- <extension>.hpgl</extension>
- <mimetype>image/hpgl</mimetype>
- <_filetypename>HP Graphics Language file (*.hpgl)</_filetypename>
- <_filetypetooltip>Export an HP Graphics Language file</_filetypetooltip>
- <dataloss>true</dataloss>
- </output>
- <script>
- <command reldir="extensions" interpreter="python">hpgl_output.py</command>
- </script>
+ <_name>HPGL Output</_name>
+ <id>org.ekips.output.hpgl</id>
+ <dependency type="extension">org.inkscape.output.svg.inkscape</dependency>
+ <dependency type="executable" location="extensions">hpgl_output.py</dependency>
+ <dependency type="executable" location="extensions">hpgl_encoder.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+ <_param name="introduction" type="description">Please make sure that all objects you want to save are converted to paths. Please use the plotter extension (Extensions menu) to plot directly over a serial connection.</_param>
+ <param name="tab" type="notebook">
+ <page name="plotter" _gui-text="Plotter Settings ">
+ <param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi):" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis (Default: 1016.0)">1016.0</param>
+ <param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi):" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis (Default: 1016.0)">1016.0</param>
+ <param name="pen" type="int" min="0" max="99" _gui-text="Pen number:" _gui-description="The number of the pen (tool) to use (Standard: '1')">1</param>
+ <param name="force" type="int" min="0" max="1000" _gui-text="Pen force (g):" _gui-description="The amount of force pushing down the pen in grams, set to 0 to omit command; most plotters ignore this command (Default: 0)">0</param>
+ <param name="speed" type="int" min="0" max="10000" _gui-text="Pen speed (cm/s or mm/s):" _gui-description="The speed the pen will move with in centimeters or millimeters per second (depending on your plotter model), set to 0 to omit command; most plotters ignore this command (Default: 0)">0</param>
+ <param name="orientation" type="enum" _gui-text="Rotation (°, Clockwise):" _gui-description="Rotation of the drawing (Default: 0°)">
+ <item value="0">0</item>
+ <item value="90">90</item>
+ <item value="180">180</item>
+ <item value="270">270</item>
+ </param>
+ <param name="mirrorX" type="boolean" _gui-text="Mirror X axis" _gui-description="Check this to mirror the X axis (Default: Unchecked)">false</param>
+ <param name="mirrorY" type="boolean" _gui-text="Mirror Y axis" _gui-description="Check this to mirror the Y axis (Default: Unchecked)">false</param>
+ <param name="center" type="boolean" _gui-text="Center zero point" _gui-description="Check this if your plotter uses a centered zero point (Default: Unchecked)">false</param>
+ </page>
+ <page name="overcutToolOffset" _gui-text="Plot Features ">
+ <param name="overcut" type="float" min="0.0" max="100.0" precision="2" _gui-text="Overcut (mm):" _gui-description="The distance in mm that will be cut over the starting point of the path to prevent open paths, set to 0.0 to omit command (Default: 1.00)">1.00</param>
+ <param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm):" _gui-description="The offset from the tool tip to the tool axis in mm, set to 0.0 to omit command (Default: 0.25)">0.25</param>
+ <param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing starts to correctly align the tool orientation. (Default: Checked)">true</param>
+ <param name="flat" type="float" min="0.1" max="10.0" precision="1" _gui-text="Curve flatness:" _gui-description="Curves are divided into lines, this number controls how fine the curves will be reproduced, the smaller the finer (Default: '1.2')">1.2</param>
+ <param name="autoAlign" type="boolean" _gui-text="Auto align" _gui-description="Check this to auto align the drawing to the zero point (Plus the tool offset if used). If unchecked you have to make sure that all parts of your drawing are within the document border! (Default: Checked)">true</param>
+ </page>
+ </param>
+ <_param name="settingsHelp" type="description">All these settings depend on the plotter you use, for more information please consult the manual or homepage for your plotter.</_param>
+ <output>
+ <extension>.hpgl</extension>
+ <mimetype>image/hpgl</mimetype>
+ <_filetypename>HP Graphics Language file (*.hpgl)</_filetypename>
+ <_filetypetooltip>Export an HP Graphics Language file</_filetypetooltip>
+ <dataloss>true</dataloss>
+ </output>
+ <script>
+ <command reldir="extensions" interpreter="python">hpgl_output.py</command>
+ </script>
</inkscape-extension>
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index d71b7d7e7..0f880005d 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -168,7 +168,7 @@ class Effect:
try:
stream = open(self.svg_file, 'r')
except Exception:
- errormsg(_("Unable to open specified file: %s") % self.svg_file)
+ errormsg(_("Unable to open object member file: %s") % self.svg_file)
sys.exit()
# Finally, if the filename was not specified anywhere, use
@@ -285,8 +285,8 @@ class Effect:
return 'px'
#a dictionary of unit to user unit conversion factors
- __uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 'm':3543.3070866,
- 'km':3543307.0866, 'pc':15.0, 'yd':3240 , 'ft':1080}
+ __uuconv = {'in':96.0, 'pt':1.33333333333, 'px':1.0, 'mm':3.77952755913, 'cm':37.7952755913,
+ 'm':3779.52755913, 'km':3779527.55913, 'pc':16.0, 'yd':3456.0 , 'ft':1152.0}
def unittouu(self, string):
'''Returns userunits given a string representation of units in another system'''
unit = re.compile('(%s)$' % '|'.join(self.__uuconv.keys()))
diff --git a/share/extensions/inkscape_help_relnotes.inx b/share/extensions/inkscape_help_relnotes.inx
index 9f59513ba..d032eb7e0 100644
--- a/share/extensions/inkscape_help_relnotes.inx
+++ b/share/extensions/inkscape_help_relnotes.inx
@@ -4,7 +4,7 @@
<id>org.inkscape.help.relnotes</id>
<dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
<!-- i18n. Please don't translate it unless a page exists in your language -->
- <_param name="url" gui-hidden="true" type="string">http://wiki.inkscape.org/wiki/index.php/Release_notes/0.49</_param>
+ <_param name="url" gui-hidden="true" type="string">http://wiki.inkscape.org/wiki/index.php/Release_notes/0.91</_param>
<effect needs-document="false">
<object-type>all</object-type>
<effects-menu hidden="true" />
diff --git a/share/extensions/inkscape_help_reportabug.inx b/share/extensions/inkscape_help_reportabug.inx
index 8c3929f3e..81239a8ed 100644
--- a/share/extensions/inkscape_help_reportabug.inx
+++ b/share/extensions/inkscape_help_reportabug.inx
@@ -3,7 +3,7 @@
<_name>Report a Bug</_name>
<id>org.inkscape.help.reportabug</id>
<dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
- <param name="url" gui-hidden="true" type="string">http://inkscape.org/report_bugs.php</param>
+ <param name="url" gui-hidden="true" type="string">http://inkscape.org/contribute/report-bugs/</param>
<effect needs-document="false">
<object-type>all</object-type>
<effects-menu hidden="true"/>
diff --git a/share/extensions/layout_nup.inx b/share/extensions/layout_nup.inx
index bdf650722..2b7734fc3 100644
--- a/share/extensions/layout_nup.inx
+++ b/share/extensions/layout_nup.inx
@@ -15,8 +15,8 @@
<item value="cm">cm</item>
<item value="mm">mm</item>
</param>
- <param name="pgSizeX" type="float" min="0.0" max="9999.0" _gui-text="Size X:">765</param>
- <param name="pgSizeY" type="float" min="0.0" max="9999.0" _gui-text="Size Y:">990</param>
+ <param name="pgSizeX" type="float" min="0.0" max="9999.0" _gui-text="Size X:">816</param>
+ <param name="pgSizeY" type="float" min="0.0" max="9999.0" _gui-text="Size Y:">1056</param>
<_param name="pgMargin" type="description" appearance="header">Page margins</_param>
<param name="pgMarginTop" type="float" indent="1" min="0.0" max="9999.0" _gui-text="Top:">0</param>
<param name="pgMarginBottom" type="float" indent="1" min="0.0" max="9999.0" _gui-text="Bottom:">0</param>
diff --git a/share/extensions/layout_nup_pageframe.py b/share/extensions/layout_nup_pageframe.py
index 59da1f4bb..471a75dd3 100755
--- a/share/extensions/layout_nup_pageframe.py
+++ b/share/extensions/layout_nup_pageframe.py
@@ -38,7 +38,7 @@ def expandTuple(unit, x, length = 4):
#@-node:tbrown.20070622103716.1:expandTuple
#@+node:tbrown.20070622103716.2:GenerateNup
def GenerateNup(unit="px",
- pgSize=("8.5*90","11*90"),
+ pgSize=("8.5*96","11*96"),
pgMargin=(0,0),
pgPadding=(0,0),
num=(2,2),
diff --git a/share/extensions/measure.inx b/share/extensions/measure.inx
index cfbc3fce7..8fae020e0 100644
--- a/share/extensions/measure.inx
+++ b/share/extensions/measure.inx
@@ -9,6 +9,7 @@
<param name="type" type="enum" _gui-text="Measurement Type: ">
<_item value="length">Length</_item>
<_item msgctxt="measure extension" value="area">Area</_item>
+ <_item msgctxt="measure extension" value="cofm">Center of Mass</_item>
</param>
<param name="format" type="enum" _gui-text="Text Orientation: ">
<_item msgctxt="measure extension" value="textonpath">Text On Path</_item>
@@ -32,9 +33,9 @@
</param>
</page>
<page name="desc" _gui-text="Help">
- <_param name="measurehelp" type="description" xml:space="preserve">This effect measures the length, or area, of the selected paths and adds it as a text object with the selected units.
-
- * Display format can be either Text-On-Path, or stand-alone text at a specified angle.
+ <_param name="measurehelp" type="description" xml:space="preserve">This effect measures the length, area, or center-of-mass of the selected paths. Length and area are added as a text object with the selected units. Center-of-mass is shown as a cross symbol.
+
+ * Text display format can be either Text-On-Path, or stand-alone text at a specified angle.
* The number of significant digits can be controlled by the Precision field.
* The Offset field controls the distance from the text to the path.
* The Scale factor can be used to make measurements in scaled drawings. For example, if 1 cm in the drawing equals 2.5 m in the real world, Scale must be set to 250.
diff --git a/share/extensions/measure.py b/share/extensions/measure.py
index ca471816f..edcd2e92f 100755
--- a/share/extensions/measure.py
+++ b/share/extensions/measure.py
@@ -1,8 +1,9 @@
#!/usr/bin/env python
'''
This extension module can measure arbitrary path and object length
-It adds a text to the selected path containing the length in a
-given unit.
+It adds text to the selected path containing the length in a given unit.
+Area and Center of Mass calculated using Green's Theorem:
+http://mathworld.wolfram.com/GreensTheorem.html
Copyright (C) 2010 Alvin Penner
Copyright (C) 2006 Georg Wiora
@@ -30,10 +31,31 @@ TODO:
2. check direction >90 or <-90 Degrees
3. rotate by 180 degrees around text center
'''
-import inkex, simplestyle, simplepath, simpletransform, sys, cubicsuperpath, bezmisc, locale
-# Set current system locale
+# standard library
+import locale
+# local library
+import inkex
+import simplestyle
+import simpletransform
+import cubicsuperpath
+import bezmisc
+
+inkex.localize()
locale.setlocale(locale.LC_ALL, '')
+# third party
+try:
+ import numpy
+except:
+ inkex.errormsg(_("Failed to import the numpy modules. These modules are required by this extension. Please install them and try again. On a Debian-like system this can be done with the command, sudo apt-get install python-numpy."))
+ exit()
+
+mat_area = numpy.matrix([[ 0, 2, 1, -3],[ -2, 0, 1, 1],[ -1, -1, 0, 2],[ 3, -1, -2, 0]])
+mat_cofm_0 = numpy.matrix([[ 0, 35, 10,-45],[-35, 0, 12, 23],[-10,-12, 0, 22],[ 45,-23,-22, 0]])
+mat_cofm_1 = numpy.matrix([[ 0, 15, 3,-18],[-15, 0, 9, 6],[ -3, -9, 0, 12],[ 18, -6,-12, 0]])
+mat_cofm_2 = numpy.matrix([[ 0, 12, 6,-18],[-12, 0, 9, 3],[ -6, -9, 0, 15],[ 18, -3,-15, 0]])
+mat_cofm_3 = numpy.matrix([[ 0, 22, 23,-45],[-22, 0, 12, 10],[-23,-12, 0, 35],[ 45,-10,-35, 0]])
+
def numsegs(csp):
return sum([len(p)-1 for p in csp])
def interpcoord(v1,v2,p):
@@ -69,20 +91,37 @@ def csplength(csp):
for i in xrange(1,len(sp)):
l = cspseglength(sp[i-1],sp[i])
lengths[-1].append(l)
- total += l
+ total += l
return lengths, total
def csparea(csp):
area = 0.0
for sp in csp:
+ if len(sp) < 2: continue
for i in range(len(sp)): # calculate polygon area
area += 0.5*sp[i-1][1][0]*(sp[i][1][1] - sp[i-2][1][1])
for i in range(1, len(sp)): # add contribution from cubic Bezier
- bezarea = ( 0.0*sp[i-1][1][1] + 2.0*sp[i-1][2][1] + 1.0*sp[i][0][1] - 3.0*sp[i][1][1])*sp[i-1][1][0]
- bezarea += (-2.0*sp[i-1][1][1] + 0.0*sp[i-1][2][1] + 1.0*sp[i][0][1] + 1.0*sp[i][1][1])*sp[i-1][2][0]
- bezarea += (-1.0*sp[i-1][1][1] - 1.0*sp[i-1][2][1] + 0.0*sp[i][0][1] + 2.0*sp[i][1][1])*sp[i][0][0]
- bezarea += ( 3.0*sp[i-1][1][1] - 1.0*sp[i-1][2][1] - 2.0*sp[i][0][1] + 0.0*sp[i][1][1])*sp[i][1][0]
- area += 0.15*bezarea
- return abs(area)
+ vec_x = numpy.matrix([sp[i-1][1][0], sp[i-1][2][0], sp[i][0][0], sp[i][1][0]])
+ vec_y = numpy.matrix([sp[i-1][1][1], sp[i-1][2][1], sp[i][0][1], sp[i][1][1]])
+ area += 0.15*(vec_x*mat_area*vec_y.T)[0,0]
+ return -area # require positive area for CCW
+def cspcofm(csp):
+ area = csparea(csp)
+ xc = 0.0
+ yc = 0.0
+ if abs(area) < 1.e-8:
+ inkex.errormsg(_("Area is zero, cannot calculate Center of Mass"))
+ return 0, 0
+ for sp in csp:
+ for i in range(len(sp)): # calculate polygon moment
+ xc += sp[i-1][1][1]*(sp[i-2][1][0] - sp[i][1][0])*(sp[i-2][1][0] + sp[i-1][1][0] + sp[i][1][0])/6
+ yc += sp[i-1][1][0]*(sp[i][1][1] - sp[i-2][1][1])*(sp[i-2][1][1] + sp[i-1][1][1] + sp[i][1][1])/6
+ for i in range(1, len(sp)): # add contribution from cubic Bezier
+ vec_x = numpy.matrix([sp[i-1][1][0], sp[i-1][2][0], sp[i][0][0], sp[i][1][0]])
+ vec_y = numpy.matrix([sp[i-1][1][1], sp[i-1][2][1], sp[i][0][1], sp[i][1][1]])
+ vec_t = numpy.matrix([(vec_x*mat_cofm_0*vec_y.T)[0,0], (vec_x*mat_cofm_1*vec_y.T)[0,0], (vec_x*mat_cofm_2*vec_y.T)[0,0], (vec_x*mat_cofm_3*vec_y.T)[0,0]])
+ xc += (vec_x*vec_t.T)[0,0]/280
+ yc += (vec_y*vec_t.T)[0,0]/280
+ return -xc/area, -yc/area
def appendSuperScript(node, text):
super = inkex.etree.SubElement(node, inkex.addNS('tspan', 'svg'), {'style': 'font-size:65%;baseline-shift:super'})
super.text = text
@@ -133,12 +172,13 @@ class Length(inkex.Effect):
self.OptionParser.add_option("--measurehelp",
action="store", type="string",
dest="measurehelp", default="",
- help="dummy")
-
+ help="dummy")
+
def effect(self):
# get number of digits
prec = int(self.options.precision)
- self.options.offset *= self.unittouu('1px')
+ scale = self.unittouu('1px') # convert to document units
+ self.options.offset *= scale
factor = 1.0
doc = self.document.getroot()
if doc.get('viewBox'):
@@ -150,16 +190,22 @@ class Length(inkex.Effect):
# loop over all selected paths
for id, node in self.selected.iteritems():
if node.tag == inkex.addNS('path','svg'):
- self.group = inkex.etree.SubElement(node.getparent(),inkex.addNS('text','svg'))
- a =[]
mat = simpletransform.composeParents(node, [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])
p = cubicsuperpath.parsePath(node.get('d'))
simpletransform.applyTransformToPath(mat, p)
- factor *= self.unittouu('1px')/self.unittouu('1'+self.options.unit)
+ factor *= scale/self.unittouu('1'+self.options.unit)
if self.options.type == "length":
slengths, stotal = csplength(p)
- else:
+ self.group = inkex.etree.SubElement(node.getparent(),inkex.addNS('text','svg'))
+ elif self.options.type == "area":
stotal = csparea(p)*factor*self.options.scale
+ self.group = inkex.etree.SubElement(node.getparent(),inkex.addNS('text','svg'))
+ else:
+ xc, yc = cspcofm(p)
+ self.group = inkex.etree.SubElement(node.getparent(),inkex.addNS('path','svg'))
+ self.group.set('id', 'MassCenter_' + node.get('id'))
+ self.addCross(self.group, xc, yc, scale)
+ continue
# Format the length as string
lenstr = locale.format("%(len)25."+str(prec)+"f",{'len':round(stotal*factor*self.options.scale,prec)}).strip()
if self.options.format == 'textonpath':
@@ -173,6 +219,11 @@ class Length(inkex.Effect):
else:
self.addTextWithTspan(self.group, p[0][0][1][0], p[0][0][1][1], lenstr+' '+self.options.unit+'^2', id, 'start', -int(self.options.angle), -self.options.offset + self.options.fontsize/2)
+ def addCross(self, node, x, y, scale):
+ l = 3*scale # 3 pixels in document units
+ node.set('d', 'm %s,%s %s,0 %s,0 m %s,%s 0,%s 0,%s' % (str(x-l), str(y), str(l), str(l), str(-l), str(-l), str(l), str(l)))
+ node.set('style', 'stroke:#000000;fill:none;stroke-width:%s' % str(0.5*scale))
+
def addTextOnPath(self, node, x, y, text, id, anchor, startOffset, dy = 0):
new = inkex.etree.SubElement(node,inkex.addNS('textPath','svg'))
s = {'text-align': 'center', 'vertical-align': 'bottom',
diff --git a/share/extensions/perfectboundcover.py b/share/extensions/perfectboundcover.py
index 6cdab7eab..9f81dbb36 100755
--- a/share/extensions/perfectboundcover.py
+++ b/share/extensions/perfectboundcover.py
@@ -135,7 +135,7 @@ class PerfectBoundCover(inkex.Effect):
for guide in guides:
newguide = inkex.etree.Element(inkex.addNS('guide','sodipodi'))
newguide.set("orientation", guide[0])
- newguide.set("position", "%f" % (guide[1] * 90))
+ newguide.set("position", "%f" % (guide[1] * 96))
namedview[0].append(newguide)
'''
diff --git a/share/extensions/plotter.inx b/share/extensions/plotter.inx
index fc620f8a3..80543f02a 100644
--- a/share/extensions/plotter.inx
+++ b/share/extensions/plotter.inx
@@ -1,82 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
- <_name>Plot</_name>
- <id>org.ekips.filter.plot</id>
- <dependency type="executable" location="extensions">plotter.py</dependency>
- <dependency type="executable" location="extensions">hpgl_decoder.py</dependency>
- <dependency type="executable" location="extensions">hpgl_encoder.py</dependency>
- <dependency type="executable" location="extensions">inkex.py</dependency>
- <_param name="introduction" type="description">Please make sure that all objects you want to plot are converted to paths.</_param>
- <param name="tab" type="notebook">
- <page name="misc" _gui-text="Connection Settings ">
- <param name="serialPort" type="string" _gui-text="Serial port" _gui-description="The port of your serial connection, on Windows something like 'COM1', on Linux something like: '/dev/ttyUSB0'. (Default: COM1)">COM1</param>
- <param name="serialBaudRate" type="optiongroup" appearance="minimal" _gui-text="Serial baud rate" _gui-description="The Baud rate of your serial connection. (Default: 9600)">
- <option value="9600">9600</option>
- <option value="110">110</option>
- <option value="300">300</option>
- <option value="600">600</option>
- <option value="1200">1200</option>
- <option value="2400">2400</option>
- <option value="4800">4800</option>
- <option value="9600">9600</option>
- <option value="14400">14400</option>
- <option value="19200">19200</option>
- <option value="28800">28800</option>
- <option value="38400">38400</option>
- <option value="56000">56000</option>
- <option value="57600">57600</option>
- <option value="115200">115200</option>
- </param>
- <param name="flowControl" type="optiongroup" appearance="minimal" _gui-text="Flow control" _gui-description="The Software / Hardware flow control of your serial connection. (Default: Software)">
- <_option value="xonxoff">Software (XON/XOFF)</_option>
- <_option value="rtscts">Hardware (RTS/CTS)</_option>
- <_option value="dsrdtrrtscts">Hardware (DSR/DTR + RTS/CTS)</_option>
- <_option value="">None</_option>
- </param>
- <param name="commandLanguage" type="optiongroup" appearance="minimal" _gui-text="Command language" _gui-description="The command language to use. (Default: HPGL)">
- <option value="HPGL">HPGL</option>
- <option value="DMPL">DMPL</option>
- <option value="ZING">KNK Zing (HPGL variant)</option>
- </param>
- <param name="space" type="description">&#xa0;</param>
- <_param name="freezeHelp" type="description">Using wrong settings can under certain circumstances cause Inkscape to freeze. Always save your work before plotting!</_param>
- <_param name="serialHelp" type="description">This can be a physical serial connection or a USB-to-Serial bridge. Ask your plotter manufacturer for drivers if needed.</_param>
- <_param name="parallelHelp" type="description">Parallel (LPT) connections are not supported.</_param>
- </page>
- <page name="plotter" _gui-text="Plotter Settings ">
- <param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis. (Default: 1016.0)">1016.0</param>
- <param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi)" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis. (Default: 1016.0)">1016.0</param>
- <param name="pen" type="int" min="0" max="99" _gui-text="Pen number" _gui-description="The number of the pen (tool) to use. (Standard: '1')">1</param>
- <param name="force" type="int" min="0" max="1000" _gui-text="Pen force (g)" _gui-description="The amount of force pushing down the pen in grams, set to 0 to omit command. Most plotters ignore this command. (Default: 0)">0</param>
- <param name="speed" type="int" min="0" max="10000" _gui-text="Pen speed (cm/s or mm/s)" _gui-description="The speed the pen will move with in centimeters or millimeters per second (depending on your plotter model), set to 0 to omit command. Most plotters ignore this command. (Default: 0)">0</param>
- <param name="orientation" type="optiongroup" appearance="minimal" _gui-text="Rotation (Clockwise)" _gui-description="Rotation of the drawing. (Default: 0°)">
- <option value="0">0°</option>
- <option value="90">90°</option>
- <option value="180">180°</option>
- <option value="270">270°</option>
- </param>
- <param name="mirrorX" type="boolean" _gui-text="Mirror X axis" _gui-description="Check this to mirror the X axis. (Default: Unchecked)">false</param>
- <param name="mirrorY" type="boolean" _gui-text="Mirror Y axis" _gui-description="Check this to mirror the Y axis. (Default: Unchecked)">false</param>
- <param name="center" type="boolean" _gui-text="Center zero point" _gui-description="Check this if your plotter uses a centered zero point. (Default: Unchecked)">false</param>
- </page>
- <page name="misc" _gui-text="Plot Features ">
- <param name="overcut" type="float" min="0.0" max="100.0" precision="2" _gui-text="Overcut (mm)" _gui-description="The distance in mm that will be cut over the starting point of the path to prevent open paths, set to 0.0 to omit command. (Default: 1.00)">1.00</param>
- <param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm)" _gui-description="The offset from the tool tip to the tool axis in mm, set to 0.0 to omit command. (Default: 0.25)">0.25</param>
- <param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing starts to correctly align the tool orientation. (Default: Checked)">true</param>
- <param name="flat" type="float" min="0.1" max="10.0" precision="1" _gui-text="Curve flatness" _gui-description="Curves are divided into lines, this number controls how fine the curves will be reproduced, the smaller the finer. (Default: '1.2')">1.2</param>
- <param name="autoAlign" type="boolean" _gui-text="Auto align" _gui-description="Check this to auto align the drawing to the zero point (Plus the tool offset if used). If unchecked you have to make sure that all parts of your drawing are within the document border! (Default: Checked)">true</param>
- <param name="space" type="description">&#xa0;</param>
- <param name="debug" type="boolean" _gui-text="Show debug information" _gui-description="Check this to get verbose information about the plot without actually sending something to the plotter (A.k.a. data dump). (Default: Unchecked)">false</param>
- </page>
- </param>
- <_param name="settingsHelp" type="description">All these settings depend on the plotter you use, for more information please consult the manual or homepage for your plotter.</_param>
- <effect needs-live-preview="false" needs-document="true">
- <object-type>path</object-type>
- <effects-menu>
- <submenu _name="Export"/>
- </effects-menu>
- </effect>
- <script>
- <command reldir="extensions" interpreter="python">plotter.py</command>
- </script>
+ <_name>Plot</_name>
+ <id>org.ekips.filter.plot</id>
+ <dependency type="executable" location="extensions">plotter.py</dependency>
+ <dependency type="executable" location="extensions">hpgl_decoder.py</dependency>
+ <dependency type="executable" location="extensions">hpgl_encoder.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+ <_param name="introduction" type="description">Please make sure that all objects you want to plot are converted to paths.</_param>
+ <param name="tab" type="notebook">
+ <page name="misc" _gui-text="Connection Settings ">
+ <param name="serialPort" type="string" _gui-text="Serial port:" _gui-description="The port of your serial connection, on Windows something like 'COM1', on Linux something like: '/dev/ttyUSB0' (Default: COM1)">COM1</param>
+ <param name="serialBaudRate" type="enum" _gui-text="Serial baud rate:" _gui-description="The Baud rate of your serial connection (Default: 9600)">
+ <item value="9600">9600</item>
+ <item value="110">110</item>
+ <item value="300">300</item>
+ <item value="600">600</item>
+ <item value="1200">1200</item>
+ <item value="2400">2400</item>
+ <item value="4800">4800</item>
+ <item value="9600">9600</item>
+ <item value="14400">14400</item>
+ <item value="19200">19200</item>
+ <item value="28800">28800</item>
+ <item value="38400">38400</item>
+ <item value="56000">56000</item>
+ <item value="57600">57600</item>
+ <item value="115200">115200</item>
+ </param>
+ <param name="flowControl" type="enum" _gui-text="Flow control:" _gui-description="The Software / Hardware flow control of your serial connection (Default: Software)">
+ <_item value="xonxoff">Software (XON/XOFF)</_item>
+ <_item value="rtscts">Hardware (RTS/CTS)</_item>
+ <_item value="dsrdtrrtscts">Hardware (DSR/DTR + RTS/CTS)</_item>
+ <_item msgctxt="Flow control" value="">None</_item>
+ </param>
+ <param name="commandLanguage" type="enum" _gui-text="Command language:" _gui-description="The command language to use (Default: HPGL)">
+ <_item value="HPGL">HPGL</_item>
+ <_item value="DMPL">DMPL</_item>
+ <_item value="ZING">KNK Zing (HPGL variant)</_item>
+ </param>
+ <param name="space" type="description">&#xa0;</param>
+ <_param name="freezeHelp" type="description">Using wrong settings can under certain circumstances cause Inkscape to freeze. Always save your work before plotting!</_param>
+ <_param name="serialHelp" type="description">This can be a physical serial connection or a USB-to-Serial bridge. Ask your plotter manufacturer for drivers if needed.</_param>
+ <_param name="parallelHelp" type="description">Parallel (LPT) connections are not supported.</_param>
+ </page>
+ <page name="plotter" _gui-text="Plotter Settings ">
+ <param name="resolutionX" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution X (dpi):" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the X axis (Default: 1016.0)">1016.0</param>
+ <param name="resolutionY" type="float" min="1.0" max="4096.0" precision="1" _gui-text="Resolution Y (dpi):" _gui-description="The amount of steps the plotter moves if it moves for 1 inch on the Y axis (Default: 1016.0)">1016.0</param>
+ <param name="pen" type="int" min="0" max="99" _gui-text="Pen number:" _gui-description="The number of the pen (tool) to use (Standard: '1')">1</param>
+ <param name="force" type="int" min="0" max="1000" _gui-text="Pen force (g):" _gui-description="The amount of force pushing down the pen in grams, set to 0 to omit command; most plotters ignore this command (Default: 0)">0</param>
+ <param name="speed" type="int" min="0" max="10000" _gui-text="Pen speed (cm/s or mm/s):" _gui-description="The speed the pen will move with in centimeters or millimeters per second (depending on your plotter model), set to 0 to omit command. Most plotters ignore this command. (Default: 0)">0</param>
+ <param name="orientation" type="enum" _gui-text="Rotation (°, clockwise):" _gui-description="Rotation of the drawing (Default: 0°)">
+ <item value="0">0</item>
+ <item value="90">90</item>
+ <item value="180">180</item>
+ <item value="270">270</item>
+ </param>
+ <param name="mirrorX" type="boolean" _gui-text="Mirror X axis" _gui-description="Check this to mirror the X axis (Default: Unchecked)">false</param>
+ <param name="mirrorY" type="boolean" _gui-text="Mirror Y axis" _gui-description="Check this to mirror the Y axis (Default: Unchecked)">false</param>
+ <param name="center" type="boolean" _gui-text="Center zero point" _gui-description="Check this if your plotter uses a centered zero point (Default: Unchecked)">false</param>
+ </page>
+ <page name="misc" _gui-text="Plot Features ">
+ <param name="overcut" type="float" min="0.0" max="100.0" precision="2" _gui-text="Overcut (mm):" _gui-description="The distance in mm that will be cut over the starting point of the path to prevent open paths, set to 0.0 to omit command (Default: 1.00)">1.00</param>
+ <param name="toolOffset" type="float" min="0.0" max="20.0" precision="2" _gui-text="Tool offset (mm):" _gui-description="The offset from the tool tip to the tool axis in mm, set to 0.0 to omit command (Default: 0.25)">0.25</param>
+ <param name="precut" type="boolean" _gui-text="Use precut" _gui-description="Check this to cut a small line before the real drawing starts to correctly align the tool orientation. (Default: Checked)">true</param>
+ <param name="flat" type="float" min="0.1" max="10.0" precision="1" _gui-text="Curve flatness:" _gui-description="Curves are divided into lines, this number controls how fine the curves will be reproduced, the smaller the finer (Default: '1.2')">1.2</param>
+ <param name="autoAlign" type="boolean" _gui-text="Auto align" _gui-description="Check this to auto align the drawing to the zero point (Plus the tool offset if used). If unchecked you have to make sure that all parts of your drawing are within the document border! (Default: Checked)">true</param>
+ <param name="space" type="description">&#xa0;</param>
+ <param name="debug" type="boolean" _gui-text="Show debug information" _gui-description="Check this to get verbose information about the plot without actually sending something to the plotter (A.k.a. data dump) (Default: Unchecked)">false</param>
+ </page>
+ </param>
+ <_param name="settingsHelp" type="description">All these settings depend on the plotter you use, for more information please consult the manual or homepage for your plotter.</_param>
+ <effect needs-live-preview="false" needs-document="true">
+ <object-type>path</object-type>
+ <effects-menu>
+ <submenu _name="Export"/>
+ </effects-menu>
+ </effect>
+ <script>
+ <command reldir="extensions" interpreter="python">plotter.py</command>
+ </script>
</inkscape-extension>
diff --git a/share/extensions/print_win32_vector.py b/share/extensions/print_win32_vector.py
index ca166d25a..37c2021ac 100644
--- a/share/extensions/print_win32_vector.py
+++ b/share/extensions/print_win32_vector.py
@@ -199,7 +199,7 @@ class MyEffect(inkex.Effect):
if mygdi.StartDocA(self.hDC, byref(docInfo)) < 0:
exit() # user clicked Cancel
- self.scale = (ord(pDevMode[58]) + 256.0*ord(pDevMode[59]))/90 # use PrintQuality from DEVMODE
+ self.scale = (ord(pDevMode[58]) + 256.0*ord(pDevMode[59]))/96 # use PrintQuality from DEVMODE
self.groupmat = [[[self.scale, 0.0, 0.0], [0.0, self.scale, 0.0]]]
doc = self.document.getroot()
self.process_group(doc)
diff --git a/share/extensions/render_barcode.inx b/share/extensions/render_barcode.inx
index 64d828a19..debefadad 100644
--- a/share/extensions/render_barcode.inx
+++ b/share/extensions/render_barcode.inx
@@ -5,17 +5,17 @@
<dependency type="executable" location="extensions">inkex.py</dependency>
<dependency type="executable" location="extensions">render_barcode.py</dependency>
<param name="type" type="enum" _gui-text="Barcode Type:">
- <item value="ean5">EAN5</item>
- <item value="ean8">EAN8</item>
- <item value="ean13">EAN13</item>
- <item value="upca">UPC-A</item>
- <item value="upce">UPC-E</item>
- <item value="code25i">Code25 Interleaved 2 of 5</item>
- <item value="code39">Code39</item>
- <item value="code39ext">Code39 Extended</item>
- <item value="code93">Code93</item>
- <item value="code128">Code128</item>
- <item value="rm4scc">RM4CC / RM4SCC</item>
+ <item value="Ean5">EAN5</item>
+ <item value="Ean8">EAN8</item>
+ <item value="Ean13">EAN13</item>
+ <item value="Upca">UPC-A</item>
+ <item value="Upce">UPC-E</item>
+ <item value="Code25i">Code25 Interleaved 2 of 5</item>
+ <item value="Code39">Code39</item>
+ <item value="Code39Ext">Code39 Extended</item>
+ <item value="Code93">Code93</item>
+ <item value="Code128">Code128</item>
+ <item value="Rm4scc">RM4CC / RM4SCC</item>
</param>
<param name="text" type="string" _gui-text="Barcode Data:"></param>
<param name="height" type="int" _gui-text="Bar Height:" min="20" max="80">30</param>
diff --git a/share/extensions/render_barcode.py b/share/extensions/render_barcode.py
index c3b809c9e..694dcc8f3 100755
--- a/share/extensions/render_barcode.py
+++ b/share/extensions/render_barcode.py
@@ -26,41 +26,52 @@ import sys
from Barcode import getBarcode
class InsertBarcode(inkex.Effect):
- def __init__(self):
- inkex.Effect.__init__(self)
- self.OptionParser.add_option("-l", "--height",
- action="store", type="int",
- dest="height", default=30,
- help="Barcode Height")
- self.OptionParser.add_option("-t", "--type",
- action="store", type="string",
- dest="type", default='',
- help="Barcode Type")
- self.OptionParser.add_option("-d", "--text",
- action="store", type="string",
- dest="text", default='',
- help="Text to print on barcode")
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-l", "--height",
+ action="store", type="int",
+ dest="height", default=30,
+ help="Barcode Height")
+ self.OptionParser.add_option("-t", "--type",
+ action="store", type="string",
+ dest="type", default='',
+ help="Barcode Type")
+ self.OptionParser.add_option("-d", "--text",
+ action="store", type="string",
+ dest="text", default='',
+ help="Text to print on barcode")
+
+ def effect(self):
+ x, y = self.view_center
+ bargen = getBarcode( self.options.type,
+ text=self.options.text,
+ height=self.options.height,
+ document=self.document,
+ x=x, y=y,
+ scale=self.unittouu('1px'),
+ )
+ if bargen is not None:
+ barcode = bargen.generate()
+ if barcode is not None:
+ self.current_layer.append(barcode)
+ else:
+ sys.stderr.write("No barcode was generated\n")
+ else:
+ sys.stderr.write("Unable to make barcode with: " + str(self.options) + "\n")
+
+def test_barcode():
+ bargen = getBarcode("Ean13", text="123456789101")
+ if bargen is not None:
+ barcode = bargen.generate()
+ if barcode:
+ print inkex.etree.tostring(barcode, pretty_print=True)
- def effect(self):
- x, y = self.view_center
- bargen = getBarcode( self.options.type, {
- 'text' : self.options.text,
- 'height' : self.options.height,
- 'document' : self.document,
- 'x' : x,
- 'y' : y,
- 'scale' : self.unittouu('1px'),
- } )
- if bargen is not None:
- barcode = bargen.generate()
- if barcode is not None:
- self.current_layer.append(barcode)
- else:
- sys.stderr.write("No barcode was generated\n")
- else:
- sys.stderr.write("Unable to make barcode with: " + str(self.options) + "\n")
if __name__ == '__main__':
- e = InsertBarcode()
- e.affect()
+ if len(sys.argv) == 1:
+ # Debug mode without inkex
+ test_barcode()
+ exit(0)
+ e = InsertBarcode()
+ e.affect()
diff --git a/share/extensions/render_barcode_datamatrix.py b/share/extensions/render_barcode_datamatrix.py
index bca1d2241..83d009db8 100755
--- a/share/extensions/render_barcode_datamatrix.py
+++ b/share/extensions/render_barcode_datamatrix.py
@@ -140,7 +140,7 @@ def get_parameters(nrow, ncol):
elif ( nrow == 20 and ncol == 20 ):
return 18, 18, 1, 1, 22, 18, 1
elif ( nrow == 22 and ncol == 22 ):
- return 18, 18, 1, 1, 30, 20, 1
+ return 20, 20, 1, 1, 30, 20, 1
elif ( nrow == 24 and ncol == 24 ):
return 22, 22, 1, 1, 36, 24, 1
elif ( nrow == 26 and ncol == 26 ):
diff --git a/share/extensions/scour.inx b/share/extensions/scour.inx
index ee245b149..45719deeb 100644
--- a/share/extensions/scour.inx
+++ b/share/extensions/scour.inx
@@ -22,7 +22,7 @@
<param name="indent" type="enum" _gui-text="XML indentation (pretty-printing):">
<_item value="space">Space</_item>
<_item value="tab">Tab</_item>
- <_item value="none">None</_item>
+ <_item msgctxt="Indent" value="none">None</_item>
</param>
</page>
<page name="Ids" _gui-text="Ids">
diff --git a/share/extensions/scour.py b/share/extensions/scour.py
index 7fdd55b28..236529daa 100644
--- a/share/extensions/scour.py
+++ b/share/extensions/scour.py
@@ -8,11 +8,14 @@
#
# This file is part of Scour, http://www.codedread.com/scour/
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# This library is free software; you can redistribute it and/or modify
+# it either under the terms of the Apache License, Version 2.0, or, at
+# your option, under the terms and conditions of the GNU General
+# Public License, Version 2 or newer as published by the Free Software
+# Foundation. You may obtain a copy of these Licenses at:
#
# http://www.apache.org/licenses/LICENSE-2.0
+# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -247,6 +250,7 @@ colors = {
'plum': 'rgb(221, 160, 221)',
'powderblue': 'rgb(176, 224, 230)',
'purple': 'rgb(128, 0, 128)',
+ 'rebeccapurple': 'rgb(102, 51, 153)',
'red': 'rgb(255, 0, 0)',
'rosybrown': 'rgb(188, 143, 143)',
'royalblue': 'rgb( 65, 105, 225)',
diff --git a/share/extensions/seamless_pattern.inx b/share/extensions/seamless_pattern.inx
new file mode 100644
index 000000000..fe4098e05
--- /dev/null
+++ b/share/extensions/seamless_pattern.inx
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
+ <_name>Seamless Pattern</_name>
+ <id>org.inkscape.render.seamless_pattern</id>
+ <dependency type="executable" location="extensions">seamless_pattern.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+ <param name="width" _gui-text="Custom Width (px.):" type="int" min="1" max="99999999">100</param>
+ <param name="height" _gui-text="Custom Height (px.):" type="int" min="1" max="99999999">100</param>
+ <_param name="help-info" type="description">This extension overwrite current document</_param>
+
+ <effect needs-live-preview="false">
+ <object-type>All</object-type>
+ <effects-menu>
+ <submenu _name="Render"/>
+ </effects-menu>
+ </effect>
+ <script>
+ <command reldir="extensions" interpreter="python">seamless_pattern.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/seamless_pattern.py b/share/extensions/seamless_pattern.py
new file mode 100644
index 000000000..f48de954a
--- /dev/null
+++ b/share/extensions/seamless_pattern.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+
+# Written by Jabiertxof
+# V.04
+
+import inkex
+import re
+import os
+from lxml import etree
+
+class C(inkex.Effect):
+ def __init__(self):
+ inkex.Effect.__init__(self)
+ self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="desktop_width", default="100", help="Custom width")
+ self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="desktop_height", default="100", help="Custom height")
+
+ def effect(self):
+
+ width = self.options.desktop_width
+ height = self.options.desktop_height
+ path = os.path.dirname(os.path.realpath(__file__))
+ self.document = etree.parse(os.path.join(path, "seamless_pattern.svg"))
+ root = self.document.getroot()
+ root.set("id", "SVGRoot")
+ root.set("width", str(width) + 'px')
+ root.set("height", str(height) + 'px')
+ root.set("viewBox", "0 0 " + str(width) + " " + str(height) )
+
+ xpathStr = '//svg:rect[@id="clipPathRect"]'
+ clipPathRect = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clipPathRect != []:
+ clipPathRect[0].set("width", str(width))
+ clipPathRect[0].set("height", str(height))
+
+ xpathStr = '//svg:g[@id="designTop"] | //svg:g[@id="designBottom"]'
+ designZone = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if designZone != []:
+ designZone[0].set("transform", "scale(" + str(width/100.) + ","+ str(height/100.) + ")")
+ designZone[1].set("transform", "scale(" + str(width/100.) + ","+ str(height/100.) + ")")
+
+ xpathStr = '//svg:use[@id="top1"] | //svg:use[@id="bottom1"]'
+ pattern1 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern1 != []:
+ pattern1[0].set("transform", "translate(" + str(-width) + "," + str(-height) + ")")
+ pattern1[1].set("transform", "translate(" + str(-width) + "," + str(-height) + ")")
+
+ xpathStr = '//svg:use[@id="top2"] | //svg:use[@id="bottom2"]'
+ pattern2 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern2 != []:
+ pattern2[0].set("transform", "translate(0," + str(-height) +")" )
+ pattern2[1].set("transform", "translate(0," + str(-height) +")" )
+
+ xpathStr = '//svg:use[@id="top3"] | //svg:use[@id="bottom3"]'
+ pattern3 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern3 != []:
+ pattern3[0].set("transform", "translate(" + str(width) + "," + str(-height) + ")" )
+ pattern3[1].set("transform", "translate(" + str(width) + "," + str(-height) + ")" )
+
+ xpathStr = '//svg:use[@id="top4"] | //svg:use[@id="bottom4"]'
+ pattern4 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern4 != []:
+ pattern4[0].set("transform", "translate(" + str(-width) + ",0)" )
+ pattern4[1].set("transform", "translate(" + str(-width) + ",0)" )
+
+ xpathStr = '//svg:use[@id="top5"] | //svg:use[@id="bottom5"]'
+ pattern5 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern5 != []:
+ pattern5[0].set("transform", "translate(0,0)" )
+ pattern5[1].set("transform", "translate(0,0)" )
+
+ xpathStr = '//svg:use[@id="top6"] | //svg:use[@id="bottom6"]'
+ pattern6 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern6 != []:
+ pattern6[0].set("transform", "translate(" + str(width) + ",0)" )
+ pattern6[1].set("transform", "translate(" + str(width) + ",0)" )
+
+ xpathStr = '//svg:use[@id="top7"] | //svg:use[@id="bottom7"]'
+ pattern7 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern7 != []:
+ pattern7[0].set("transform", "translate(" + str(-width) + "," + str(height) + ")" )
+ pattern7[1].set("transform", "translate(" + str(-width) + "," + str(height) + ")" )
+
+ xpathStr = '//svg:use[@id="top8"] | //svg:use[@id="bottom8"]'
+ pattern8 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern8 != []:
+ pattern8[0].set("transform", "translate(0," + str(height) + ")" )
+ pattern8[1].set("transform", "translate(0," + str(height) + ")" )
+
+ xpathStr = '//svg:use[@id="top9"] | //svg:use[@id="bottom9"]'
+ pattern9 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if pattern9 != []:
+ pattern9[0].set("transform", "translate(" + str(width) + "," + str(height) + ")" )
+ pattern9[1].set("transform", "translate(" + str(width) + "," + str(height) + ")" )
+
+ xpathStr = '//svg:use[@id="clonePreview1"]'
+ clonePreview1 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview1 != []:
+ clonePreview1[0].set("transform", "translate(0," + str(height) + ")" )
+
+ xpathStr = '//svg:use[@id="clonePreview2"]'
+ clonePreview2 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview2 != []:
+ clonePreview2[0].set("transform", "translate(0," + str(height * 2) + ")" )
+
+ xpathStr = '//svg:use[@id="clonePreview3"]'
+ clonePreview3 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview3 != []:
+ clonePreview3[0].set("transform", "translate(" + str(width) + ",0)" )
+
+ xpathStr = '//svg:use[@id="clonePreview4"]'
+ clonePreview4 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview4 != []:
+ clonePreview4[0].set("transform", "translate(" + str(width) + "," + str(height) + ")" )
+
+ xpathStr = '//svg:use[@id="clonePreview5"]'
+ clonePreview5 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview5 != []:
+ clonePreview5[0].set("transform", "translate(" + str(width) + "," + str(height * 2) + ")" )
+
+ xpathStr = '//svg:use[@id="clonePreview6"]'
+ clonePreview6 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview6 != []:
+ clonePreview6[0].set("transform", "translate(" + str(width*2) + ", 0)" )
+
+ xpathStr = '//svg:use[@id="clonePreview7"]'
+ clonePreview7 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview7 != []:
+ clonePreview7[0].set("transform", "translate(" + str(width*2) + "," + str(height) + ")" )
+
+ xpathStr = '//svg:use[@id="clonePreview8"]'
+ clonePreview8 = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if clonePreview8 != []:
+ clonePreview8[0].set("transform", "translate(" + str(width*2) + "," + str(height*2) + ")" )
+
+ xpathStr = '//svg:use[@id="fullPatternClone"]'
+ patternGenerator = root.xpath(xpathStr, namespaces=inkex.NSS)
+ if patternGenerator != []:
+ patternGenerator[0].set("transform", "translate(" + str(width * 2) + ",-" + str(height) + ")" )
+ patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-cx", str(width/2))
+ patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-cy", str(height/2))
+ patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-w", str(width))
+ patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-h", str(height))
+ patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-x0", str(width))
+ patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-y0", str(height))
+ patternGenerator[0].set("width", str(width))
+ patternGenerator[0].set("height", str(height))
+
+ namedview = root.find(inkex.addNS('namedview', 'sodipodi'))
+ if namedview is None:
+ namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') );
+
+ namedview.set(inkex.addNS('document-units', 'inkscape'), 'px')
+
+ namedview.set(inkex.addNS('cx', 'inkscape'), str((width*5.5)/2.0) )
+ namedview.set(inkex.addNS('cy', 'inkscape'), "0" )
+ namedview.set(inkex.addNS('zoom', 'inkscape'), str(1.0 / (width/100.0)) )
+
+c = C()
+c.affect()
diff --git a/share/extensions/seamless_pattern.svg b/share/extensions/seamless_pattern.svg
new file mode 100644
index 000000000..7ed009394
--- /dev/null
+++ b/share/extensions/seamless_pattern.svg
@@ -0,0 +1,86 @@
+<?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:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="100px" height="100px" viewBox="0 0 100 100" id="SVGRoot" version="1.1" inkscape:version="0.91pre2 r13624" sodipodi:docname="seamless_pattern.svg" inkscape:export-xdpi="96" inkscape:export-ydpi="96">
+ <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.7071068" inkscape:cx="102.9673" inkscape:cy="-106.3048" inkscape:document-units="px" inkscape:current-layer="patternLayer" showgrid="false" units="px" inkscape:window-width="1280" inkscape:window-height="958" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" borderlayer="true" />
+ <defs id="defs4">
+ <marker inkscape:stockid="Arrow2Mend" orient="auto" refY="0.0" refX="0.0" id="Arrow2Mend" style="overflow:visible;" inkscape:isstock="true">
+ <path id="path19572" style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " transform="scale(0.6) rotate(180) translate(0,0)" />
+ </marker>
+ <marker inkscape:stockid="Arrow2Lend" orient="auto" refY="0.0" refX="0.0" id="Arrow2Lend" style="overflow:visible;" inkscape:isstock="true">
+ <path id="path19566" style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " transform="scale(1.1) rotate(180) translate(1,0)" />
+ </marker>
+ <clipPath clipPathUnits="userSpaceOnUse" id="patternClipPath">
+ <rect y="0" x="0" height="100" width="100" id="clipPathRect" style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:20;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.09889996;stroke-opacity:1;marker:none;enable-background:accumulate" />
+ </clipPath>
+ </defs>
+ <metadata id="metadata7">
+ <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>
+ <inkscape:_templateinfo id="_templateinfo10">
+ <inkscape:_name id="_name12">Seamless Pattern</inkscape:_name>
+ <inkscape:_shortdesc id="_shortdesc14">Seamless Pattern</inkscape:_shortdesc>
+ <inkscape:_keywords id="_keywords16">Seamless Pattern</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <g inkscape:groupmode="layer" id="patternLayer" inkscape:label="Pattern Layer">
+ <use style="opacity:0.24100001" sodipodi:insensitive="true" height="100%" width="100%" id="phantomBottom" xlink:href="#designBottom" y="0" x="0" />
+ <use style="opacity:0.24100001" sodipodi:insensitive="true" height="100%" width="100%" id="phantomTop" xlink:href="#designTop" y="0" x="0" />
+ <g inkscape:label="Full Pattern" clip-path="url(#patternClipPath)" id="fullPattern">
+ <g transform="scale(1.0,1.0)" inkscape:groupmode="layer" id="designBottom" inkscape:label="Design Bottom">
+ <rect y="-7.105427e-15" x="0" height="100" width="100" id="rect9111" style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ffb12a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.0989;stroke-opacity:1;marker:none;enable-background:accumulate" />
+ </g>
+ <g transform="scale(1.0,1.0)" inkscape:groupmode="layer" id="designTop" inkscape:label="Design Top">
+ <path id="text1784" d="M 3.238234,69.80676 C 3.159354,69.83297 3.094374,69.93222 3.036694,70.01073 2.660932,70.50659 2.509569,71.14994 2.275964,71.71774 1.916858,72.59433 1.496519,73.43397 1.155399,74.31888 0.8789607,74.26616 0.6222696,74.15725 0.3433261,74.12061 -2.244175,73.76628 -4.918972,74.23626 -7.312925,75.25835 -8.527103,75.75753 -9.63415,76.45362 -10.66688,77.26372 -12.75334,78.90125 -14.71033,80.75258 -16.23006,82.93048 -17.3402,84.57313 -18.32475,86.31708 -19.20132,88.09635 -19.89458,89.54883 -20.56114,91.10931 -20.71606,92.72675 -20.77582,93.54488 -20.69288,94.42704 -20.13513,95.07508 -19.48068,95.77388 -18.44182,95.96233 -17.53637,95.79024 -16.57723,95.60899 -15.86159,94.85437 -15.19381,94.19589 -13.31333,92.24569 -11.57624,90.07859 -10.52805,87.56107 -9.893955,86.045 -9.414104,84.39034 -9.622614,82.73138 -9.717263,82.12657 -9.822788,81.48673 -10.19986,80.99121 -10.44332,80.64384 -11.07786,80.68522 -11.29442,81.03796 -11.4565,81.30563 -11.52129,81.62288 -11.45154,81.93069 -11.07324,82.37787 -10.7417,82.99098 -10.71242,83.58887 -10.64261,84.76715 -11.02511,85.8442 -11.46405,86.91766 -12.21763,88.76234 -13.4137,90.42726 -14.71997,91.92279 -15.42483,92.71043 -16.17029,93.51774 -17.10023,94.04449 -17.50409,94.23627 -17.90814,94.34795 -18.35517,94.37584 -18.88829,94.29808 -19.13033,93.76945 -19.21284,93.28601 -19.34857,92.31026 -19.11882,91.36615 -18.82327,90.44575 -17.65221,87.05977 -15.65469,83.93067 -13.15757,81.37263 -11.79945,80.00732 -10.31271,78.80439 -8.677315,77.7798 -7.088768,76.82306 -5.334265,76.05826 -3.499093,75.76403 -2.117769,75.55863 -0.6818313,75.59706 0.6382789,76.10565 -0.1411339,77.75352 -0.9600896,79.3498 -1.7669,80.98437 -3.032205,83.51488 -4.262276,86.06052 -5.53533,88.58728 -6.677366,90.80843 -7.772719,93.06989 -8.822009,95.33603 -9.561548,96.97536 -10.27288,98.63291 -10.86176,100.3343 -11.31342,100.4077 -11.74775,100.4261 -12.19881,100.5037 -13.4671,100.7388 -14.81726,100.8803 -16.00473,101.4172 -17.84832,102.2804 -19.50816,103.5165 -20.89032,105.0125 -21.45263,105.6504 -22.04725,106.3526 -22.21588,107.2094 -22.32585,107.7275 -22.0502,108.2104 -21.72173,108.5849 -21.17062,109.2314 -20.25409,109.3835 -19.44738,109.2614 -18.29316,109.0913 -17.20712,108.6161 -16.2109,108.0271 -14.37604,106.8726 -12.84761,105.3125 -11.36962,103.7429 -10.77571,103.0841 -10.13793,102.4295 -9.678432,101.6655 -8.171192,101.4733 -6.61616,101.2244 -5.183592,100.7076 -3.893738,100.2593 -2.810482,99.48215 -1.78978,98.58038 0.0454981,96.95559 1.634338,95.00779 2.840713,92.87815 4.40117,90.12299 5.206009,87.01968 5.384976,83.86351 5.468634,82.22706 5.497595,80.52013 5.113899,78.91866 4.913043,78.00778 4.449005,77.23971 4.045635,76.41084 3.721181,75.87629 3.190872,75.46823 2.740653,75.03969 3.005348,74.33939 3.306751,73.58329 3.579811,72.88619 3.824769,72.23437 4.086687,71.60373 4.095858,70.89678 4.083882,70.63169 4.072056,70.39047 3.929562,70.16789 3.822473,69.92207 3.475146,69.72799 3.238234,69.80676 Z M 83.93502,29.09409 C 83.48973,29.40383 83.19721,29.92338 82.96926,30.39695 82.47058,31.58921 82.11941,32.807 81.77345,34.05256 81.76003,34.43451 81.4535,34.65896 81.16978,34.86676 79.67776,35.99334 77.97843,36.87902 76.32075,37.73199 74.83837,38.43589 73.28152,38.81272 71.70726,39.25801 69.97692,39.70952 68.19797,40.22636 66.52666,40.86841 64.006,41.82828 61.51395,43.08754 59.57633,45.00222 58.18365,46.38676 57.06058,48.10265 56.64514,50.04613 56.29211,51.68122 56.59486,53.39119 57.44213,54.82583 57.62278,55.13186 57.98678,55.35219 58.33625,55.18566 58.67851,55.06932 58.67095,54.70778 58.65622,54.41367 58.57143,53.59786 58.40533,52.75724 58.31799,51.94231 58.18525,50.43277 58.53914,48.88731 59.38851,47.63867 60.56654,45.88917 62.33683,44.62435 64.14996,43.59805 65.94927,42.55068 67.93413,41.91333 69.93526,41.37626 72.17527,40.82347 74.45739,40.17275 76.53144,39.14989 78.67526,38.07081 80.76744,36.80685 82.55012,35.18337 83.64975,34.18607 84.52399,32.99774 85.12504,31.64154 85.47305,30.82179 85.69191,29.76168 85.27196,28.92445 85.23932,28.86262 85.21325,28.89507 85.15009,28.8846 84.74478,28.8712 84.29884,28.89843 83.93502,29.09409 Z M 2.020873,76.8277 C 2.477441,77.31594 2.930471,77.84873 3.246245,78.44254 3.714701,79.36722 3.926223,80.37121 4.033126,81.39781 4.24343,83.65148 3.952563,85.87833 3.34072,88.05098 2.781297,90.09735 1.843627,92.12116 0.5755898,93.8236 -0.7359367,95.55539 -2.228323,97.10019 -4.102679,98.22875 -5.71508,99.20332 -7.572193,99.65321 -9.403897,100.002 -9.232936,99.41391 -9.001611,98.8188 -8.765237,98.25467 -7.60965,95.58417 -6.21738,93.06951 -4.875982,90.4891 -3.658174,88.26255 -2.501193,86.05293 -1.223671,83.86004 -0.0566712,81.56916 1.044488,79.20612 2.020873,76.8277 Z M 67.17132,47.35171 C 66.76308,47.8704 66.51385,48.54299 66.24877,49.14077 65.47765,51.06493 64.84574,53.04497 64.13271,54.99091 63.7556,54.91136 63.42384,54.83493 63.03727,54.83492 62.23242,54.89113 61.38296,54.9939 60.64806,55.33493 60.10544,55.56964 59.64559,56.1496 59.64253,56.7596 59.63005,57.41897 59.92278,58.02551 60.26076,58.58062 60.45345,58.88783 60.88475,58.99424 61.1946,58.81853 61.45325,58.6137 61.17132,58.20992 61.14904,57.92681 61.03188,57.51476 61.14806,56.94943 61.54772,56.70832 62.16395,56.36625 62.91437,56.30889 63.61353,56.37241 63.32011,57.20244 63.01228,58.01454 62.73549,58.85044 62.0531,60.86245 61.35157,62.87028 60.33594,64.74267 59.93025,65.43738 59.46542,66.22031 58.76543,66.65711 58.52183,66.85472 58.17762,66.684 58.11519,66.37705 57.99673,65.70711 58.22984,65.06064 58.22572,64.38981 58.2517,63.98395 57.72223,63.87362 57.4534,64.06948 56.98233,64.30223 56.94321,64.89906 56.89334,65.37032 56.85217,66.12001 56.83624,66.90919 57.02755,67.63979 57.12404,68.09649 57.55649,68.32765 57.96489,68.48609 58.30414,68.60732 58.68582,68.80454 59.01949,68.56125 60.15425,67.89242 60.88035,66.79208 61.51697,65.66884 62.32551,64.18947 62.95398,62.64533 63.55884,61.0757 64.11525,59.65075 64.54142,58.14964 64.99363,56.68888 65.40306,56.82184 65.82087,56.94653 66.25215,56.96547 67.4582,56.96762 68.65164,56.5129 69.73359,56.0137 70.23123,55.76412 70.70142,55.53013 71.14798,55.19466 71.45352,54.96511 71.5843,54.58699 71.38606,54.26114 71.27716,54.13945 71.07867,54.163 70.93973,54.18249 69.9597,54.44257 69.08751,54.94941 68.10745,55.21196 67.27461,55.49008 66.36117,55.46801 65.51309,55.30763 66.1013,53.66442 66.61772,51.9747 67.14734,50.31156 67.41753,49.40699 67.78297,48.53109 67.90238,47.59092 68.00702,47.13051 67.38792,47.10696 67.17132,47.35171 Z M 108.1807,29.20131 C 107.6051,29.41422 107.117,29.83928 106.6865,30.26381 105.4374,31.56914 104.5311,33.10356 103.6298,34.65967 102.9461,35.82215 102.3382,37.07235 101.826,38.31892 101.1339,40.02191 100.4983,41.74976 99.99003,43.51879 99.94113,43.7184 99.8376,43.92363 99.79077,44.12792 98.84396,45.1295 97.97419,46.23784 96.96986,47.18445 96.16778,47.95394 95.2272,48.53171 94.14093,48.82201 93.7798,48.9214 93.28034,48.9382 93.08536,48.54442 92.89507,48.07782 93.1183,47.62107 93.321,47.20491 93.77457,46.55611 94.25572,45.89997 94.64776,45.21063 95.34915,43.95083 96.10479,42.69472 96.53153,41.30807 96.6919,40.72151 96.84679,40.04361 96.52127,39.48362 96.35294,39.15885 95.87933,39.04051 95.54646,39.16481 95.17126,39.24054 94.98631,39.56153 94.78001,39.85839 93.83113,41.23354 93.00628,42.72385 92.33153,44.2508 91.80799,45.48856 91.29546,46.7891 91.25866,48.14908 91.25892,48.29959 91.36424,48.43752 91.38283,48.59421 90.56168,49.49216 89.77073,50.44889 88.88423,51.28418 88.08216,52.05364 87.14146,52.63147 86.05531,52.9217 85.69417,53.02109 85.19471,53.0379 84.99974,52.64412 84.94879,52.51929 84.91279,52.40599 84.9165,52.27946 84.96561,52.19686 84.9697,52.12471 84.99626,52.03586 85.01236,51.96506 84.97033,51.90239 84.99509,51.83303 85.06245,51.64392 85.15224,51.47517 85.23538,51.30459 85.68893,50.6558 86.16999,49.99973 86.56203,49.31037 87.26341,48.05059 88.01915,46.79441 88.4458,45.40781 88.60619,44.82125 88.7611,44.14335 88.43556,43.58335 88.26726,43.25857 87.87439,43.09927 87.54161,43.22355 87.16648,43.29924 86.90057,43.66127 86.69427,43.95812 85.74539,45.33329 84.92054,46.82362 84.24581,48.35056 83.72226,49.58832 83.29069,50.84779 83.25389,52.20774 83.25419,52.36295 83.27723,52.53273 83.297,52.69401 83.0902,52.9542 82.87271,53.17952 82.6525,53.4274 81.98686,54.23933 81.20789,54.96056 80.4352,55.66978 79.52323,56.50043 78.60448,57.33971 77.52903,57.9566 77.27163,58.09245 76.91885,58.33957 76.6782,58.08283 76.25816,57.41722 76.36821,56.54084 76.66566,55.85317 77.13904,54.73407 78.03775,53.81524 78.83855,52.92177 79.32515,52.33865 79.90413,51.86597 80.16647,51.13048 80.32163,50.75971 80.10539,50.32941 79.83608,50.07794 79.47169,49.7169 78.92066,49.85837 78.53921,50.12615 77.66843,50.74573 77.41277,51.89377 76.64753,52.61 76.40319,52.86414 75.95673,52.99575 75.67492,52.6963 75.37755,52.33182 75.16913,51.94824 74.89823,51.56539 74.51969,51.20773 73.98174,51.35038 73.60103,51.61321 73.1709,52.05722 72.99002,52.66849 72.79932,53.23963 72.48935,54.3367 72.20082,55.43787 72.04773,56.5685 71.97118,56.93358 72.09557,57.35756 72.3779,57.62036 72.62656,57.93388 73.12708,57.94125 73.43244,57.6957 73.6689,57.24551 73.76392,56.71794 73.91095,56.2337 74.0845,55.68385 74.17426,55.16767 74.42897,54.64945 74.7323,54.50346 75.15424,54.54143 75.48245,54.52192 75.87782,54.40855 75.66113,54.73847 75.60663,54.96706 75.32524,56.09386 74.88329,57.24876 74.81504,58.41775 74.75943,58.87593 75.09956,59.22886 75.50969,59.38682 76.11907,59.623 76.78559,59.68697 77.41612,59.53819 77.92907,59.34857 78.36284,58.99993 78.83054,58.71954 79.63819,58.22735 80.39933,57.56482 81.05024,56.88279 82.0294,55.90731 82.89918,54.87604 83.74919,53.7863 83.79708,53.83207 83.85519,53.86798 83.91199,53.90692 84.56024,54.31356 85.34202,54.30545 86.06217,54.13811 87.68586,53.73158 89.06277,52.68196 90.22349,51.52008 90.77095,50.9555 91.25183,50.33316 91.75405,49.72755 91.8028,49.77445 91.85878,49.80847 91.91696,49.84812 92.56512,50.2548 93.42776,50.2057 94.14792,50.03836 95.7715,49.63188 97.1485,48.58223 98.30923,47.42032 98.88444,46.82738 99.35569,46.14519 99.87965,45.50606 100.2102,46.0145 100.8115,46.40912 101.4249,46.34868 102.0458,46.29071 102.5312,45.84899 103.0422,45.52867 104.4532,44.53726 105.8571,43.44083 107.0371,42.18166 107.7948,41.3501 108.4375,40.42696 109.1713,39.57486 109.3343,39.38375 109.4234,39.17138 109.5732,38.96445 109.6298,39.00581 109.668,39.05564 109.7362,39.08527 110.3833,39.33254 111.1654,39.19044 111.762,38.87122 112.7627,38.29745 113.5898,37.49081 114.4259,36.70743 113.5389,39.03778 112.76,41.43194 111.9113,43.7761 111.8218,44.12393 111.5388,44.37274 111.3487,44.67136 110.2106,46.46564 109.0686,48.22045 107.9734,50.04217 106.8397,51.90262 105.8366,53.88061 104.9246,55.85656 104.0607,57.71558 103.3275,59.58472 102.7267,61.54526 102.3213,62.9044 101.9258,64.29807 101.8988,65.72592 101.9082,66.28827 101.9549,67.01408 102.435,67.38496 102.6994,67.55442 103.0027,67.77498 103.329,67.74484 103.6894,67.63286 104.0316,67.30766 104.2981,67.0503 105.2059,66.09114 105.7449,64.91276 106.2661,63.71469 106.7176,62.57886 107.1153,61.36553 107.5437,60.2207 108.7589,56.85497 110.0874,53.55282 111.2986,50.18564 112.2607,47.45298 113.1646,44.73879 114.05,41.98017 114.4573,41.4121 114.8815,40.79205 115.2972,40.2297 116.7119,38.28751 118.247,36.47027 119.7659,34.60961 120.5495,33.60475 121.4526,32.74335 122.3045,31.79781 122.4973,31.5321 122.8521,31.2488 122.8669,30.90254 122.8076,30.77858 122.6843,30.67173 122.5413,30.66145 122.1229,30.66273 121.8197,31.01338 121.5311,31.27519 119.7984,33.1008 117.9911,34.87942 116.2503,36.69709 116.1429,36.76571 115.8706,37.25761 115.968,36.94214 116.3247,35.65301 116.858,34.45592 117.3254,33.2042 117.5349,32.59512 117.726,31.9812 117.8013,31.33671 117.7517,31.03119 117.385,30.56977 117.0691,30.89476 116.4911,31.45351 116.1462,32.1441 115.7014,32.80829 115.0161,33.82808 114.356,34.87215 113.5695,35.82018 112.9283,36.57983 112.2103,37.32264 111.269,37.69813 110.9469,37.86201 110.4313,37.7062 110.4558,37.2973 110.4623,36.43839 110.6247,35.55864 110.8875,34.74062 111.1772,33.93152 111.6891,33.25908 112.0915,32.50409 112.2167,32.25076 112.4588,31.739 112.0457,31.61215 111.6951,31.60617 111.4368,31.92036 111.1974,32.14409 110.4807,32.91727 109.9029,33.85448 109.5097,34.82958 109.1703,35.73977 108.9541,36.65175 108.9981,37.62978 109.006,37.73603 109.0623,37.88322 109.0811,37.99423 108.6711,38.44428 108.2269,38.87602 107.8321,39.33916 107.2677,40.04676 106.6692,40.74804 106.019,41.37659 105.0479,42.32063 104.092,43.23131 102.9932,44.02892 102.6802,44.24286 102.266,44.52383 101.9,44.27827 101.46,43.91717 101.4888,43.32598 101.5673,42.82032 101.8072,41.5322 102.3693,40.26023 102.9247,39.08274 103.3761,38.34328 103.8801,37.63979 104.3724,36.92591 105.163,35.76854 106.1017,34.70217 106.9482,33.58697 107.4824,32.87444 108.0443,32.22551 108.5177,31.46984 108.8641,30.88824 109.1583,30.13553 108.8307,29.48139 108.7272,29.23142 108.4385,29.10665 108.1807,29.20131 Z M 7.621498,85.06715 C 7.191486,85.51111 7.01049,86.12243 6.819882,86.69351 6.509921,87.7906 6.221384,88.89176 6.068304,90.0224 5.991648,90.38753 6.115918,90.81156 6.398357,91.0743 6.647024,91.38782 7.147559,91.39518 7.452929,91.14964 7.689458,90.69939 7.784385,90.17187 7.931401,89.68762 8.104978,89.13778 8.275587,88.58059 8.530422,88.06235 8.833741,87.91636 9.174831,87.99533 9.502913,87.97584 9.898283,87.86246 9.681602,88.19241 9.627078,88.421 9.345822,89.54773 8.903765,90.70269 8.835607,91.87164 8.779901,92.32987 9.120133,92.68275 9.530157,92.84077 10.13957,93.07694 10.88704,93.09985 11.51745,92.95115 12.03041,92.76152 12.46419,92.41289 12.9319,92.13246 13.73951,91.6403 14.4198,91.01876 15.07072,90.33672 16.06905,89.34216 16.98686,88.31255 17.85051,87.19924 18.08362,87.54004 18.41915,87.81977 18.82772,87.92341 19.61025,88.16136 20.35528,87.83366 21.01415,87.42444 22.79301,86.34261 24.107,84.62492 25.08323,82.82045 25.33282,82.99638 25.60693,83.16703 25.85647,83.3431 26.24752,83.68648 26.79704,83.73919 27.27672,83.53796 28.85002,82.7973 30.21395,81.65469 31.35369,80.35266 31.65694,79.99013 31.94261,79.66163 32.23967,79.29339 32.24359,79.33158 32.19557,79.37687 32.19994,79.41547 32.22491,79.8844 32.45485,80.32583 32.81486,80.62826 33.22857,80.99148 33.7902,80.87219 34.2338,80.62036 35.16756,80.04423 36.06288,79.39762 36.93974,78.73999 38.59524,77.53051 39.93363,75.97451 41.25361,74.41808 41.3553,74.93754 41.51512,75.42092 41.708,75.91571 41.85499,76.37531 42.41611,76.46802 42.80471,76.27461 43.31249,75.99686 43.58025,75.4792 43.89232,75.01161 44.52866,73.95116 45.09268,72.83575 45.69846,71.7578 46.34609,70.50457 47.26975,69.37191 48.0708,68.21741 48.21919,67.94992 48.42901,67.68795 48.34962,67.36424 L 48.30867,67.28348 C 48.15001,66.91899 47.70875,66.89705 47.41587,67.12615 46.73318,67.59891 46.3009,68.30735 45.80433,68.95974 45.0634,70.00719 44.36857,71.09637 43.67347,72.17452 43.51578,72.41747 43.08394,72.07932 42.82175,72.09824 42.34832,72.03361 41.77416,71.91514 41.3628,72.22799 40.52614,72.93284 39.87904,73.82155 39.10574,74.59241 38.34527,75.41085 37.40279,76.06213 36.5638,76.79597 35.84055,77.40095 35.18856,78.03779 34.4251,78.59192 34.16987,78.78332 33.70068,78.74955 33.69388,78.35265 33.69094,77.81821 33.81705,77.33298 33.9286,76.81082 34.05276,76.60215 34.24547,76.3998 34.20883,76.16063 34.18318,76.10825 34.123,76.14956 34.08692,76.12067 34.06295,76.10161 34.0733,76.04997 34.04592,76.03979 34.25978,75.15131 34.66736,74.36649 35.0047,73.52057 35.0763,73.25159 35.29973,72.92187 35.08119,72.66898 34.80952,72.31317 34.34752,72.39951 34.02662,72.59366 33.64605,72.90674 33.41142,73.37433 33.22259,73.81453 32.88843,74.69576 32.67567,75.67974 32.38668,76.57615 32.24487,76.96509 32.183,77.30477 32.14977,77.71275 31.83529,78.10564 31.53617,78.49988 31.22396,78.8937 30.43712,79.97365 29.46699,80.89007 28.31991,81.58595 27.97609,81.7374 27.62962,82.169 27.22776,82.03807 26.95724,81.8786 26.78025,81.58058 26.73689,81.27044 26.72387,80.55901 27.10794,79.95548 27.37446,79.32056 27.4986,78.9801 27.76352,78.59582 27.73332,78.22402 27.58049,77.93847 27.30168,77.56393 26.91897,77.62031 26.47516,77.78763 26.19125,78.11213 25.95104,78.51768 25.7498,78.52613 25.39534,78.31876 25.13911,78.31973 24.35011,78.19437 23.58028,78.55471 22.91262,78.94013 20.95586,80.00235 19.12946,81.43443 18.07271,83.42749 17.66419,84.20022 17.37425,85.1045 17.43837,85.98516 17.19605,86.28738 16.9297,86.5927 16.67296,86.88133 16.00745,87.69323 15.30933,88.37345 14.53654,89.08271 13.62466,89.9133 12.70582,90.75265 11.63025,91.36961 11.37287,91.50545 11.02028,91.75247 10.77952,91.49576 10.3595,90.83016 10.46954,89.95377 10.76701,89.26609 11.24037,88.14699 12.05823,87.26918 12.85903,86.37571 13.34562,85.79257 14.00546,85.27889 14.2679,84.54336 14.42296,84.17265 14.12596,83.78329 13.85655,83.53187 13.49215,83.17085 12.94113,83.31232 12.55968,83.58006 11.68879,84.19972 11.43325,85.34773 10.66799,86.06394 10.42366,86.31809 9.9772,86.44969 9.695387,86.15023 9.398015,85.78575 9.270476,85.36115 8.99955,84.97832 8.621024,84.62067 8.002191,84.80431 7.621498,85.06715 Z M 23.36705,80.43787 C 23.62733,80.32281 24.01545,79.97978 24.21781,80.31171 24.27964,80.54748 24.32513,80.83897 24.30321,81.08134 24.18312,82.14142 23.57087,82.9761 22.93996,83.80526 22.23032,84.68345 21.48165,85.63928 20.52119,86.25171 20.24243,86.39668 19.95641,86.6106 19.63053,86.49987 19.28211,86.3057 19.18407,85.85417 19.21957,85.48887 19.33567,84.63474 19.79717,83.88548 20.30135,83.2122 21.15646,82.14275 22.16235,81.11721 23.36705,80.43787 Z M 125.4644,31.41515 C 124.9698,31.88179 124.8377,32.69702 125.2723,33.24079 125.6001,33.69737 126.2535,33.76626 126.7333,33.51647 127.3753,33.24344 127.5958,32.38709 127.2915,31.81041 127.214,31.65828 127.0829,31.48953 126.9647,31.36647 126.5853,30.93303 125.8809,31.07098 125.4644,31.41515 Z M -16.19586,103.4457 C -15.56289,103.1531 -14.88434,102.9329 -14.21329,102.7452 -13.40833,102.5351 -12.5489,102.413 -11.74327,102.2043 -12.19497,102.805 -12.82616,103.3047 -13.35588,103.835 -14.52763,104.9462 -15.68827,106.1065 -17.02736,107.0182 -17.6931,107.4338 -18.41637,107.7873 -19.17074,108.0031 -19.65434,108.1229 -20.24883,108.1305 -20.63171,107.7276 -20.95268,107.436 -20.58362,107.0466 -20.39383,106.7936 -19.66361,105.9247 -18.87594,105.2369 -17.97386,104.55 -17.41847,104.1231 -16.82921,103.7379 -16.19586,103.4457 Z M 110.2784,48.97495 C 110.2536,49.23137 110.1853,49.41662 110.1199,49.66528 109.75,50.9731 109.287,52.27989 108.8444,53.56442 107.6875,56.76135 106.5114,59.94915 105.371,63.15203 104.9852,64.13133 104.5649,65.12487 103.9679,65.99807 103.7836,66.21076 103.5143,66.71798 103.2006,66.48908 102.9263,66.2283 103.0385,65.76365 103.0728,65.4353 103.3839,63.58439 103.9103,61.81316 104.5022,60.03538 105.3395,57.4679 106.6145,55.08123 107.9073,52.71814 108.6328,51.42905 109.3355,50.12164 110.2784,48.97495 Z" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:100%;font-family:Pushkin;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" inkscape:connector-curvature="0" />
+ <path id="path1790" d="M 84.87396,19.36488 79.88036,19.36488 79.88036,19.68443 80.02993,19.68443 C 80.70294,19.68443 80.77766,19.71861 80.77766,20.00411 L 80.77766,20.20111 80.77766,23.437 80.77766,23.63426 C 80.77766,23.91963 80.70294,23.95368 80.02993,23.95368 L 79.88036,23.95368 79.88036,24.27323 84.98192,24.27323 85.14811,22.45808 84.78249,22.45808 C 84.67467,22.93382 84.48334,23.35539 84.28405,23.55265 84.02638,23.82451 83.5528,23.95368 82.85493,23.95368 L 82.30649,23.95368 C 82.05721,23.95368 81.84953,23.91301 81.77468,23.85167 81.71671,23.81113 81.70834,23.77019 81.70834,23.62751 L 81.70834,21.89397 81.87453,21.89397 C 82.38121,21.89397 82.58902,21.93464 82.75535,22.07733 82.97113,22.25433 83.05436,22.47186 83.07098,22.87275 L 83.46146,22.87275 83.46146,20.64307 83.07098,20.64307 C 83.02936,21.30933 82.69698,21.57443 81.90763,21.57443 L 81.70834,21.57443 81.70834,20.02438 C 81.70834,19.73212 81.78319,19.68443 82.23177,19.68443 L 82.66374,19.68443 C 83.39499,19.68443 83.75223,19.74577 84.03489,19.93615 84.30904,20.11288 84.50834,20.4935 84.63305,21.1053 L 84.99043,21.1053 84.87396,19.36488 Z M 73.84798,22.09097 74.7869,22.09097 C 75.53477,22.09097 75.92525,22.04341 76.25777,21.91438 76.84755,21.68306 77.17993,21.24799 77.17993,20.71104 77.17993,20.19462 76.88903,19.80009 76.34073,19.57579 76.01672,19.44 75.50153,19.36488 74.92823,19.36488 L 72.02014,19.36488 72.02014,19.68443 72.16971,19.68443 C 72.84272,19.68443 72.91744,19.71861 72.91744,20.00411 L 72.91744,20.20111 72.91744,23.437 72.91744,23.63426 C 72.91744,23.91963 72.84272,23.95368 72.16971,23.95368 L 72.02014,23.95368 72.02014,24.27323 74.8119,24.27323 74.8119,23.95368 74.59571,23.95368 C 73.9227,23.95368 73.84798,23.91963 73.84798,23.63426 L 73.84798,23.437 73.84798,22.09097 Z M 73.84798,21.77156 73.84798,20.03127 C 73.84798,19.71861 73.89798,19.68443 74.35494,19.68443 L 74.88675,19.68443 C 75.75082,19.68443 76.15792,20.01762 76.15792,20.73819 76.15792,21.4385 75.7342,21.77156 74.85351,21.77156 L 73.84798,21.77156 Z M 66.61929,19.26989 66.27043,19.26989 64.35921,23.23297 C 64.19316,23.58657 64.15992,23.63426 64.03534,23.7429 63.90225,23.87207 63.66958,23.95368 63.44516,23.95368 L 63.41205,23.95368 63.41205,24.27323 65.6139,24.27323 65.6139,23.95368 65.44757,23.95368 C 64.99912,23.95368 64.77469,23.82451 64.77469,23.5663 64.77469,23.48456 64.79969,23.38957 64.84941,23.2808 L 65.1237,22.68251 67.32554,22.68251 67.77426,23.59346 C 67.82412,23.69547 67.84074,23.7429 67.84074,23.77708 67.84074,23.88571 67.6328,23.95368 67.32554,23.95368 L 66.97654,23.95368 66.97654,24.27323 69.55238,24.27323 69.55238,23.95368 69.43605,23.95368 C 69.02043,23.95368 68.9291,23.89936 68.73804,23.51874 L 66.61929,19.26989 Z M 66.21219,20.38473 67.15097,22.3154 65.28976,22.3154 66.21219,20.38473 Z M 60.47896,19.31745 60.1632,19.31745 59.83095,19.71861 C 59.24076,19.36488 58.91702,19.263 58.36021,19.263 57.55425,19.263 56.88948,19.52823 56.32456,20.07869 55.79274,20.59538 55.54346,21.16638 55.54346,21.86668 55.54346,23.32836 56.71491,24.37524 58.35197,24.37524 59.68137,24.37524 60.52882,23.73614 60.72001,22.59401 L 60.32952,22.53969 C 60.24643,22.90005 60.14658,23.1446 59.997,23.34863 59.65651,23.81775 59.1247,24.05582 58.45155,24.05582 57.22186,24.05582 56.64033,23.35539 56.64033,21.89397 56.64033,21.12557 56.76477,20.60902 57.04729,20.20111 57.30496,19.82049 57.82002,19.58242 58.35197,19.58242 58.93351,19.58242 59.4487,19.834 59.76447,20.26921 59.92229,20.4935 60.047,20.7586 60.23819,21.28204 L 60.6034,21.28204 60.47896,19.31745 Z M 52.16178,19.32421 51.85439,19.32421 51.52201,19.73212 C 51.13139,19.42622 50.59971,19.263 50.00979,19.263 48.9213,19.263 48.19019,19.834 48.19019,20.68401 48.19019,21.42485 48.63864,21.79196 49.86009,22.0503 L 50.64943,22.21352 C 51.26434,22.34256 51.32244,22.3562 51.49701,22.46511 51.7463,22.6213 51.87925,22.84559 51.87925,23.11083 51.87925,23.38268 51.75454,23.60697 51.50539,23.79073 51.2311,23.98773 50.95709,24.06258 50.49999,24.06258 49.88508,24.06258 49.44474,23.90612 49.05426,23.55265 48.70525,23.23297 48.53082,22.91356 48.40624,22.39012 L 48.04886,22.39012 48.0821,24.32768 48.40624,24.32768 48.77997,23.86531 C 49.33665,24.23918 49.80226,24.37524 50.52486,24.37524 51.7463,24.37524 52.5274,23.79073 52.5274,22.87951 52.5274,22.45808 52.35284,22.09786 52.02896,21.83952 51.80454,21.66279 51.48053,21.54713 50.81562,21.41121 L 49.92656,21.22772 C 49.18721,21.07139 48.83821,20.80616 48.83821,20.39149 48.83821,19.91575 49.31179,19.58917 50.01804,19.58917 50.59971,19.58917 51.07315,19.79333 51.40554,20.18071 51.64659,20.45945 51.79602,20.74495 51.90425,21.09166 L 52.2615,21.09166 52.16178,19.32421 Z M 40.92813,22.0503 40.92813,20.20111 40.92813,20.00411 C 40.92813,19.71861 41.00271,19.68443 41.67586,19.68443 L 41.83381,19.68443 41.83381,19.36488 39.10015,19.36488 39.10015,19.68443 39.24972,19.68443 C 39.92273,19.68443 39.99732,19.71861 39.99732,20.00411 L 39.99732,20.20111 39.99732,23.437 39.99732,23.63426 C 39.99732,23.91963 39.92273,23.95368 39.24972,23.95368 L 39.10015,23.95368 39.10015,24.27323 41.83381,24.27323 41.83381,23.95368 41.67586,23.95368 C 41.00271,23.95368 40.92813,23.91963 40.92813,23.63426 L 40.92813,23.437 40.92813,22.57374 41.89191,21.77832 43.33765,23.51185 C 43.47074,23.67493 43.50384,23.72939 43.50384,23.79748 43.50384,23.90612 43.34616,23.95368 42.93892,23.95368 L 42.68126,23.95368 42.68126,24.27323 45.52287,24.27323 45.52287,23.95368 45.36506,23.95368 C 44.9081,23.95368 44.79163,23.90612 44.55072,23.61386 L 42.54006,21.24123 43.77812,20.2284 C 44.17685,19.8817 44.68367,19.68443 45.18225,19.68443 L 45.18225,19.36488 42.62302,19.36488 42.62302,19.68443 42.83096,19.68443 C 43.21321,19.68443 43.37089,19.74577 43.37089,19.88845 43.37089,19.98357 43.20469,20.18071 42.96378,20.37784 L 40.92813,22.0503 Z M 31.63866,19.36488 29.92701,19.36488 29.92701,19.68443 30.13482,19.68443 C 30.55854,19.68443 30.74973,19.73888 30.89917,19.90899 L 30.89917,22.79803 C 30.89917,23.72939 30.73298,23.92652 29.93539,23.95368 L 29.93539,24.27323 32.30356,24.27323 32.30356,23.95368 C 31.51394,23.92652 31.34789,23.72939 31.34789,22.79803 L 31.34789,20.27596 35.05384,24.36848 35.40271,24.36848 35.40271,20.84021 C 35.40271,19.90899 35.56877,19.71172 36.36649,19.68443 L 36.36649,19.36488 33.99845,19.36488 33.99845,19.68443 C 34.7878,19.71172 34.95399,19.90899 34.95399,20.84021 L 34.95399,22.97476 31.63866,19.36488 Z M 26.23795,20.20111 26.23795,20.00411 C 26.23795,19.71861 26.31267,19.68443 26.9773,19.68443 L 27.14349,19.68443 27.14349,19.36488 24.39335,19.36488 24.39335,19.68443 24.55954,19.68443 C 25.23255,19.68443 25.30727,19.71861 25.30727,20.00411 L 25.30727,20.20111 25.30727,23.437 25.30727,23.63426 C 25.30727,23.91963 25.23255,23.95368 24.55954,23.95368 L 24.39335,23.95368 24.39335,24.27323 27.14349,24.27323 27.14349,23.95368 26.9773,23.95368 C 26.31267,23.95368 26.23795,23.91963 26.23795,23.63426 L 26.23795,23.437 26.23795,20.20111 Z" style="fill:#000000;fill-opacity:1;stroke-width:1pt" inkscape:connector-curvature="0" />
+ <rect inkscape:export-ydpi="475.20001" inkscape:export-xdpi="475.20001" inkscape:export-filename="/home/d/ink/draw-freely.png" ry="0.0000000" rx="1.468345" y="34.87875" x="-34.9314" height="25.7114" width="28.82679" id="rect2417" style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:none;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1" />
+ <g transform="matrix(0.1106013,0,0,0.1106013,31.33167,72.44851)" id="inkscape-logo">
+ <path id="path2313" d="M 163.15,27.83 28.81,165.3 C -16.58,221.51 59.7,214.97 92.4,231.16 104.13,243.15 47.44,252 59.17,264 70.9,275.99 130.1,287.1 141.85,299.09 153.58,311.08 117.84,323.8 129.57,335.79 141.3,347.78 168.43,336.42 173.51,364.1 177.13,383.88 222.4,372.6 244.54,356.4 256.27,344.4 222.1,345.53 233.83,333.54 263,303.71 290.16,322.7 300.14,292.81 305.07,278.04 257.2,270.04 268.95,258.05 302.7,238.34 419.35,225.51 364,170.16 L 224.75,27.83 C 207.72,11.48 179.3,11.3 163.15,27.83 Z M 317.46,292.81 C 317.46,299.63 367.71,304.1 367.71,291.2 360.55,270.48 323.4,271.88 317.46,292.81 Z M 91.1,329.05 C 103,339.34 121.38,326.49 126.89,312.13 115.36,296.81 72.2,312.68 91.1,329.05 Z M 311.16,306.82 C 295.82,320.58 312.88,334.54 328,325.65 331.37,322.23 327.91,310.24 311.16,306.82 Z" inkscape:connector-curvature="0" />
+ <path style="fill:#ffffff" id="path2315" d="M 131,238.6 C 134.59,240.83 188.89,251.86 202.16,254.06 206.76,255.03 203.5,259.77 197.16,262.97 182.86,266.77 113.5,238.6 131,238.6 Z" inkscape:connector-curvature="0" />
+ <path style="fill:#ffffff" id="path2317" d="M 216.63,37.47 269.78,91.45 C 274.82,96.6 274.75,106.58 271.93,109.45 L 245.54,88.34 240.35,119.6 218.3,107.96 182.99,130.27 171.3,83.24 152.33,116.06 123.33,116.06 C 111.51,116.06 110.12,101.06 120.86,90.32 139.62,70.07 161.15,49.43 172.85,37.47 184.61,25.45 205.1,25.79 216.63,37.47 Z" inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <g sodipodi:insensitive="true" id="designBottomGenerator">
+ <use height="100%" width="100%" id="bottom1" transform="translate(-100,-100)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom2" transform="translate(0,-100)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom3" transform="translate(100,-100)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom4" transform="translate(-100,0)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom5" transform="translate(0,0)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom6" transform="translate(100,0)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom7" transform="translate(-100,100)" xlink:href="#designBottom" y="0" x="0" />
+ <use height="100%" width="100%" id="bottom8" transform="translate(0,100)" xlink:href="#designBottom" y="0" x="0" />
+ <use transform="translate(100,100)" height="100%" width="100%" id="bottom9" xlink:href="#designBottom" y="0" x="0" />
+ </g>
+ <g sodipodi:insensitive="true" id="designTopGenerator">
+ <use height="100%" width="100%" id="top1" transform="translate(-100,-100)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top2" transform="translate(0,-100)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top3" transform="translate(100,-100)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top4" transform="translate(-100,0)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top5" transform="translate(0,0)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top6" transform="translate(100,0)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top7" transform="translate(-100,100)" xlink:href="#designTop" y="0" x="0" />
+ <use height="100%" width="100%" id="top8" transform="translate(0,100)" xlink:href="#designTop" y="0" x="0" />
+ <use transform="translate(100,100)" height="100%" width="100%" id="top9" xlink:href="#designTop" y="0" x="0" />
+ </g>
+ </g>
+ <g id="preview">
+ <use x="0" y="0" xlink:href="#fullPattern" id="fullPatternClone" transform="translate(200,-100)" width="100" height="100" inkscape:tile-cx="50" inkscape:tile-cy="50" inkscape:tile-w="100" inkscape:tile-h="100" inkscape:tile-x0="100" inkscape:tile-y0="100" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" id="mainClonePreview" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(0,100)" id="clonePreview1" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(0,200)" id="clonePreview2" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(100,0)" id="clonePreview3" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(100,100)" id="clonePreview4" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(100,200)" id="clonePreview5" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(200, 0)" id="clonePreview6" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(200,100)" id="clonePreview7" />
+ <use height="100%" width="100%" x="0" y="0" inkscape:tiled-clone-of="#fullPatternClone" xlink:href="#fullPatternClone" transform="translate(200,200)" id="clonePreview8" />
+ </g>
+ <text sodipodi:linespacing="125%" id="text8664" y="-188.93137" x="-191.40367" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.6686153px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:Verdana;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" xml:space="preserve"><tspan y="-188.93137" x="-191.40367" id="tspan8666" sodipodi:role="line" style="-inkscape-font-specification:'sans-serif Bold';font-family:sans-serif;font-weight:bold;font-style:normal;font-stretch:normal;font-variant:normal">Seamless pattern</tspan></text>
+ <flowRoot transform="translate(-711.513,-78.2254)" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="infoText" xml:space="preserve"><flowRegion id="flowRegion11597"><rect style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:sans-serif;-inkscape-font-specification:sans-serif" y="-99.85437" x="519.1747" height="326.1553" width="228.5243" id="rect11599" /></flowRegion><flowPara style="font-size:14.666667px" id="flowPara11613">You can use &quot;design top&quot; layer and &quot;design bottom&quot; layer inside this seamless pattern to design.</flowPara><flowPara style="font-size:14.666667px" id="flowPara12265" /><flowPara style="font-size:14.666667px" id="flowPara11609">Go to Patern -root- layer to use the seamless patern.</flowPara></flowRoot> <path style="color:#000000;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.7795277;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-end:url(#Arrow2Mend);paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="M -204,-194 C -204,-194 -260.3514,-151.8886 -234.2721,-53.49747 -201.2516,71.08073 -72.34315,47.12994 -72.34315,47.12994" id="path19539" inkscape:connector-curvature="0" sodipodi:nodetypes="csc" />
+ </g>
+</svg>
diff --git a/share/extensions/seamless_pattern_procedural.inx b/share/extensions/seamless_pattern_procedural.inx
new file mode 100644
index 000000000..f9800c63d
--- /dev/null
+++ b/share/extensions/seamless_pattern_procedural.inx
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
+ <_name>Seamless Pattern Procedural</_name>
+ <id>org.inkscape.render.seamless_pattern_procedural</id>
+ <dependency type="executable" location="extensions">seamless_pattern.py</dependency>
+ <dependency type="executable" location="extensions">inkex.py</dependency>
+
+ <param name="width" _gui-text="Custom Width (px.):" type="int" min="1" max="99999999">100</param>
+ <param name="height" _gui-text="Custom Height (px.):" type="int" min="1" max="99999999">100</param>
+
+ <effect needs-live-preview="false">
+ <object-type>all</object-type>
+ <effects-menu hidden="true" />
+ </effect>
+ <inkscape:_templateinfo>
+ <inkscape:_name>Seamless Pattern...</inkscape:_name>
+ <inkscape:author>Jabiertxof</inkscape:author>
+ <inkscape:_shortdesc>Create seamless patterns.</inkscape:_shortdesc>
+ <inkscape:date>2014-10-16</inkscape:date>
+ <inkscape:_keywords>live seamless patterns</inkscape:_keywords>
+ </inkscape:_templateinfo>
+ <script>
+ <command reldir="extensions" interpreter="python">seamless_pattern.py</command>
+ </script>
+</inkscape-extension>
diff --git a/share/extensions/setup_typography_canvas.inx b/share/extensions/setup_typography_canvas.inx
index 332a14ade..8e7739b5c 100644
--- a/share/extensions/setup_typography_canvas.inx
+++ b/share/extensions/setup_typography_canvas.inx
@@ -4,11 +4,11 @@
<id>org.inkscape.typography.setuptypographycanvas</id>
<dependency type="executable" location="extensions">inkex.py</dependency>
<dependency type="executable" location="extensions">setup_typography_canvas.py</dependency>
- <param name="emsize" type="int" _gui-text="Em-size:" min="10" max="2000">1000</param>
- <param name="ascender" type="int" _gui-text="Ascender:" min="0" max="2000">750</param>
- <param name="caps" type="int" _gui-text="Caps Height:" min="0" max="2000">700</param>
- <param name="xheight" type="int" _gui-text="X-Height:" min="0" max="2000">500</param>
- <param name="descender" type="int" _gui-text="Descender:" min="0" max="1000">250</param>
+ <param name="emsize" type="int" _gui-text="Em-size:" min="10" max="2048">1000</param>
+ <param name="ascender" type="int" _gui-text="Ascender:" min="0" max="2048">750</param>
+ <param name="caps" type="int" _gui-text="Caps Height:" min="0" max="2048">700</param>
+ <param name="xheight" type="int" _gui-text="X-Height:" min="0" max="2048">500</param>
+ <param name="descender" type="int" _gui-text="Descender:" min="0" max="1024">250</param>
<effect>
<object-type>all</object-type>
<effects-menu>
diff --git a/share/extensions/setup_typography_canvas.py b/share/extensions/setup_typography_canvas.py
index 197aeb77e..a1000f2d1 100755
--- a/share/extensions/setup_typography_canvas.py
+++ b/share/extensions/setup_typography_canvas.py
@@ -69,6 +69,7 @@ class SetupTypographyCanvas(inkex.Effect):
self.svg = self.document.getroot()
self.svg.set("width", str(emsize))
self.svg.set("height", str(emsize))
+ self.svg.set("viewBox", "0 0 " + str(emsize) + " " + str(emsize) )
baseline = descender
# Create guidelines
@@ -78,6 +79,12 @@ class SetupTypographyCanvas(inkex.Effect):
self.create_horizontal_guideline("xheight", baseline+xheight)
self.create_horizontal_guideline("descender", baseline-descender)
+ namedview = self.svg.find(inkex.addNS('namedview', 'sodipodi'))
+ namedview.set(inkex.addNS('document-units', 'inkscape'), 'px')
+ namedview.set(inkex.addNS('cx', 'inkscape'), str(emsize/2.0 ))
+ namedview.set(inkex.addNS('cy', 'inkscape'), str(emsize/2.0 ))
+
+
if __name__ == '__main__':
e = SetupTypographyCanvas()
e.affect()
diff --git a/share/extensions/simplestyle.py b/share/extensions/simplestyle.py
index 99b5938dd..806b81813 100644
--- a/share/extensions/simplestyle.py
+++ b/share/extensions/simplestyle.py
@@ -141,6 +141,7 @@ svgcolors={
'plum':'#dda0dd',
'powderblue':'#b0e0e6',
'purple':'#800080',
+ 'rebeccapurple':'#663399',
'red':'#ff0000',
'rosybrown':'#bc8f8f',
'royalblue':'#4169e1',
diff --git a/share/extensions/svg2fxg.xsl b/share/extensions/svg2fxg.xsl
index db9f61f22..3853b4d7b 100755
--- a/share/extensions/svg2fxg.xsl
+++ b/share/extensions/svg2fxg.xsl
@@ -832,22 +832,22 @@ extension-element-prefixes="math">
<xsl:value-of select="round(translate($convert_value, 'px', ''))" />
</xsl:when>
<xsl:when test="contains($convert_value, 'pt')">
- <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.25)" />
+ <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.333333)" />
</xsl:when>
<xsl:when test="contains($convert_value, 'pc')">
- <xsl:value-of select="round(translate($convert_value, 'pc', '') * 15)" />
+ <xsl:value-of select="round(translate($convert_value, 'pc', '') * 16)" />
</xsl:when>
<xsl:when test="contains($convert_value, 'mm')">
- <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.543307)" />
+ <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.779527)" />
</xsl:when>
<xsl:when test="contains($convert_value, 'cm')">
- <xsl:value-of select="round(translate($convert_value, 'cm', '') * 35.43307)" />
+ <xsl:value-of select="round(translate($convert_value, 'cm', '') * 37.79527)" />
</xsl:when>
<xsl:when test="contains($convert_value, 'in')">
- <xsl:value-of select="round(translate($convert_value, 'in', '') * 90)" />
+ <xsl:value-of select="round(translate($convert_value, 'in', '') * 96)" />
</xsl:when>
<xsl:when test="contains($convert_value, 'ft')">
- <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1080)" />
+ <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1152)" />
</xsl:when>
<xsl:when test="not(string(number($convert_value))='NaN')">
<xsl:value-of select="round($convert_value)" />
diff --git a/share/extensions/svg2xaml.inx b/share/extensions/svg2xaml.inx
index da621b8f7..74b8f731a 100644
--- a/share/extensions/svg2xaml.inx
+++ b/share/extensions/svg2xaml.inx
@@ -2,6 +2,7 @@
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>XAML Output</_name>
<id>org.inkscape.output.xaml</id>
+ <param name="silverlight" type="boolean" _gui-text="Silverlight compatible XAML">false</param>
<output>
<extension>.xaml</extension>
<mimetype>text/xml+xaml</mimetype>
diff --git a/share/extensions/svg2xaml.xsl b/share/extensions/svg2xaml.xsl
index 7536c9e0e..fa785fa4f 100755
--- a/share/extensions/svg2xaml.xsl
+++ b/share/extensions/svg2xaml.xsl
@@ -3,7 +3,7 @@
<!--
Copyright (c) 2005-2007 authors:
Original version: Toine de Greef (a.degreef@chello.nl)
-Modified (2010-2011) by Nicolas Dufour (nicoduf@yahoo.fr) (blur support, units
+Modified (2010-2014) by Nicolas Dufour (nicoduf@yahoo.fr) (blur support, units
convertion, comments, and some other fixes)
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -39,7 +39,7 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<xsl:strip-space elements="*" />
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
-<xsl:param name="silverlight_compatible" select="2" />
+<xsl:param name="silverlight_compatible" select="$silverlight" />
<!--
// Containers //
@@ -53,10 +53,16 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
-->
<xsl:template match="/">
<xsl:choose>
- <xsl:when test="$silverlight_compatible = 1">
+ <xsl:when test="$silverlight_compatible = 'true'">
+ <xsl:comment>
+ <xsl:value-of select="'This file is compatible with Silverlight'" />
+ </xsl:comment>
<xsl:apply-templates mode="forward" />
</xsl:when>
<xsl:otherwise>
+ <xsl:comment>
+ <xsl:value-of select="'This file is NOT compatible with Silverlight'" />
+ </xsl:comment>
<Viewbox Stretch="Uniform">
<xsl:apply-templates mode="forward" />
</Viewbox>
@@ -134,10 +140,10 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<Canvas.RenderTransform>
<TranslateTransform>
<xsl:attribute name="X">
- <xsl:value-of select="-number(substring-before($viewBox, ' '))" />
+ <xsl:value-of select="format-number(-number(substring-before($viewBox, ' ')), '#.#')" />
</xsl:attribute>
<xsl:attribute name="Y">
- <xsl:value-of select="-number(substring-before(substring-after($viewBox, ' '), ' '))" />
+ <xsl:value-of select="format-number(-number(substring-before(substring-after($viewBox, ' '), ' ')), '#.#')" />
</xsl:attribute>
</TranslateTransform>
</Canvas.RenderTransform>
@@ -837,7 +843,7 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<!--
// Unit to pixel converter //
- Values with units (except %) are converted to pixels and rounded.
+ Values with units (except %) are converted to pixels.
Unknown units are kept.
em, ex and % not implemented
-->
@@ -845,28 +851,25 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<xsl:param name="convert_value" />
<xsl:choose>
<xsl:when test="contains($convert_value, 'px')">
- <xsl:value-of select="round(translate($convert_value, 'px', ''))" />
+ <xsl:value-of select="translate($convert_value, 'px', '')" />
</xsl:when>
<xsl:when test="contains($convert_value, 'pt')">
- <xsl:value-of select="round(translate($convert_value, 'pt', '') * 1.25)" />
+ <xsl:value-of select="translate($convert_value, 'pt', '') * 1.333333" />
</xsl:when>
<xsl:when test="contains($convert_value, 'pc')">
- <xsl:value-of select="round(translate($convert_value, 'pc', '') * 15)" />
+ <xsl:value-of select="translate($convert_value, 'pc', '') * 16" />
</xsl:when>
<xsl:when test="contains($convert_value, 'mm')">
- <xsl:value-of select="round(translate($convert_value, 'mm', '') * 3.543307)" />
+ <xsl:value-of select="translate($convert_value, 'mm', '') * 3.779527" />
</xsl:when>
<xsl:when test="contains($convert_value, 'cm')">
- <xsl:value-of select="round(translate($convert_value, 'cm', '') * 35.43307)" />
+ <xsl:value-of select="translate($convert_value, 'cm', '') * 37.79527" />
</xsl:when>
<xsl:when test="contains($convert_value, 'in')">
- <xsl:value-of select="round(translate($convert_value, 'in', '') * 90)" />
+ <xsl:value-of select="translate($convert_value, 'in', '') * 96" />
</xsl:when>
<xsl:when test="contains($convert_value, 'ft')">
- <xsl:value-of select="round(translate($convert_value, 'ft', '') * 1080)" />
- </xsl:when>
- <xsl:when test="not(string(number($convert_value))='NaN')">
- <xsl:value-of select="round($convert_value)" />
+ <xsl:value-of select="translate($convert_value, 'ft', '') * 1152" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$convert_value" />
@@ -2650,7 +2653,7 @@ exclude-result-prefixes="rdf xlink xs exsl libxslt">
<xsl:if test="@d">
<xsl:choose>
- <xsl:when test="$silverlight_compatible = 1">
+ <xsl:when test="$silverlight_compatible = 'true'">
<xsl:attribute name="Data">
<xsl:value-of select="translate(@d , ',', ' ')" />
</xsl:attribute>
diff --git a/share/extensions/svg_transform.py b/share/extensions/svg_transform.py
index 07b523cc8..860c1df5d 100755
--- a/share/extensions/svg_transform.py
+++ b/share/extensions/svg_transform.py
@@ -7,11 +7,14 @@
#
# This file is part of Scour, http://www.codedread.com/scour/
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# This library is free software; you can redistribute it and/or modify
+# it either under the terms of the Apache License, Version 2.0, or, at
+# your option, under the terms and conditions of the GNU General
+# Public License, Version 2 or newer as published by the Free Software
+# Foundation. You may obtain a copy of these Licenses at:
#
# http://www.apache.org/licenses/LICENSE-2.0
+# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/share/extensions/synfig_prepare.py b/share/extensions/synfig_prepare.py
index e06efde9b..c6ad48c97 100755
--- a/share/extensions/synfig_prepare.py
+++ b/share/extensions/synfig_prepare.py
@@ -457,17 +457,17 @@ def get_dimension(s="1024"):
elif s[-2:] == "px":
return float(s[:-2])
elif s[-2:] == "pt":
- return float(s[:-2])*1.25
+ return float(s[:-2])*1.333
elif s[-2:] == "em":
return float(s[:-2])*16
elif s[-2:] == "mm":
- return float(s[:-2])*3.54
+ return float(s[:-2])*3.779
elif s[-2:] == "pc":
- return float(s[:-2])*15
+ return float(s[:-2])*16
elif s[-2:] == "cm":
- return float(s[:-2])*35.43
+ return float(s[:-2])*37.79
elif s[-2:] == "in":
- return float(s[:-2])*90
+ return float(s[:-2])*96
else:
return 1024
diff --git a/share/extensions/test/Makefile.am b/share/extensions/test/Makefile.am
index 9c3124351..7ff68083d 100644
--- a/share/extensions/test/Makefile.am
+++ b/share/extensions/test/Makefile.am
@@ -44,6 +44,7 @@ EXTRA_DIST = \
radiusrand.test.py \
render_alphabetsoup.test.py \
render_barcode.test.py \
+ render_barcode.data \
render_gears.test.py \
restack.test.py \
rtree.test.py \
diff --git a/share/extensions/test/render_barcode.test.py b/share/extensions/test/render_barcode.test.py
index 79f4ff979..f2ce23873 100755
--- a/share/extensions/test/render_barcode.test.py
+++ b/share/extensions/test/render_barcode.test.py
@@ -10,15 +10,10 @@ import random
import unittest
# Allow import of the extension code and modules
-sys.path.append('..')
+sys.path.append('..')
from render_barcode import *
-import Barcode.EAN5
-import Barcode.EAN8
-import Barcode.EAN13
-import Barcode.UPCA
-import Barcode.UPCE
digits = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ]
@@ -35,39 +30,40 @@ class InsertBarcodeBasicTest(unittest.TestCase):
self.data[btype].append( [ text, code ] )
fhl.close()
- def test_run_without_parameters(self):
- args = [ 'minimal-blank.svg' ]
- e = InsertBarcode()
- e.affect( args, False )
+ #def test_run_without_parameters(self):
+ # args = [ 'minimal-blank.svg', '-t', 'Ean5' ]
+ # e = InsertBarcode()
+ # e.affect( args, False )
#self.assertEqual( e.something, 'some value', 'A commentary about that.' )
def test_render_barcode_ian5(self):
"""Barcode IAN5"""
- self.barcode_test( 'ean5', Barcode.EAN5 )
+ self.barcode_test( 'Ean5' )
def test_render_barcode_ian8(self):
"""Barcode IAN5"""
- self.barcode_test( 'ean8', Barcode.EAN8 )
+ self.barcode_test( 'Ean8' )
def test_render_barcode_ian13(self):
"""Barcode IAN5"""
- self.barcode_test( 'ean13', Barcode.EAN13 )
+ self.barcode_test( 'Ean13' )
def test_render_barcode_upca(self):
"""Barcode IAN5"""
- self.barcode_test( 'upca', Barcode.UPCA )
+ self.barcode_test( 'Upca' )
def test_render_barcode_upce(self):
"""Barcode UPCE"""
- self.barcode_test( 'upce', Barcode.UPCE )
+ self.barcode_test( 'Upce' )
- def barcode_test(self, name, module):
+ def barcode_test(self, name):
"""Base module for all barcode testing"""
- for datum in self.data[name]:
+ for datum in self.data[name.lower()]:
(text, code) = datum
if not text or not code:
continue
- code2 = module.Object( {'text': text} ).encode(text)
+ coder = getBarcode( name, text=text)
+ code2 = coder.encode( text )
self.assertEqual(code, code2)
diff --git a/share/extensions/test/svg/default-inkscape-SVG.svg b/share/extensions/test/svg/default-inkscape-SVG.svg
index a6a610fdb..259e13c0d 100644
--- a/share/extensions/test/svg/default-inkscape-SVG.svg
+++ b/share/extensions/test/svg/default-inkscape-SVG.svg
@@ -8,8 +8,8 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://web.resource.org/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
- width="744.09448819"
- height="1052.3622047">
+ width="793.7007874"
+ height="1122.519685">
<defs />
<sodipodi:namedview
id="base"
diff --git a/share/extensions/test/svg/default-plain-SVG.svg b/share/extensions/test/svg/default-plain-SVG.svg
index 544273366..9c0884789 100644
--- a/share/extensions/test/svg/default-plain-SVG.svg
+++ b/share/extensions/test/svg/default-plain-SVG.svg
@@ -8,8 +8,8 @@
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
- width="744.09448819"
- height="1052.3622047">
+ width="793.7007874"
+ height="1122.519685">
<defs
id="defs4" />
<metadata
diff --git a/share/extensions/test/svg/empty-SVG.svg b/share/extensions/test/svg/empty-SVG.svg
index 475cc856b..d6c680b67 100644
--- a/share/extensions/test/svg/empty-SVG.svg
+++ b/share/extensions/test/svg/empty-SVG.svg
@@ -8,6 +8,6 @@
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
- width="744.09448819"
- height="1052.3622047">
+ width="793.7007874"
+ height="1122.519685">
</svg>
diff --git a/share/extensions/webslicer_create_rect.inx b/share/extensions/webslicer_create_rect.inx
index 5b3b447e9..85578e24e 100644
--- a/share/extensions/webslicer_create_rect.inx
+++ b/share/extensions/webslicer_create_rect.inx
@@ -11,7 +11,7 @@
<item value="jpg">JPG</item>
<item value="gif">GIF</item>
</param>
- <param name="dpi" type="float" min="1" max="9999" _gui-text="DPI:">90</param>
+ <param name="dpi" type="float" min="1" max="9999" _gui-text="DPI:">96</param>
<param name="dimension" type="string" _gui-text="Force Dimension:"></param>
<!-- i18n. Description duplicated in a fake value attribute in order to make it translatable -->
<param name="help-dimension1" type="description" _value="Force Dimension must be set as &lt;width&gt;x&lt;height&gt;">Force Dimension must be set as &lt;width&gt;x&lt;height&gt;</param>
diff --git a/share/extensions/yocto_css.py b/share/extensions/yocto_css.py
index a73e5f2a5..c6bd0c37e 100755
--- a/share/extensions/yocto_css.py
+++ b/share/extensions/yocto_css.py
@@ -7,11 +7,14 @@
#
# This file is part of Scour, http://www.codedread.com/scour/
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# This library is free software; you can redistribute it and/or modify
+# it either under the terms of the Apache License, Version 2.0, or, at
+# your option, under the terms and conditions of the GNU General
+# Public License, Version 2 or newer as published by the Free Software
+# Foundation. You may obtain a copy of these Licenses at:
#
# http://www.apache.org/licenses/LICENSE-2.0
+# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,