Commit 2a07bc33 authored by Gianfranco Costamagna's avatar Gianfranco Costamagna

New upstream version 7.2.7.1

parent 28aec2b5
......@@ -6,3 +6,5 @@ build
*.AppImage
AppImageKit
Ipe.AppDir
*.pyc
*.snap
......@@ -10,7 +10,7 @@ ifdef COMSPEC
TARGET = pdftoipe.exe
else ifdef IPECROSS
# cross-compiling for Windows?
CXX=i686-w64-mingw32-g++
CXX=x86_64-w64-mingw32-g++
CPPFLAGS += -I/sw/mingwlibs/include/poppler
LIBS += -L/sw/mingwlibs/lib -lpoppler
LDFLAGS += -static
......@@ -23,7 +23,7 @@ else
TARGET = pdftoipe
endif
CXXFLAGS += -Wno-write-strings
CXXFLAGS += -Wno-write-strings -std=c++11
all: $(TARGET)
......
......@@ -5,7 +5,7 @@
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
.TH PDFTOIPE 1 "October 13, 2009"
.TH PDFTOIPE 1 "January 3, 2017"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
......@@ -37,7 +37,7 @@ to take arbitrary PDF files and make them editable in Ipe.
\fBpdftoipe\fP does a pretty good job on drawings, but doesn't handle
text very well. Ipe's text model is based on LaTeX, which is just
very different from the text found in most PDF files.
too different from the text found in most PDF files.
.TP
\fB-notext\fR
......@@ -97,11 +97,11 @@ Otfried Cheong
.SH REPORTING BUGS
.ad l
Please report bugs at
.I "http://ipe7.sourceforge.net/bugzilla.html"
.I "https://github.com/otfried/ipe-tools/issues"
.SH SEE ALSO
.ad l
More information about Ipe can be found in
.IR "The Ipe Manual" ,
available online at
.I "http://ipe7.sourceforge.net/manual/manual.html"
.I "http://ipe.otfried.org/manual/manual.html"
......@@ -156,10 +156,6 @@ int main(int argc, char *argv[])
delete doc;
delete globalParams;
// check for memory leaks
Object::memCheck(stderr);
gMemReport(stderr);
return exitCode;
}
......
......@@ -65,6 +65,17 @@ If you want to compile pdftoipe on Windows, please refer to
Changes
=======
* 2018/09/24
Removed Object::memCheck call to compile with poppler 0.69 (bug
#29).
* 2017/09/19
Fixed formatting of color values from %g to %f.
* 2017/09/05
Added -std=c++11 flag to Makefile for compiling with new poppler
version.
* 2014/03/03
Applied patch from bug #138 to fix compilation on newer poppler
versions, as well as fix missing dollar signs for some greek
......
......@@ -611,7 +611,7 @@ void XmlOutputDev::writeColor(const char *prefix, const GfxRGB &rgb,
{
if (prefix)
writePS(prefix);
writePSFmt("\"%g %g %g\"", colToDbl(rgb.r), colToDbl(rgb.g), colToDbl(rgb.b));
writePSFmt("\"%f %f %f\"", colToDbl(rgb.r), colToDbl(rgb.g), colToDbl(rgb.b));
if (suffix)
writePS(suffix);
}
......
......@@ -14,7 +14,7 @@
class GfxPath;
class GfxFont;
#define PDFTOIPE_VERSION "2014/03/03"
#define PDFTOIPE_VERSION "2018/09/24"
class XmlOutputDev : public OutputDev
{
......
name: ipe
version: 7.2.6
version: 7.2.7
summary: Ipe http://ipe.otfried.org/
description: Drawing editor for creating figures in PDF format.
Ipe supports making small figures for inclusion into LaTeX
......@@ -25,7 +25,7 @@ confinement: strict
parts:
ipe:
source: https://dl.bintray.com/otfried/generic/ipe/7.2/ipe-7.2.6-src.tar.gz
source: https://dl.bintray.com/otfried/generic/ipe/7.2/ipe-7.2.7-src.tar.gz
source-subdir: src
plugin: make
make-parameters:
......@@ -58,7 +58,7 @@ parts:
source: http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
build-packages:
- wget
snap:
prime:
- -texlive/texmf-dist/doc
- -texlive/texmf-dist/source
- -texlive/texmf-dist/tex/context
......@@ -122,4 +122,3 @@ apps:
sh:
command: wrapper.sh sh
plugs: [home]
......@@ -161,17 +161,20 @@ def parse_path(out, d):
d = re.findall("([A-Za-z]|-?[0-9]+\.?[0-9]*(?:e-?[0-9]*)?)", d)
x, y = 0.0, 0.0
xs, ys = 0.0, 0.0
x0, y0 = 0.0, 0.0
while d:
if not d[0][0] in "01234567890.-":
opcode = d.pop(0)
if opcode == 'M':
x, y = pnext(d, 2)
x0, y0 = x, y
out.write("%g %g m\n" % (x, y))
opcode = 'L'
elif opcode == 'm':
x1, y1 = pnext(d, 2)
x += x1
y += y1
x0, y0 = x, y
out.write("%g %g m\n" % (x, y))
opcode = 'l'
elif opcode == 'L':
......@@ -235,6 +238,7 @@ def parse_path(out, d):
draw_arc(out, x, y, rx, ry, phi, large_arc, sweep, x2, y2)
x, y = x2, y2
elif opcode in 'zZ':
x, y = x0, y0
out.write("h\n")
else:
sys.stderr.write("Unrecognised opcode: %s\n" % opcode)
......@@ -704,26 +708,106 @@ class Svg():
if n.tagName == "tspan": # recurse
self.collect_text(n)
def parse_text_style(self, t):
attrs = {}
if not t.hasAttribute("style"):
return attrs
tokens = t.getAttribute("style").split(";")
for token in tokens:
if (len(token.split(":")) != 2):
print("Ignored style token: " + str(token))
# Strange token
continue
key, value = token.split(":")
value = value.strip().lower()
key = key.strip().lower()
if key == "font-weight":
if value in ("bold", "bolder"):
attrs["weight"] = "bold"
elif key == "font-size":
attrs["size"] = parse_float(value)
elif key == "font-family":
attrs["svg-families"] = [v.strip() for v in (value.split(","))]
elif key == "text-anchor":
attrs["anchor"] = value
return attrs
def parse_text_attrs(self, t):
raw_attrs = self.parse_attributes(t)
attrs = {}
if raw_attrs["font-size"]:
attrs["size"] = parse_float(raw_attrs["font-size"])
if raw_attrs["fill"]:
attrs["color"] = parse_color(raw_attrs["fill"])
return attrs
def map_svg_font_families(self, families):
# return the first family for which we find a mapping
for family in families:
if family in ("helvetica", "sans-serif"):
return "phv"
elif family in ("times new roman", "times", "serif"):
return "ptm"
return None
def node_text(self, t):
if not t.hasAttribute("x") or not t.hasAttribute("y"):
sys.stderr.write("Text without coordinates ignored\n")
return
x = float(t.getAttribute("x"))
y = float(t.getAttribute("y"))
attr = self.parse_attributes(t)
if not t.hasAttribute("x"):
x = 0.0
else:
x = float(t.getAttribute("x"))
if not t.hasAttribute("y"):
y = 0.0
else:
y = float(t.getAttribute("y"))
attributes = self.parse_text_style(t)
attributes.update(self.parse_text_attrs(t))
self.out.write('<text pos="%g %g"' % (x,y))
self.out.write(' transformations="affine" valign="baseline"')
m = parse_transform(t)
if not m: m = Matrix()
m = m * Matrix([1, 0, 0, -1, x, y]) * Matrix([1, 0, 0, 1, -x, -y])
self.out.write(' matrix="%s"' % m)
if attr["font-size"]:
self.out.write(' size="%g"' % parse_float(attr["font-size"]))
color = parse_color(attr["fill"])
if color:
self.out.write(' stroke="%g %g %g"' % color)
if "size" in attributes:
self.out.write(' size="%g"' % attributes["size"])
if "color" in attributes:
self.out.write(' stroke="%g %g %g"' % attributes["color"])
halign = "left"
valign = "bottom"
if "anchor" in attributes:
if attributes["anchor"] == "middle":
halign = "center"
valign = "center"
elif attributes["anchor"] == "end":
halign = "right"
self.out.write(' valign="%s"' % valign)
self.out.write(' halign="%s"' % halign)
self.text = ""
self.collect_text(t)
if "svg-families" in attributes:
mapped_family = self.map_svg_font_families(attributes["svg-families"])
if mapped_family is not None:
self.text = "{\\fontfamily{" + mapped_family + "}\\selectfont{}" + self.text + "}"
if "weight" in attributes:
if attributes["weight"] == "bold":
self.text = "\\bf{" + self.text + "}"
self.out.write('>%s</text>\n' % self.text.encode("UTF-8"))
def node_image(self, node):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment