Commit c2eb98d3 authored by Alexander Bürger's avatar Alexander Bürger

import release 0.21

parents
.gdb_history
.depend-*.dep
*.o
fig2sxd
# fixg2sxd - a utility to convert fig to sxd format
# Copyright (C) 2003-2010 Alexander Bürger, acfb@users.sourceforge.net
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
# to cross-compile for win32, try: make CXX=i586-mingw32msvc-g++
# INCLUDES=-I/tmp/zlib-win32/include LIBS=/tmp/zlib-win32/lib/libz.a
# to put binaries into separate directory (good for cross-compile), go
# there and try: make -f ..srcdir../Makefile SRCDIR=..srcdir.. where
# ..srcdir.. is the path to the source directory
DESTDIR =
SRCDIR=
TARGET1 = fig2sxd
HEADERS1 = colors.h misc.h styles.h xfigobjects.h xmlwrite.h vector2.h \
zipwrite.h
SOURCES1 = fig2sxd.cpp xfig_arc.cpp xfig_compound.cpp xfig_ellipse.cpp \
xfig_poly.cpp xfig_spline.cpp xfig_text.cpp \
style_arrow.cpp style_line.cpp style_text.cpp colors.cpp misc.cpp \
xmlwrite.cpp zipwrite.cpp check.cpp
OBJECTS1 = $(SOURCES1:%.cpp=%.o)
TARGETS = $(TARGET1)
ARCHFILES_1 = $(HEADERS1) $(SOURCES1) Makefile fig2sxd.1
ARCHFILES = $(ARCHFILES_1:%=$(MYDIR)/%)
DEPEND = .depend-
DEPFILES = $(SOURCES1:%.cpp=$(DEPEND)%.dep)
CXX = g++
CXXFLAGS = -Wall -W -O2 -g
CXXFLAGS += $(INCLUDES)
LIBS = -lz
$(TARGET1): $(OBJECTS1)
$(CXX) -o $@ $^ $(LIBS)
$(OBJECTS1): %.o: $(SRCDIR)%.cpp $(DEPEND)%.dep
$(CXX) $(CXXFLAGS) -o $@ -c $<
$(DEPFILES): $(DEPEND)%.dep: $(SRCDIR)%.cpp
$(CXX) $(INCLUDES) -M $< > $@
-include $(DEPFILES)
clean:
rm -f $(TARGETS) $(OBJECTS1) $(DEPFILES)
all: install
install: $(TARGET1) fig2sxd.1
install -d $(DESTDIR)/bin $(DESTDIR)/share/man/man1
install -m755 $(TARGET1) $(DESTDIR)/bin
install -m644 fig2sxd.1 $(DESTDIR)/share/man/man1
tgz:
tar czf `date +"../fig2sxd-%Y-%m-%d-%H-%M.tar.gz"` -C $(SRCDIR)../ \
$(ARCHFILES)
.PHONY: all clean
2010-05-19 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.21
* add -stylebase option to allow including several figures
in one document without messing up the styles (nb: OLE!)
* remove end of line after mimetype; this made OOo 3.2 claim
that files are corrupted and unrepairable; closes sf.net #3004139
2008-10-25 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.20
* print warnings for long polygons, polylines and splines
2008-10-17 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.19
* Split long unfilled polylines to avoid problems with
OpenOffice.org being apparently unable to read xml attribute
values longer than 64kB.
* Accept float coordinates (although xfig specifies only
integers).
2008-05-22 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.18
* Set numeric locale to "C" at startup.
* Fix text placement problems by explicitly setting padding to
0cm.
2007-05-16 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.17
* Add includes for gcc 4.3 and other compilers. (closes: debian
#417183)
* Support writing to stdout. Thanks for suggesting to Duncan
Simpson <duncan@oxbridgeapps.com>.
2006-11-22 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.16
* Fixed problem described in sf.net bug report #1563135 by
skipping more comments. Comments between lines of one object still
cause problems.
2006-11-21 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.15
* Improved compatibility with OOo 2.
* Fixed wrong font name for Symbol font.
2006-02-08 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.14
* Added range-checks for most/all? values in the input as
specified in xfig's FORMAT3.2. Now it does not crash any longer
for the schemat.fig example of jfig. Thanks to Patrice
Moreaux (LISTIC, Universite de Savoie, France) for pointing me at
this problem.
2004-07-30 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.13
* Added some #include <cmath> to get sqrt with g++-3.4. (closes:
debian bug #262380)
2004-04-29 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.12
* Fixed infinite loop when reading files with multi-line comments.
2004-04-20 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.11
* Fixed bug in placement of rotated ellipses.
* Very basic support for LaTeX fonts.
* Tried to improve text placement for very small font sizes.
2004-01-21 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.9
* Tried to make zipwrite independent of endianness.
2004-01-16 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.8
* Write meta.xml, mimetype and manifest.xml; this makes including
the output in other OOo documents much easier.
2004-01-15 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.7
* Add short option for linewidth.
* Position splines much better. Rest of malpositioning comes from
different shape of the splines.
2004-01-14 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.6
* Fix bug in x-splines placing them completely wrong.
* Do not write control characters (below ' ').
* Add option to set line thickness for thickness 1.
2004-01-14 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.5
* Skip invisible lines/fills.
2004-01-11 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.4
* Better placement for font sizes < 7.
* Support for "Helvetica-Narrow".
* Stop using different layers for line and fill in filled, open
objects.
* Support for more than 1000 layers.
2004-01-07 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.3
* Guess output filename when just input file is given.
2004-01-03 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.2
* Write sxd file directly.
2003-12-28 Alexander Bürger <acfb@users.sourceforge.net>
* version 0.1
* Initial Release.
// -*-c++-*-
// fixg2sxd - a utility to convert fig to sxd format
// Copyright (C) 2003-2010 Alexander Bürger, acfb@users.sourceforge.net
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "check.h"
#include <sstream>
#include <iostream>
#include <cassert>
using namespace std;
bool out_of_range_error=true;
template<typename T>
void keep_range( T& value, const char* name, const T mini, const T maxi )
{
assert( mini <= maxi );
if( value < mini || value > maxi ) {
if( out_of_range_error ) {
ostringstream o;
o << "Error: " << name << '=' << value << " out of range ["
<< mini << ',' << maxi << "]";
throw o.str();
} else {
cerr << "Warning: " << name << " was " << value
<< " which is out of range [" << mini << ','
<< maxi << "]; set to " << mini << '.' << endl;
value = mini;
}
}
}
template
void keep_range<float>( float& v, const char* name, const float l, const float u );
template
void keep_range<int>( int& v, const char* name, const int l, const int u );
// -*-c++-*-
// fixg2sxd - a utility to convert fig to sxd format
// Copyright (C) 2003-2010 Alexander Bürger, acfb@users.sourceforge.net
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef CHECK_H
#define CHECK_H 1
#include <limits>
template<typename T>
void keep_range( T& value, const char* name, const T mini,
const T maxi=std::numeric_limits<T>::max() );
#endif /* CHECK_H */
// -*-c++-*-
// fixg2sxd - a utility to convert fig to sxd format
// Copyright (C) 2003-2010 Alexander Bürger, acfb@users.sourceforge.net
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "colors.h"
#include "misc.h"
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <string>
using namespace std;
static unsigned int hexcolors_with_minus_1[545];
unsigned int *hexcolor = 0;
void read_color( istream& figfile )
{
int color_number;
string hex; // XXX bad if malformed hex value!
figfile >> color_number >> hex;
if( color_number<32 || color_number>543 )
fail( "Color number out of range." );
hexcolor[color_number] = strtol( hex.c_str()+1, 0, 16 );
}
void initcolors()
{
hexcolor = hexcolors_with_minus_1 + 1;
hexcolor[-1] = 0x000000; // Black
hexcolor[0] = 0x000000; // Black
hexcolor[1] = 0x0000ff; // Blue
hexcolor[2] = 0x00ff00; // Green
hexcolor[3] = 0x00ffff; // Cyan
hexcolor[4] = 0xff0000; // Red
hexcolor[5] = 0xff00ff; // Magenta
hexcolor[6] = 0xffff00; // Yellow
hexcolor[7] = 0xffffff; // White
hexcolor[8] = 0x000090; // four shades of blue (dark to lighter)
hexcolor[9] = 0x0000b0;
hexcolor[10] = 0x0000d0;
hexcolor[11] = 0x87ceff;
hexcolor[12] = 0x009000; // three shades of green (dark to lighter)
hexcolor[13] = 0x00b000;
hexcolor[14] = 0x00d000;
hexcolor[15] = 0x009090; // three shades of cyan (dark to lighter)
hexcolor[16] = 0x00b0b0;
hexcolor[17] = 0x00d0d0;
hexcolor[18] = 0x900000; // three shades of red (dark to lighter)
hexcolor[19] = 0xb00000;
hexcolor[20] = 0xd00000;
hexcolor[21] = 0x900090; // three shades of magenta (dark to lighter)
hexcolor[22] = 0xb000b0;
hexcolor[23] = 0xd000d0;
hexcolor[24] = 0x803000; // three shades of brown (dark to lighter)
hexcolor[25] = 0xa04000;
hexcolor[26] = 0xc06000;
hexcolor[27] = 0xff8080; // four shades of pink (dark to lighter)
hexcolor[28] = 0xffa0a0;
hexcolor[29] = 0xffc0c0;
hexcolor[30] = 0xffe0e0;
hexcolor[31] = 0xffd700; // Gold
int i;
for( i=32; i<544; ++i )
hexcolor[i] = 0;
}
std::string colorstring(int index)
{
return color2string( hexcolor[index] );
}
string color2string(unsigned int color)
{
static const char map[17] = "0123456789ABCDEF";
char tmp[8] = "#123456";
for( int i=0; i<6; ++i ) {
tmp[6-i] = map[ color&0xf ];
color >>= 4;
}
return string(tmp);
}
// -*-c++-*-
// fixg2sxd - a utility to convert fig to sxd format
// Copyright (C) 2003-2010 Alexander Bürger, acfb@users.sourceforge.net
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef COLORS_H
#define COLORS_H
#include <istream>
#include <string>
void initcolors();
void read_color( std::istream& figfile );
std::string color2string(unsigned int color);
std::string colorstring(int index);
#endif // COLORS_H
fig2sxd (0.21-1) unstable; urgency=low
* New upstream version.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 19 May 2010 23:54:00 +0200
fig2sxd (0.20-1) unstable; urgency=low
* New upstream version.
-- Alexander Bürger <acfb@users.sourceforge.net> Sun, 26 Oct 2008 17:38:00 +0100
fig2sxd (0.19-1) unstable; urgency=low
* New upstream version.
* New Standards-Version 3.8.0, no changes.
-- Alexander Bürger <acfb@users.sourceforge.net> Fri, 17 Oct 2008 21:38:00 +0200
fig2sxd (0.18-1) unstable; urgency=low
* Set numeric locale to "C" at startup.
* Fix text placement problems by explicitly setting padding to 0cm.
* Use cdbs for building, updated standards version.
* Acknowledge NMU, bug report already closed and archived.
-- Alexander Bürger <acfb@users.sourceforge.net> Thu, 22 May 2008 08:38:00 +0200
fig2sxd (0.17-1.1) unstable; urgency=low
* Non-maintainer upload.
* Fix g++-4.3 FTBFS thanks to Cyril Brulebois (Closes: 455650).
-- Pierre Habouzit <madcoder@debian.org> Sun, 16 Mar 2008 22:48:46 +0000
fig2sxd (0.17-1) unstable; urgency=low
* Add includes for gcc 4.3 and other compilers. (closes: #417183)
* Support writing to stdout. Thanks for suggesting to Duncan Simpson
<duncan@oxbridgeapps.com>.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 16 May 2007 16:00:00 +0100
fig2sxd (0.16-1) unstable; urgency=low
* Fixed problem described in sf.net bug report #1563135 by skipping more
comments. Comments between lines of one object still cause problems.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 22 Nov 2006 13:00:00 +0100
fig2sxd (0.15-1) unstable; urgency=low
* Improved compatibility with OOo 2.
* Fixed wrong font name for Symbol font.
-- Alexander Bürger <acfb@users.sourceforge.net> Tue, 21 Nov 2006 22:00:00 +0100
fig2sxd (0.14-1) unstable; urgency=low
* Added range-checks for most/all? values in the input as specified in xfig's
FORMAT3.2. Now it does not crash any longer for the schemat.fig example
of jfig. Thanks to Patrice Moreaux (LISTIC, Universite de Savoie, France)
for pointing me at this problem.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 08 Feb 2006 22:00:00 +0100
fig2sxd (0.13-1) unstable; urgency=low
* Added some #include <cmath> to get sqrt with g++-3.4. (closes: #262380)
* Improved capitalization of OpenOffice.org and XFig. (closes: #254041)
-- Alexander Bürger <acfb@users.sourceforge.net> Fri, 30 Jul 2004 23:00:00 +0100
fig2sxd (0.12-1) unstable; urgency=low
* Fixed infinite loop when reading files with multi-line comments.
-- Alexander Bürger <acfb@users.sourceforge.net> Thu, 29 Apr 2004 19:15:00 +0100
fig2sxd (0.11-1) unstable; urgency=low
* Fixed bug in placement of rotated ellipses.
* Very basic support for LaTeX fonts.
* Tried to improve text placement for very small font sizes.
-- Alexander Bürger <acfb@users.sourceforge.net> Tue, 20 Apr 2004 09:45:00 +0100
fig2sxd (0.10-3) unstable; urgency=low
* Fix bad debian revision - the last one was no NMU.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 28 Jan 2004 19:45:00 +0100
fig2sxd (0.10-2.1) unstable; urgency=low
* Fix packaging problem.
-- Alexander Bürger <acfb@users.sourceforge.net> Tue, 27 Jan 2004 20:20:00 +0100
fig2sxd (0.10-2) unstable; urgency=low
* Include dh_installdocs in debian/rules.
-- Alexander Bürger <acfb@users.sourceforge.net> Mon, 26 Jan 2004 10:20:00 +0100
fig2sxd (0.10-1) unstable; urgency=low
* Change packaging: not debian-native, build with -g, better debian/rules.
-- Alexander Bürger <acfb@users.sourceforge.net> Sun, 25 Jan 2004 21:20:00 +0100
fig2sxd (0.9a) unstable; urgency=low
* Fix package deficiencies discovered by lintian.
-- Alexander Bürger <acfb@users.sourceforge.net> Thu, 22 Jan 2004 21:10:00 +0100
fig2sxd (0.9) unstable; urgency=low
* Tried to make zipwrite independent of endianness.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 21 Jan 2004 11:30:00 +0100
fig2sxd (0.8) unstable; urgency=low
* Write meta.xml, mimetype and manifest.xml; this makes including the
output in other OOo documents much easier.
-- Alexander Bürger <acfb@users.sourceforge.net> Fri, 16 Jan 2004 16:50:00 +0100
fig2sxd (0.7) unstable; urgency=low
* Add short option for linewidth.
* Position splines much better. Rest of malpositioning comes from different
shape of the splines.
-- Alexander Bürger <acfb@users.sourceforge.net> Thu, 15 Jan 2004 11:20:00 +0100
fig2sxd (0.6) unstable; urgency=low
* Fix bug in x-splines placing them completely wrong.
* Do not write control characters (below ' ').
* Add option to set line thickness for thickness 1.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 14 Jan 2004 14:00:00 +0100
fig2sxd (0.5) unstable; urgency=low
* Skip invisible lines/fills.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 14 Jan 2004 09:47:00 +0100
fig2sxd (0.4-1) unstable; urgency=low
* Better placement for font sizes < 7.
* Support for "Helvetica-Narrow".
* Stop using different layers for line and fill in filled, open objects.
* Support for more than 1000 layers.
-- Alexander Bürger <acfb@users.sourceforge.net> Sun, 11 Jan 2004 16:17:00 +0100
fig2sxd (0.3-1) unstable; urgency=low
* Guess output filename when just input file is given.
-- Alexander Bürger <acfb@users.sourceforge.net> Wed, 7 Jan 2004 18:37:00 +0100
fig2sxd (0.2-1) unstable; urgency=low
* Write sxd file directly.
-- Alexander Bürger <acfb@users.sourceforge.net> Sat, 3 Jan 2004 15:12:00 +0100
fig2sxd (0.1-1) unstable; urgency=low
* Initial Release.
-- Alexander Bürger <acfb@users.sourceforge.net> Sun, 28 Dec 2003 19:16:46 +0100
Source: fig2sxd
Section: graphics
Priority: optional
Maintainer: Alexander Bürger <acfb@users.sourceforge.net>
Build-Depends: cdbs, debhelper (>= 5), libz-dev
Standards-Version: 3.8.0
Homepage: http://fig2sxd.sourceforge.net
Package: fig2sxd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: openoffice.org, xfig, pstoedit
Description: convert XFig files to OpenOffice.org format
This program converts a file in XFig format into a .sxd file for
OpenOffice.org Draw.
This program is available from http://fig2sxd.sourceforge.net.
Upstream author and package maintainer:
Alexander Bürger <acfb@users.sourceforge.net>
Copyright:
fig2sxd
Copyright (C) 2003-2010 Alexander Bürger, acfb@users.sourceforge.net
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.
A copy of this license can be found in /usr/share/common-licenses/GPL.
fig2sxd usr/bin
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
DEB_INSTALL_MANPAGES_fig2sxd := fig2sxd.1
version=3
http://sf.net/fig2sxd/fig2sxd_(.*)\.orig\.tar\.gz
This diff is collapsed.
This diff is collapsed.
#FIG 3.2
Portrait
Flush left
Inches
Letter
100.00
Single
0
1200 2
0 32 #b2b2b2
0 33 #f2b2b2
0 34 #6599cc
0 35 #4c4c4c
# polyline
2 1 0 1 0 0 999 0 -1 4.000 0 0 0 0 0 8
4159 4104 2920 8742 2796 8714 2879 9223 3209 8824 3099 8783
4351 4104 4159 4104
# polyline
2 1 0 0 0 0 999 0 20 4.000 0 0 0 0 0 8
7489 5384 6251 10021 6127 9994 6209 10503 6540 10104 6430 10063
7682 5384 7489 5384
This diff is collapsed.