summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Mathog <>2012-10-04 08:04:48 +0000
committer~suv <suv-sf@users.sourceforge.net>2012-10-04 08:04:48 +0000
commitb75156c3b1ebae5c64ab85c28a69788c3868c8ef (patch)
treecdb0a4e62e29ce433fa3e11c1d8ecd5780377dbb /src
parentrevert changes in r11686 (not related to EMF support) (diff)
downloadinkscape-b75156c3b1ebae5c64ab85c28a69788c3868c8ef.tar.gz
inkscape-b75156c3b1ebae5c64ab85c28a69788c3868c8ef.zip
update based on patch 'changes_2012_09_27b.patch'
(bzr r11668.1.21)
Diffstat (limited to 'src')
-rw-r--r--src/extension/internal/emf-inout.cpp22
-rw-r--r--src/extension/internal/emf-print.cpp4
-rw-r--r--src/extension/internal/uemf.h6
-rw-r--r--src/extension/internal/uemf_endian.c4
-rw-r--r--src/extension/internal/uemf_print.c2
5 files changed, 13 insertions, 25 deletions
diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp
index 44f7d0465..2f682d5da 100644
--- a/src/extension/internal/emf-inout.cpp
+++ b/src/extension/internal/emf-inout.cpp
@@ -62,7 +62,7 @@ namespace Internal {
static float device_scale = DEVICESCALE;
static U_RECTL rc_old;
static bool clipset = false;
-static uint32_t ICMmode=0;
+static uint32_t ICMmode=0; // not used yet, but code to read it from EMF implemented
static uint32_t BLTmode=0;
/** Construct a PNG in memory from an RGB from the EMF file
@@ -120,8 +120,8 @@ static pixel_t * pixel_at (bitmap_t * bitmap, int x, int y)
void
my_png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
- /* with libpng15 next line causes pointer deference error; use libpng12 */
- PMEMPNG p=(PMEMPNG)png_ptr->io_ptr;
+ PMEMPNG p=(PMEMPNG)png_get_io_ptr(png_ptr);
+
size_t nsize = p->size + length;
/* allocate or grow buffer */
@@ -221,16 +221,6 @@ void toPNG(PMEMPNG accum, int width, int height, char *px){
}
-/* Given "value" and "max", the maximum value which we expect "value"
- to take, this returns an integer between 0 and 255 proportional to
- "value" divided by "max". */
-
-static int pix (int value, int max)
-{
- if (value < 0)
- return 0;
- return (int) (256.0 *((double) (value)/(double) max));
-}
/* convert an EMF RGB(A) color to 0RGB
inverse of gethexcolor() in emf-print.cpp
@@ -2944,10 +2934,8 @@ std::cout << "BEFORE DRAW"
case U_EMR_SETICMMODE:
{
dbg_str << "<!-- U_EMR_SETICMMODE -->\n";
-#if 0
- PU_EMRENABLEICM pEmr = (PU_EMRENABLEICM) lpEMFR;
+ PU_EMRSETICMMODE pEmr = (PU_EMRSETICMMODE) lpEMFR;
ICMmode= pEmr->iMode;
-#endif //0
break;
}
case U_EMR_CREATECOLORSPACE: dbg_str << "<!-- U_EMR_CREATECOLORSPACE -->\n"; break;
@@ -2991,7 +2979,7 @@ std::cout << "BEFORE DRAW"
} //end of while
// When testing, uncomment the following to show the final SVG derived from the EMF
-std::cout << *(d->outsvg) << std::endl;
+// std::cout << *(d->outsvg) << std::endl;
return 1;
}
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 093d41fdb..e31c727fb 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -2038,8 +2038,8 @@ unsigned int PrintEmf::text(Inkscape::Extension::Print * /*mod*/, char const *te
Geom::Point p2 = p * tf;
- //Handle super/subscripts. Negative sign because of geometry of MM_TEXT.
-/*
+ //Handle super/subscripts and vertical kerning
+/* Previously used this, but vertical kerning was not supported
p2[Geom::X] -= style->baseline_shift.computed * std::sin( rotb );
p2[Geom::Y] -= style->baseline_shift.computed * std::cos( rotb );
*/
diff --git a/src/extension/internal/uemf.h b/src/extension/internal/uemf.h
index b09dc5d99..e4bafcb32 100644
--- a/src/extension/internal/uemf.h
+++ b/src/extension/internal/uemf.h
@@ -13,8 +13,8 @@
/*
File: uemf.h
-Version: 0.0.8
-Date: 14-SEP-2012
+Version: 0.0.9
+Date: 27-SEP-2012
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2012 David Mathog and California Institute of Technology (Caltech)
@@ -1940,7 +1940,7 @@ typedef struct {
U_EMRSETSTRETCHBLTMODE, *PU_EMRSETSTRETCHBLTMODE, //!< StretchMode Enumeration
U_EMRSETTEXTALIGN, *PU_EMRSETTEXTALIGN, //!< TextAlignment enumeration
U_EMRSELECTCLIPPATH, *PU_EMRSELECTCLIPPATH, //!< RegionMode Enumeration
- U_EMRSETICMMODE, *PU_ERMSETICMMODE, //!< ICMMode Enumeration
+ U_EMRSETICMMODE, *PU_EMRSETICMMODE, //!< ICMMode Enumeration
U_EMRSETLAYOUT, *PU_EMRSETLAYOUT; //!< Mirroring Enumeration
/* Index 23 */
diff --git a/src/extension/internal/uemf_endian.c b/src/extension/internal/uemf_endian.c
index 9c9f7f578..d1563fc82 100644
--- a/src/extension/internal/uemf_endian.c
+++ b/src/extension/internal/uemf_endian.c
@@ -18,7 +18,7 @@
/*
File: uemf_endian.h
Version: 0.0.9
-Date: 26-SEP-2012
+Date: 27-SEP-2012
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2012 David Mathog and California Institute of Technology (Caltech)
@@ -376,7 +376,7 @@ void pixelformatdescriptor_swap(
/**
\brief Convert a Pointer to a U_EMRTEXT record
\param pemt Pointer to a U_EMRTEXT record
- \param record Pointer to the start of the record which contains this U_ERMTEXT
+ \param record Pointer to the start of the record which contains this U_EMRTEXT
\param torev 1 for native to reversed, 0 for reversed to native
*/
void emrtext_swap(
diff --git a/src/extension/internal/uemf_print.c b/src/extension/internal/uemf_print.c
index 07c926eac..ccfbc9008 100644
--- a/src/extension/internal/uemf_print.c
+++ b/src/extension/internal/uemf_print.c
@@ -543,7 +543,7 @@ void pixelformatdescriptor_print(
/**
\brief Print a Pointer to a U_EMRTEXT record
\param emt Pointer to a U_EMRTEXT record
- \param record Pointer to the start of the record which contains this U_ERMTEXT
+ \param record Pointer to the start of the record which contains this U_EMRTEXT
\param type 0 for 8 bit character, anything else for 16
*/
void emrtext_print(