Commit 89bb2602 authored by su-v's avatar su-v Committed by su-v

Fixes bug #988601: omnibus patch for EMF input/output support (cross-platform)

(bzr r11668.1.8)
parent 232af173
......@@ -453,7 +453,7 @@
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
-mwindows
-mconsole
-mthreads
</flags>
<fileset dir="${build}">
......@@ -527,7 +527,7 @@
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
-mwindows
-mconsole
-mthreads
</flags>
<fileset dir="${build}">
......
......@@ -1067,6 +1067,7 @@ src/libcroco/makefile
src/libgdl/makefile
src/libnrtype/makefile
src/libavoid/makefile
src/libunicode-convert/makefile
src/livarot/makefile
src/live_effects/makefile
src/live_effects/parameter/makefile
......
......@@ -179,6 +179,7 @@ extensions = \
yocto_css.py
otherstuff = \
fontfix.conf \
inkweb.js \
jessyInk.js \
jessyInk_core_mouseHandler_noclick.js \
......
# This file contains correction factors for the PowerPoint compensation method
# when files are saved to EMF. PowerPoint applies some odd offsets when it ungroups
# fonts from within an EMF. This file contains compensating factors so that the
# imported, ungrouped characters end up in the desired location.
#
# Format(s)
#
# # a comment
#
# f1 f2 f3 FontName
# where
# f1: vertical (rotating) correction factor (a double)
# f2: vertical (nonrotating) correction factor (a double)
# f3: horizontal (nonrotating) correction factor (a double)
# FontName: Case sensitive, may contain spaces. Example: Times New Roman
#
# The first font will listed will be used as the default for any font which
# is later requested but was not explicitly listed.
#
# If f1 specifies a multiplicative correction factor. It is multiplied by the font size
# and then the character is offset parallel to the (original) vertical direction of the character,
# that is, along the long part of a capital L.
#
# If f2 or f3 is nonzero then for angles <1 degree from 0,90,180,270 degrees
# the angle is snapped to n*90 and f2 is used for the vertical displacements, f3
# for the horizontal displacements (that is, for 90 degrees, f3 is used).
#
# There is are one special type of fontname: Convert To FontName,
# for instance "Convert To Symbol". It is used when EMF print converts
# from unicode to Symbol, Wingdings, or Zapf Dingbats.
#
# Positive values lower the letter, negative raise it
#
# File history:
# 1.0.0 03/26/2012, David Mathog, initial values
#####################################################################
0.05 -0.055 -0.065 Arial
0.05 -0.055 -0.065 Times New Roman
-0.025 -0.055 -0.065 Lucida Sans
0.05 -0.055 -0.065 Sans
-0.05 -0.055 -0.065 Microsoft Sans Serif
0.05 -0.055 -0.065 Serif
0.05 -0.055 -0.065 Garamond
0.25 0.025 0.025 Century Schoolbook
0.025 0.0 0.0 Verdana
0.045 0.025 0.025 Tahoma
0.025 0.0 0.0 Symbol
0.05 0.0 0.0 Wingdings
0.025 0.0 0.0 Zapf Dingbats
0.025 0.0 0.0 Convert To Symbol
0.05 0.0 0.0 Convert To Wingdings
0.025 0.0 0.0 Convert To Zapf Dingbats
0.1 0.0 0.0 Sylfaen
0.175 0.125 0.125 Palatino Linotype
0.1 0.0 0.0 Segoe UI
......@@ -135,6 +135,7 @@ include live_effects/Makefile_insert
include live_effects/parameter/Makefile_insert
include libvpsc/Makefile_insert
include libcola/Makefile_insert
include libunicode-convert/Makefile_insert
include svg/Makefile_insert
include widgets/Makefile_insert
include debug/Makefile_insert
......@@ -190,10 +191,10 @@ EXTRA_DIST += \
widgets/makefile.in \
xml/makefile.in \
2geom/makefile.in \
extension/internal/emf-win32-inout.cpp \
extension/internal/emf-win32-inout.h \
extension/internal/emf-win32-print.cpp \
extension/internal/emf-win32-print.h \
extension/internal/emf-inout.cpp \
extension/internal/emf-inout.h \
extension/internal/emf-print.cpp \
extension/internal/emf-print.h \
helper/sp-marshal.list \
show-preview.bmp \
winconsole.cpp \
......
......@@ -32,10 +32,8 @@
#include "system.h"
#include "db.h"
#include "internal/svgz.h"
#ifdef WIN32
# include "internal/emf-win32-inout.h"
# include "internal/emf-win32-print.h"
#endif
# include "internal/emf-inout.h"
# include "internal/emf-print.h"
#ifdef HAVE_CAIRO_PDF
# include "internal/cairo-renderer-pdf-out.h"
# include "internal/cairo-png-out.h"
......@@ -171,10 +169,8 @@ init()
Internal::PdfInputCairo::init();
}
#endif
#ifdef WIN32
Internal::PrintEmfWin32::init();
Internal::EmfWin32::init();
#endif
Internal::PrintEmf::init();
Internal::Emf::init();
Internal::PovOutput::init();
Internal::JavaFXOutput::init();
Internal::OdfOutput::init();
......@@ -308,7 +304,7 @@ build_module_from_dir(gchar const *dirname)
continue;
}
gchar *pathname = g_build_filename(dirname, filename, NULL);
gchar *pathname = g_build_filename(dirname, filename, (char *) NULL);
build_from_file(pathname);
g_free(pathname);
}
......
......@@ -133,10 +133,14 @@ ink_common_sources += \
extension/internal/filter/filter.h \
extension/internal/filter/drop-shadow.h \
extension/internal/filter/snow.h \
extension/internal/emf-win32-print.h \
extension/internal/emf-win32-print.cpp \
extension/internal/emf-win32-inout.h \
extension/internal/emf-win32-inout.cpp \
extension/internal/uemf.c \
extension/internal/uemf.h \
extension/internal/uemf_endian.c \
extension/internal/uemf_endian.h \
extension/internal/emf-print.h \
extension/internal/emf-print.cpp \
extension/internal/emf-inout.h \
extension/internal/emf-inout.cpp \
extension/internal/image-resolution.h \
extension/internal/image-resolution.cpp
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -8,9 +8,8 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_EXTENSION_INTERNAL_EMF_WIN32_H
#define SEEN_EXTENSION_INTERNAL_EMF_WIN32_H
#ifdef WIN32
#ifndef SEEN_EXTENSION_INTERNAL_EMF_H
#define SEEN_EXTENSION_INTERNAL_EMF_H
#include "extension/implementation/implementation.h"
......@@ -18,12 +17,12 @@ namespace Inkscape {
namespace Extension {
namespace Internal {
class EmfWin32 : Inkscape::Extension::Implementation::Implementation { //This is a derived class
class Emf : Inkscape::Extension::Implementation::Implementation { //This is a derived class
public:
EmfWin32(); // Empty constructor
Emf(); // Empty constructor
virtual ~EmfWin32();//Destructor
virtual ~Emf();//Destructor
bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now)
......@@ -41,9 +40,8 @@ private:
} } } /* namespace Inkscape, Extension, Implementation */
#endif /* WIN32 */
#endif /* EXTENSION_INTERNAL_EMF_WIN32_H */
#endif /* EXTENSION_INTERNAL_EMF_H */
/*
Local Variables:
......
This diff is collapsed.
......@@ -8,17 +8,15 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__
#define __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__
#ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_H__
#define __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_H__
#ifdef WIN32
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "uemf.h"
#include "extension/implementation/implementation.h"
//#include "extension/extension.h"
......@@ -31,36 +29,27 @@ namespace Inkscape {
namespace Extension {
namespace Internal {
class PrintEmfWin32 : public Inkscape::Extension::Implementation::Implementation
class PrintEmf : public Inkscape::Extension::Implementation::Implementation
{
double _width;
double _height;
HDC hdc;
RECT rc;
U_RECTL rc;
HBRUSH hbrush, hbrushOld;
HPEN hpen, hpenOld;
uint32_t hbrush, hbrushOld, hpen, hpenOld;
std::stack<Geom::Affine> m_tr_stack;
Geom::PathVector fill_pathv;
Geom::Affine fill_transform;
bool stroke_and_fill;
bool fill_only;
bool use_stroke;
bool use_fill;
bool simple_shape;
unsigned int print_pathv (Geom::PathVector const &pathv, const Geom::Affine &transform);
bool print_simple_shape (Geom::PathVector const &pathv, const Geom::Affine &transform);
unsigned int image(Inkscape::Extension::Print * /* module */, /** not used */
unsigned char *px, /** array of pixel values, Gdk::Pixbuf bitmap format */
unsigned int w, /** width of bitmap */
unsigned int h, /** height of bitmap */
unsigned int rs, /** row stride (normally w*4) */
Geom::Affine const &tf_ignore, /** WRONG affine transform, use the one from m_tr_stack */
SPStyle const *style); /** provides indirect link to image object */
public:
PrintEmfWin32 (void);
virtual ~PrintEmfWin32 (void);
PrintEmf (void);
virtual ~PrintEmf (void);
/* Print functions */
virtual unsigned int setup (Inkscape::Extension::Print * module);
......@@ -81,6 +70,13 @@ public:
Geom::Affine const &ctm, SPStyle const *style,
Geom::OptRect const &pbox, Geom::OptRect const &dbox,
Geom::OptRect const &bbox);
virtual unsigned int image(Inkscape::Extension::Print *module,
unsigned char *px,
unsigned int w,
unsigned int h,
unsigned int rs,
Geom::Affine const &transform,
SPStyle const *style);
virtual unsigned int comment(Inkscape::Extension::Print *module, const char * comment);
virtual unsigned int text(Inkscape::Extension::Print *module, char const *text,
Geom::Point const &p, SPStyle const *style);
......@@ -88,25 +84,22 @@ public:
static void init (void);
protected:
int create_brush(SPStyle const *style);
int create_brush(SPStyle const *style, PU_COLORREF fcolor);
void destroy_brush();
void create_pen(SPStyle const *style, const Geom::Affine &transform);
int create_pen(SPStyle const *style, const Geom::Affine &transform);
void destroy_pen();
void flush_fill();
};
} /* namespace Internal */
} /* namespace Extension */
} /* namespace Inkscape */
#endif /* WIN32 */
#endif /* __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_WIN32_H__ */
#endif /* __INKSCAPE_EXTENSION_INTERNAL_PRINT_EMF_H__ */
/*
Local Variables:
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
@file uemf_endian.h Prototype for function for converting EMF records between Big Endian and Little Endian
*/
/*
File: uemf_endian.h
Version: 0.0.3
Date: 24-JUL-2012
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2012 David Mathog and California Institute of Technology (Caltech)
*/
#ifndef _UEMF_ENDIAN_
#define _UEMF_ENDIAN_
#ifdef __cplusplus
extern "C" {
#endif
/* There is no way for the preprocessor, in general, to figure out endianness. So the command line must define
WORDS_BIGENDIAN for a big endian machine. Otherwise we assume is is little endian. If it is something
else this code won't work in any case. */
#ifdef WORDS_BIGENDIAN
#define U_BYTE_SWAP 1
#else
#define U_BYTE_SWAP 0
#endif
// prototypes
int U_emf_endian(char *contents, size_t length, int torev);
#ifdef __cplusplus
}
#endif
#endif /* _UEMF_ENDIAN_ */
This diff is collapsed.
/**
@file uemf_print.h Functions for printing records from EMF files.
*/
/*
File: uemf_print.h
Version: 0.0.3
Date: 24-JUL-2012
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2012 David Mathog and California Institute of Technology (Caltech)
*/
#ifndef _UEMF_PRINT_
#define _UEMF_PRINT_
#ifdef __cplusplus
extern "C" {
#endif
// prototypes
void U_EMRNOTIMPLEMENTED_print(char *name, char *contents, int recnum, int off);
void U_EMRHEADER_print(char *contents, int recnum, int off);
void U_EMRPOLYBEZIER_print(char *contents, int recnum, int off);
void U_EMRPOLYGON_print(char *contents, int recnum, int off);
void U_EMRPOLYLINE_print(char *contents, int recnum, int off);
void U_EMRPOLYBEZIERTO_print(char *contents, int recnum, int off);
void U_EMRPOLYLINETO_print(char *contents, int recnum, int off);
void U_EMRPOLYPOLYLINE_print(char *contents, int recnum, int off);
void U_EMRPOLYPOLYGON_print(char *contents, int recnum, int off);
void U_EMRSETWINDOWEXTEX_print(char *contents, int recnum, int off);
void U_EMRSETWINDOWORGEX_print(char *contents, int recnum, int off);
void U_EMRSETVIEWPORTEXTEX_print(char *contents, int recnum, int off);
void U_EMRSETVIEWPORTORGEX_print(char *contents, int recnum, int off);
void U_EMRSETBRUSHORGEX_print(char *contents, int recnum, int off);
void U_EMREOF_print(char *contents, int recnum, int off);
void U_EMRSETPIXELV_print(char *contents, int recnum, int off);
void U_EMRSETMAPPERFLAGS_print(char *contents, int recnum, int off);
void U_EMRSETMAPMODE_print(char *contents, int recnum, int off);
void U_EMRSETBKMODE_print(char *contents, int recnum, int off);
void U_EMRSETPOLYFILLMODE_print(char *contents, int recnum, int off);
void U_EMRSETROP2_print(char *contents, int recnum, int off);
void U_EMRSETSTRETCHBLTMODE_print(char *contents, int recnum, int off);
void U_EMRSETTEXTALIGN_print(char *contents, int recnum, int off);
void U_EMRSETCOLORADJUSTMENT_print(char *contents, int recnum, int off);
void U_EMRSETTEXTCOLOR_print(char *contents, int recnum, int off);
void U_EMRSETBKCOLOR_print(char *contents, int recnum, int off);
void U_EMROFFSETCLIPRGN_print(char *contents, int recnum, int off);
void U_EMRMOVETOEX_print(char *contents, int recnum, int off);
void U_EMRSETMETARGN_print(char *contents, int recnum, int off);
void U_EMREXCLUDECLIPRECT_print(char *contents, int recnum, int off);
void U_EMRINTERSECTCLIPRECT_print(char *contents, int recnum, int off);
void U_EMRSCALEVIEWPORTEXTEX_print(char *contents, int recnum, int off);
void U_EMRSCALEWINDOWEXTEX_print(char *contents, int recnum, int off);
void U_EMRSAVEDC_print(char *contents, int recnum, int off);
void U_EMRRESTOREDC_print(char *contents, int recnum, int off);
void U_EMRSETWORLDTRANSFORM_print(char *contents, int recnum, int off);
void U_EMRMODIFYWORLDTRANSFORM_print(char *contents, int recnum, int off);
void U_EMRSELECTOBJECT_print(char *contents, int recnum, int off);
void U_EMRCREATEPEN_print(char *contents, int recnum, int off);
void U_EMRCREATEBRUSHINDIRECT_print(char *contents, int recnum, int off);
void U_EMRDELETEOBJECT_print(char *contents, int recnum, int off);
void U_EMRANGLEARC_print(char *contents, int recnum, int off);
void U_EMRELLIPSE_print(char *contents, int recnum, int off);
void U_EMRRECTANGLE_print(char *contents, int recnum, int off);
void U_EMRROUNDRECT_print(char *contents, int recnum, int off);
void U_EMRARC_print(char *contents, int recnum, int off);
void U_EMRCHORD_print(char *contents, int recnum, int off);
void U_EMRPIE_print(char *contents, int recnum, int off);
void U_EMRSELECTPALETTE_print(char *contents, int recnum, int off);
void U_EMRCREATEPALETTE_print(char *contents, int recnum, int off);
void U_EMRSETPALETTEENTRIES_print(char *contents, int recnum, int off);
void U_EMRRESIZEPALETTE_print(char *contents, int recnum, int off);
void U_EMRREALIZEPALETTE_print(char *contents, int recnum, int off);
void U_EMREXTFLOODFILL_print(char *contents, int recnum, int off);
void U_EMRLINETO_print(char *contents, int recnum, int off);
void U_EMRARCTO_print(char *contents, int recnum, int off);
void U_EMRPOLYDRAW_print(char *contents, int recnum, int off);
void U_EMRSETARCDIRECTION_print(char *contents, int recnum, int off);
void U_EMRSETMITERLIMIT_print(char *contents, int recnum, int off);
void U_EMRBEGINPATH_print(char *contents, int recnum, int off);
void U_EMRENDPATH_print(char *contents, int recnum, int off);
void U_EMRCLOSEFIGURE_print(char *contents, int recnum, int off);
void U_EMRFILLPATH_print(char *contents, int recnum, int off);
void U_EMRSTROKEANDFILLPATH_print(char *contents, int recnum, int off);
void U_EMRSTROKEPATH_print(char *contents, int recnum, int off);
void U_EMRFLATTENPATH_print(char *contents, int recnum, int off);
void U_EMRWIDENPATH_print(char *contents, int recnum, int off);
void U_EMRSELECTCLIPPATH_print(char *contents, int recnum, int off);
void U_EMRABORTPATH_print(char *contents, int recnum, int off);
void U_EMRCOMMENT_print(char *contents, int recnum, int off);
void U_EMRFILLRGN_print(char *contents, int recnum, int off);
void U_EMRFRAMERGN_print(char *contents, int recnum, int off);
void U_EMRINVERTRGN_print(char *contents, int recnum, int off);
void U_EMRPAINTRGN_print(char *contents, int recnum, int off);
void U_EMREXTSELECTCLIPRGN_print(char *contents, int recnum, int off);
void U_EMRBITBLT_print(char *contents, int recnum, int off);
void U_EMRSTRETCHBLT_print(char *contents, int recnum, int off);
void U_EMRMASKBLT_print(char *contents, int recnum, int off);
void U_EMRPLGBLT_print(char *contents, int recnum, int off);
void U_EMRSETDIBITSTODEVICE_print(char *contents, int recnum, int off);
void U_EMRSTRETCHDIBITS_print(char *contents, int recnum, int off);
void U_EMREXTCREATEFONTINDIRECTW_print(char *contents, int recnum, int off);
void U_EMREXTTEXTOUTA_print(char *contents, int recnum, int off);
void U_EMREXTTEXTOUTW_print(char *contents, int recnum, int off);
void U_EMRPOLYBEZIER16_print(char *contents, int recnum, int off);
void U_EMRPOLYGON16_print(char *contents, int recnum, int off);
void U_EMRPOLYLINE16_print(char *contents, int recnum, int off);
void U_EMRPOLYBEZIERTO16_print(char *contents, int recnum, int off);
void U_EMRPOLYLINETO16_print(char *contents, int recnum, int off);
void U_EMRPOLYPOLYLINE16_print(char *contents, int recnum, int off);
void U_EMRPOLYPOLYGON16_print(char *contents, int recnum, int off);
void U_EMRPOLYDRAW16_print(char *contents, int recnum, int off);
void U_EMRCREATEMONOBRUSH_print(char *contents, int recnum, int off);
void U_EMRCREATEDIBPATTERNBRUSHPT_print(char *contents, int recnum, int off);
void U_EMREXTCREATEPEN_print(char *contents, int recnum, int off);
void U_EMRSETICMMODE_print(char *contents, int recnum, int off);
void U_EMRCREATECOLORSPACE_print(char *contents, int recnum, int off);
void U_EMRSETCOLORSPACE_print(char *contents, int recnum, int off);
void U_EMRDELETECOLORSPACE_print(char *contents, int recnum, int off);
void U_EMRPIXELFORMAT_print(char *contents, int recnum, int off);
void U_EMRSMALLTEXTOUT_print(char *contents, int recnum, int off);
void U_EMRALPHABLEND_print(char *contents, int recnum, int off);
void U_EMRSETLAYOUT_print(char *contents, int recnum, int off);
void U_EMRTRANSPARENTBLT_print(char *contents, int recnum, int off);
void U_EMRGRADIENTFILL_print(char *contents, int recnum, int off);
void U_EMRCREATECOLORSPACEW_print(char *contents, int recnum, int off);
int U_emf_onerec_print(char *contents, int recnum, int off);
#ifdef __cplusplus
}
#endif
#endif /* _UEMF_PRINT_ */
......@@ -20,6 +20,7 @@
#include "extension/internal/cairo-render-context.h"
#include "display/curve.h"
#include <2geom/pathvector.h>
#include "libunicode-convert/unicode-convert.h"
#if !PANGO_VERSION_CHECK(1,24,0)
#define PANGO_WEIGHT_THIN static_cast<PangoWeight>(100)
......@@ -43,6 +44,27 @@ using Inkscape::Extension::Internal::CairoGlyphInfo;
namespace Inkscape {
namespace Text {
// the dx array is smuggled through to the EMF (ignored by others) as:
// text<nul>N w1 w2 w3 ...wN<nul><nul>
// where the widths are floats 7 characters wide, including the space
char *smuggle_adx_in(const char *string, int ndx, int size, float *adx){
int slen=strlen(string);
// holds: string, fake terminator, Number of offsets, series of offsets, real (double) terminator.
int newsize=slen + 1 + 7 + 7*ndx + 2;
newsize = 8*((7 + newsize)/8); // suppress valgrind messages if it is a multiple of 8 bytes???
char *smuggle=(char *)calloc(newsize,1); //initialize all bytes, inluding terminators
strcpy(smuggle,string);
char *cptr = smuggle + slen + 1; // immediately after the first terminator
sprintf(cptr,"%07d",ndx);
cptr+=7;
for(int i=0; i<ndx ; i++){
if(i<size){ sprintf(cptr," %6f",adx[i]); }
else { sprintf(cptr," %6f",adx[0]); } //fill the rest with the width of the first character
cptr+=7;
}
return(smuggle);
}
void Layout::_clearOutputObjects()
{
_paragraphs.clear();
......@@ -134,10 +156,18 @@ void Layout::print(SPPrintContext *ctx,
Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox,
Geom::Affine const &ctm) const
{
int doUTN=0;
int lasttarget=0;
int newtarget=0;
#define MAX_DX 2048
float hold_dx[MAX_DX]; // For smuggling dx values into print functions, unlikely any simple text output will be longer than this.
int ndx=0;
if (_input_stream.empty()) return;
Direction block_progression = _blockProgression();
bool text_to_path = ctx->module->textToPath();
doUTN = CanUTN(); // Unicode to Nonunicode translation enabled if true
for (unsigned glyph_index = 0 ; glyph_index < _glyphs.size() ; ) {
if (_characters[_glyphs[glyph_index].in_character].in_glyph == -1) {
// invisible glyphs
......@@ -180,25 +210,49 @@ void Layout::print(SPPrintContext *ctx,
}
// try to output as many characters as possible in one go by detecting kerning and stopping when we encounter it
// also break spans at changes in Unicode->nonunicode translations, so that each span
// sent down from here is translated the same way. The translation happens much later
// in the emf-print code.
// Note that the incoming stream has a predefined notion of what is in each "span" and it is not
// entirely clear why. For instance, the string "%%% text %%%%", where % is the Unicode "Sagittarius"
// character has 3 spans, with the first two ending on the spaces. Yet in the XML there is only one tspan.
// Consequently when the Unicode->NonUnicode detection is on the first space will go out by itself,
// because it is at the end of a span, whereas the second space goes with the "text".
Glib::ustring span_string;
double char_x = _characters[_glyphs[glyph_index].in_character].x;
unsigned this_span_index = _characters[_glyphs[glyph_index].in_character].in_span;
if(doUTN)newtarget=lasttarget=SingleUnicodeToNon(*span_iter);
do {
span_string += *span_iter;
span_iter++;
if(doUTN)newtarget=SingleUnicodeToNon(*span_iter);
unsigned same_character = _glyphs[glyph_index].in_character;
while (glyph_index < _glyphs.size() && _glyphs[glyph_index].in_character == same_character) {
char_x += _glyphs[glyph_index].width;
if(ndx < MAX_DX){ hold_dx[ndx++] = _glyphs[glyph_index].width; }
glyph_index++;
}
} while (glyph_index < _glyphs.size()
&& _path_fitted == NULL
&& _characters[_glyphs[glyph_index].in_character].in_span == this_span_index
&& fabs(char_x - _characters[_glyphs[glyph_index].in_character].x) < 1e-4);
&& fabs(char_x - _characters[_glyphs[glyph_index].in_character].x) < 1e-4
&& (doUTN ? (lasttarget==newtarget ? 1 : 0) : 1 )
);
sp_print_bind(ctx, glyph_matrix, 1.0);
sp_print_text(ctx, span_string.c_str(), g_pos, text_source->style);
// the dx array is smuggled through to the EMF (ignored by others) as:
// text<nul>w1 w2 w3 ...wn<nul><nul>
// where the widths are floats 7 characters wide, including the space
char *smuggle_string=smuggle_adx_in(span_string.c_str(),ndx,MAX_DX, &hold_dx[0]);
// sp_print_text(ctx, span_string.c_str(), g_pos, text_source->style);
sp_print_text(ctx, smuggle_string, g_pos, text_source->style);
free(smuggle_string);
sp_print_release(ctx);
ndx=0;
}
}
}
......
......@@ -178,12 +178,17 @@ struct SPIPaint {
void read( gchar const *str, SPStyle &tyle, SPDocument *document = 0);
// Win32 is a temp work-around until the emf extension is fixed:
#ifndef WIN32
/* EMF_DRIVER is a temp work-around
The problem is that SPIPaint is private, but is included in the SPStyle struct, and that is needed in emf-inout.cpp, but the compiler
won't accept it there. If the two conditional lines are moved out of the "private" they end up generating undefined reference
errors.
*/
private:
#ifndef EMF_DRIVER
SPIPaint(SPIPaint const&);
SPIPaint &operator=(SPIPaint const &);
#endif // WIN32
#endif // EMF_DRIVER
};
/// Filter type internal to SPStyle
......
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