53#define PRINT_EMF "org.inkscape.print.emf"
56#define U_PS_JOIN_MASK (U_PS_JOIN_BEVEL|U_PS_JOIN_MITER|U_PS_JOIN_ROUND)
93 const gchar *oldconst;
100 oldconst =
mod->get_param_string(
"destination");
101 oldoutput = g_strdup(oldconst);
102 mod->set_param_string(
"destination", filename);
111 mod->root =
mod->base->invoke_show(drawing,
mod->dkey, SP_ITEM_SHOW_DISPLAY);
114 ret =
mod->begin(doc);
119 mod->base->invoke_print(&context);
120 (void)
mod->finish();
122 mod->base->invoke_hide(
mod->dkey);
127 mod->set_param_string(
"destination", oldoutput);
143 bool new_val =
mod->get_param_bool(
"textToPath");
144 bool new_FixPPTCharPos =
mod->get_param_bool(
"FixPPTCharPos");
146 bool new_FixPPTDashLine =
mod->get_param_bool(
"FixPPTDashLine");
147 bool new_FixPPTGrad2Polys =
mod->get_param_bool(
"FixPPTGrad2Polys");
148 bool new_FixPPTLinGrad =
mod->get_param_bool(
"FixPPTLinGrad");
149 bool new_FixPPTPatternAsHatch =
mod->get_param_bool(
"FixPPTPatternAsHatch");
150 bool new_FixImageRot =
mod->get_param_bool(
"FixImageRot");
153 mod->get_param_bool(
"TnrToSymbol"),
154 mod->get_param_bool(
"TnrToWingdings"),
155 mod->get_param_bool(
"TnrToZapfDingbats"),
156 mod->get_param_bool(
"UsePUA")
163 ext->
set_param_bool(
"FixPPTPatternAsHatch",new_FixPPTPatternAsHatch);
168 char *oldlocale = g_strdup(setlocale(LC_NUMERIC,
nullptr));
169 setlocale(LC_NUMERIC,
"C");
174 setlocale(LC_NUMERIC, oldlocale);
200 cxform <<
"\"matrix(";
209 cxform << x - newx; cxform <<
",";
216 return(cxform.
str());
255 case U_HS_SOLIDTEXTCLR:
256 case U_HS_DITHEREDTEXTCLR:
259 case U_HS_SOLIDBKCLR:
260 case U_HS_DITHEREDBKCLR:
264 safeprintf(tmpcolor,
"%6.6X",
sethexcolor(hatchColor));
272 safeprintf(hpathname,
"EMFhpath%d_%s",hatchType,tmpcolor);
274 auto & defs = d->
defs;
281 case U_HS_HORIZONTAL:
282 defs +=
" <path id=\"";
284 defs +=
"\" d=\"M 0 0 6 0\" style=\"fill:none;stroke:#";
289 defs +=
" <path id=\"";
291 defs +=
"\" d=\"M 0 0 0 6\" style=\"fill:none;stroke:#";
296 defs +=
" <line id=\"sub";
298 defs +=
"\" x1=\"-1\" y1=\"-1\" x2=\"7\" y2=\"7\" stroke=\"#";
303 defs +=
" <line id=\"sub";
305 defs +=
"\" x1=\"-1\" y1=\"7\" x2=\"7\" y2=\"-1\" stroke=\"#";
310 defs +=
" <path id=\"";
312 defs +=
"\" d=\"M 0 0 6 0 M 0 0 0 6\" style=\"fill:none;stroke:#";
317 defs +=
" <line id=\"subfd";
319 defs +=
"\" x1=\"-1\" y1=\"-1\" x2=\"7\" y2=\"7\" stroke=\"#";
322 defs +=
" <line id=\"subbd";
324 defs +=
"\" x1=\"-1\" y1=\"7\" x2=\"7\" y2=\"-1\" stroke=\"#";
329 case U_HS_DITHEREDCLR:
330 case U_HS_SOLIDTEXTCLR:
331 case U_HS_DITHEREDTEXTCLR:
332 case U_HS_SOLIDBKCLR:
333 case U_HS_DITHEREDBKCLR:
335 defs +=
" <path id=\"";
337 defs +=
"\" d=\"M 0 0 6 0 6 6 0 6 z\" style=\"fill:#";
339 defs +=
";stroke:none";
347 case U_HS_HORIZONTAL:
351 case U_HS_DITHEREDCLR:
352 case U_HS_SOLIDTEXTCLR:
353 case U_HS_DITHEREDTEXTCLR:
354 case U_HS_SOLIDBKCLR:
355 case U_HS_DITHEREDBKCLR:
357 refpath +=
" <use xlink:href=\"#";
358 refpath += hpathname;
359 refpath +=
"\" />\n";
363 refpath +=
" <use xlink:href=\"#sub";
364 refpath += hpathname;
365 refpath +=
"\" />\n";
366 refpath +=
" <use xlink:href=\"#sub";
367 refpath += hpathname;
368 refpath +=
"\" transform=\"translate(6,0)\" />\n";
369 refpath +=
" <use xlink:href=\"#sub";
370 refpath += hpathname;
371 refpath +=
"\" transform=\"translate(-6,0)\" />\n";
374 refpath +=
" <use xlink:href=\"#subfd";
375 refpath += hpathname;
376 refpath +=
"\" />\n";
377 refpath +=
" <use xlink:href=\"#subfd";
378 refpath += hpathname;
379 refpath +=
"\" transform=\"translate(6,0)\"/>\n";
380 refpath +=
" <use xlink:href=\"#subfd";
381 refpath += hpathname;
382 refpath +=
"\" transform=\"translate(-6,0)\"/>\n";
383 refpath +=
" <use xlink:href=\"#subbd";
384 refpath += hpathname;
385 refpath +=
"\" />\n";
386 refpath +=
" <use xlink:href=\"#subbd";
387 refpath += hpathname;
388 refpath +=
"\" transform=\"translate(6,0)\"/>\n";
389 refpath +=
" <use xlink:href=\"#subbd";
390 refpath += hpathname;
391 refpath +=
"\" transform=\"translate(-6,0)\"/>\n";
395 if(d->
dc[d->
level].
bkMode == U_TRANSPARENT || hatchType >= U_HS_SOLIDCLR){
396 safeprintf(hatchname,
"EMFhatch%d_%s",hatchType,tmpcolor);
397 safeprintf(hpathname,
"EMFhpath%d_%s",hatchType,tmpcolor);
403 defs +=
" <pattern id=\"";
405 defs +=
"\" xlink:href=\"#EMFhbasepattern\">\n";
407 defs +=
" </pattern>\n";
414 safeprintf(hbkname,
"EMFhbkclr_%s",bkcolor);
421 defs +=
" <rect id=\"";
423 defs +=
"\" x=\"0\" y=\"0\" width=\"6\" height=\"6\" fill=\"#";
429 safeprintf(hatchname,
"EMFhatch%d_%s_%s",hatchType,tmpcolor,bkcolor);
435 defs +=
" <pattern id=\"";
437 defs +=
"\" xlink:href=\"#EMFhbasepattern\">\n";
438 defs +=
" <use xlink:href=\"#";
442 defs +=
" </pattern>\n";
473 uint32_t iUsage, uint32_t offBits, uint32_t offBmi){
479 int dibparams = U_BI_UNKNOWN;
484 char *rgba_px =
nullptr;
485 const char *px =
nullptr;
489 if(cbBits && cbBmi && (iUsage == U_DIB_RGB_COLORS)){
491 dibparams = get_DIB_params((
const char *)pEmr, offBits, offBmi, &px, (
const U_RGBQUAD **) &ct,
493 if(dibparams ==U_BI_RGB){
495 if(((
PU_EMR)pEmr)->iType == U_EMR_CREATEMONOBRUSH){
502 return(U_EMR_INVALID);
527 gchar *base64String=
nullptr;
528 if(dibparams == U_BI_JPEG || dibparams==U_BI_PNG){
529 base64String = g_base64_encode((guchar*) px, numCt );
532 base64String = g_base64_encode((guchar*) mempng.
buffer, mempng.
size );
541 idx =
in_images(d, (
char *) base64String);
542 auto & defs = d->
defs;
548 safeprintf(imagename,
"EMFimage%d",idx++);
549 safeprintf(xywh,
" x=\"0\" y=\"0\" width=\"%d\" height=\"%d\" ",
width,
height);
552 defs +=
" <image id=\"";
557 if(dibparams == U_BI_JPEG){ defs +=
" xlink:href=\"data:image/jpeg;base64,"; }
558 else { defs +=
" xlink:href=\"data:image/png;base64,"; }
559 defs += base64String;
561 defs +=
" preserveAspectRatio=\"none\"\n";
566 defs +=
" <pattern id=\"";
570 defs +=
"\n patternUnits=\"userSpaceOnUse\"";
572 defs +=
" <use id=\"";
575 defs +=
" xlink:href=\"#";
579 defs +=
" </pattern>\n";
581 g_free(base64String);
594 safeprintf(imrotname,
"EMFrotimage%d_%d",idx-1,tangle);
595 base64String = g_base64_encode((guchar*) imrotname, strlen(imrotname) );
596 idx =
in_images(d, (
char *) base64String);
601 safeprintf(imrotname,
"EMFimage%d",idx++);
604 defs +=
" <pattern\n";
608 defs +=
" xlink:href=\"#";
611 defs +=
" patternTransform=";
615 g_free(base64String);
663 safeprintf(tmpcolor1,
"%6.6X",
sethexcolor(gradientColor1));
664 safeprintf(tmpcolor2,
"%6.6X",
sethexcolor(gradientColor2));
665 switch(gradientType){
666 case U_GRADIENT_FILL_RECT_H:
671 case U_GRADIENT_FILL_RECT_V:
688 safeprintf(hgradname,
"LinGrd%c_%s_%s_%d",gradc,tmpcolor1,tmpcolor2,tangle);
696 stmp <<
" <linearGradient id=\"";
713 stmp <<
"\" gradientTransform=\"(1,0,0,1,0,0)\"";
714 stmp <<
" gradientUnits=\"userSpaceOnUse\"\n";
716 stmp <<
" <stop offset=\"0\" style=\"stop-color:#";
718 stmp <<
";stop-opacity:1\" />\n";
719 stmp <<
" <stop offset=\"1\" style=\"stop-color:#";
721 stmp <<
";stop-opacity:1\" />\n";
722 stmp <<
" </linearGradient>\n";
753 std::string combined;
765 uint32_t idx =
in_clips(d, combined.c_str());
771 tmp_clippath <<
"\n<clipPath";
772 tmp_clippath <<
"\n\tclipPathUnits=\"userSpaceOnUse\" ";
773 tmp_clippath <<
"\n\tid=\"clipEmfPath" << d->
dc[d->
level].
clip_id <<
"\"";
774 tmp_clippath <<
" >";
775 tmp_clippath <<
"\n\t<path d=\"";
776 tmp_clippath << combined;
777 tmp_clippath <<
"\"";
778 tmp_clippath <<
"\n\t/>";
779 tmp_clippath <<
"\n</clipPath>";
794 char tmp[1024] = {0};
806 fill_rgb[0] = 1.0 - fill_rgb[0];
807 fill_rgb[1] = 1.0 - fill_rgb[1];
808 fill_rgb[2] = 1.0 - fill_rgb[2];
815 fill_rgb[0]=fill_rgb[1]=fill_rgb[2]=0.0;
820 fill_rgb[0]=fill_rgb[1]=fill_rgb[2]=1.0;
840 fill_rgb[0] = fill_rgb[1] = fill_rgb[2] = 0.0;
841 stroke_rgb[0]= stroke_rgb[1]= stroke_rgb[2] = 0.0;
843 case U_R2_NOTMERGEPEN:
844 case U_R2_MASKNOTPEN:
846 case U_R2_NOTCOPYPEN:
847 fill_rgb[0] = 1.0 - fill_rgb[0];
848 fill_rgb[1] = 1.0 - fill_rgb[1];
849 fill_rgb[2] = 1.0 - fill_rgb[2];
850 stroke_rgb[0] = 1.0 - stroke_rgb[0];
851 stroke_rgb[1] = 1.0 - stroke_rgb[1];
852 stroke_rgb[2] = 1.0 - stroke_rgb[2];
854 case U_R2_MASKPENNOT:
857 case U_R2_NOTMASKPEN:
860 case U_R2_MERGENOTPEN:
863 case U_R2_MERGEPENNOT:
867 fill_rgb[0] = fill_rgb[1] = fill_rgb[2] = 1.0;
868 stroke_rgb[0]= stroke_rgb[1]= stroke_rgb[2] = 1.0;
877 d->
outsvg +=
"\n\tstyle=\"";
879 tmp_style <<
"fill:none;";
888 snprintf(tmp, 1023,
"fill:url(#EMFimage%d_ref); ",d->
dc[d->
level].
fill_idx);
896 "fill:#%02x%02x%02x;",
897 SP_COLOR_F_TO_U(fill_rgb[0]),
898 SP_COLOR_F_TO_U(fill_rgb[1]),
899 SP_COLOR_F_TO_U(fill_rgb[2])
910 tmp_style <<
"fill-opacity:1;";
921 (fill_rgb[0]==stroke_rgb[0]) &&
922 (fill_rgb[1]==stroke_rgb[1]) &&
923 (fill_rgb[2]==stroke_rgb[2])
932 tmp_style <<
"stroke:none;";
949 "stroke:#%02x%02x%02x;",
950 SP_COLOR_F_TO_U(stroke_rgb[0]),
951 SP_COLOR_F_TO_U(stroke_rgb[1]),
952 SP_COLOR_F_TO_U(stroke_rgb[2])
957 tmp_style <<
"stroke-width:" <<
960 tmp_style <<
"stroke-linecap:" <<
968 tmp_style <<
"stroke-linejoin:" <<
977 tmp_style <<
"stroke-miterlimit:" <<
983 tmp_style <<
"stroke-dasharray:";
990 tmp_style <<
"stroke-dashoffset:0;";
992 tmp_style <<
"stroke-dasharray:none;";
994 tmp_style <<
"stroke-opacity:1;";
998 tmp_style <<
"\n\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\" ";
1076 return(cxform.
str());
1085 if (index >= 0 && index < d->n_obj){
1089 if (!pEmr){
return; }
1095 case U_PS_DASHDOTDOT:
1103 if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1109 if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1113 if (penstyle==U_PS_DASHDOTDOT) {
1133 case U_PS_ENDCAP_FLAT:
1140 case U_PS_JOIN_ROUND:
1150 int cur_level = d->
level;
1153 d->
level = cur_level;
1157 int cur_level = d->
level;
1160 d->
level = cur_level;
1177 if (index >= 0 && index < d->n_obj)
1184 case U_PS_USERSTYLE:
1205 case U_PS_DASHDOTDOT:
1213 if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1219 if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1225 if (penstyle==U_PS_DASHDOTDOT) {
1250 case U_PS_ENDCAP_ROUND:
1255 case U_PS_ENDCAP_SQUARE:
1260 case U_PS_ENDCAP_FLAT:
1269 case U_PS_JOIN_BEVEL:
1274 case U_PS_JOIN_MITER:
1279 case U_PS_JOIN_ROUND:
1301 int cur_level = d->
level;
1304 d->
level = cur_level;
1308 int cur_level = d->
level;
1311 d->
level = cur_level;
1317 r = SP_COLOR_U_TO_F( U_RGBAGetR(pEmr->
elp.
elpColor) );
1318 g = SP_COLOR_U_TO_F( U_RGBAGetG(pEmr->
elp.
elpColor) );
1319 b = SP_COLOR_U_TO_F( U_RGBAGetB(pEmr->
elp.
elpColor) );
1354 if (index >= 0 && index < d->n_obj){
1356 if(iType == U_EMR_CREATEBRUSHINDIRECT){
1360 r = SP_COLOR_U_TO_F( U_RGBAGetR(pEmr->
lb.
lbColor) );
1361 g = SP_COLOR_U_TO_F( U_RGBAGetG(pEmr->
lb.
lbColor) );
1362 b = SP_COLOR_U_TO_F( U_RGBAGetB(pEmr->
lb.
lbColor) );
1367 else if(pEmr->
lb.
lbStyle == U_BS_HATCHED){
1374 else if(iType == U_EMR_CREATEDIBPATTERNBRUSHPT || iType == U_EMR_CREATEMONOBRUSH){
1377 if(tidx == U_EMR_INVALID){
1400 if (index >= 0 && index < d->n_obj)
1410 int cur_level = d->
level;
1418 font_size = round(20.0 * 0.8 * font_size)/(20.0 * 0.8);
1419 d->
level = cur_level;
1459 if (index >= 0 && index < d->n_obj) {
1475 if (index >= 0 && index < d->n_obj) {
1491 char *
string =
nullptr;
1495 (0==strcmp(
"Adobe Systems",
string)) &&
1496 (nEmr->
emr.
iType == U_EMR_SETMAPMODE) &&
1497 (nEmr->
iMode == U_MM_ANISOTROPIC)){ ret=1; }
1508 uint32_t *res = (uint32_t *) malloc(
sizeof(uint32_t) * (count + 1));
1509 if(!res)
throw "Inkscape fatal memory allocation error - cannot continue";
1510 for(uint32_t i=0; i<count; i++){ res[i] = 0xFFFD; }
1532 double dx,
double dy,
double dw,
double dh,
int sx,
int sy,
int sw,
int sh,
1533 uint32_t iUsage, uint32_t offBits, uint32_t cbBits, uint32_t offBmi, uint32_t cbBmi){
1536 int dibparams = U_BI_UNKNOWN;
1538 tmp_image <<
"\n\t <image\n";
1540 tmp_image <<
"\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n";
1542 tmp_image <<
" y=\"" << dy <<
"\"\n x=\"" <<
dx <<
"\"\n ";
1547 char *rgba_px =
nullptr;
1548 char *sub_px =
nullptr;
1549 const char *px =
nullptr;
1552 if(cbBits && cbBmi && (iUsage == U_DIB_RGB_COLORS)){
1554 dibparams = get_DIB_params((
const char *)pEmr, offBits, offBmi, &px, (
const U_RGBQUAD **) &ct,
1556 if(dibparams ==U_BI_RGB){
1557 if(sw == 0 || sh == 0){
1573 sub_px = RGBA_to_RGBA(
1581 if(!sub_px)sub_px=rgba_px;
1592 gchar *base64String=
nullptr;
1593 if(dibparams == U_BI_JPEG){
1594 tmp_image <<
" xlink:href=\"data:image/jpeg;base64,";
1595 base64String = g_base64_encode((guchar*) px, numCt );
1597 else if(dibparams==U_BI_PNG){
1598 tmp_image <<
" xlink:href=\"data:image/png;base64,";
1599 base64String = g_base64_encode((guchar*) px, numCt );
1602 tmp_image <<
" xlink:href=\"data:image/png;base64,";
1603 base64String = g_base64_encode((guchar*) mempng.
buffer, mempng.
size );
1607 tmp_image <<
" xlink:href=\"data:image/png;base64,";
1610 tmp_image << base64String;
1611 g_free(base64String);
1613 tmp_image <<
"\"\n height=\"" << dh <<
"\"\n width=\"" << dw <<
"\"\n";
1616 tmp_image <<
" preserveAspectRatio=\"none\"\n";
1617 tmp_image <<
"/> \n";
1638 const char *blimit = contents +
length;
1641 uint32_t tbkMode = U_TRANSPARENT;
1648 char const* eDbgString = getenv(
"INKSCAPE_DBG_EMF" );
1649 if ( eDbgString !=
nullptr ) {
1650 if(strstr(eDbgString,
"RECORD")){ eDbgRecord = 1; }
1651 if(strstr(eDbgString,
"COMMENT")){ eDbgComment = 1; }
1652 if(strstr(eDbgString,
"FINAL")){ eDbgFinal = 1; }
1663 tsp.
taln = ALILEFT + ALIBASE;
1682 if (!U_emf_record_sizeok(contents +
off, blimit, &nSize, &iType, 1) ||
1687 emr_mask = emr_properties(iType);
1688 if (emr_mask == U_EMR_INVALID) { badrec = 1; }
1700 std::cout <<
"record type: " << iType <<
" name " << U_emr_names(iType) <<
" length: " << nSize <<
" offset: " <<
off <<std::endl;
1715 if ((d->
dc[d->
level].
dirty & DIRTY_TEXT) || ((emr_mask != U_EMR_INVALID) && (emr_mask & U_DRAW_TEXT) && d->
tri->
dirty)){
1719 tmp_clip <<
"\n<g\n\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n>";
1770 (emr_mask != U_EMR_INVALID) &&
1771 (d->
mask & U_DRAW_VISIBLE) &&
1773 (d->
mask & U_DRAW_FORCE) ||
1774 (emr_mask & U_DRAW_ALTERS) ||
1776 (emr_mask & U_DRAW_VISIBLE) &&
1778 ( !(d->
mask & U_DRAW_ONLYTO) ) ||
1779 ((d->
mask & U_DRAW_ONLYTO) && !(emr_mask & U_DRAW_ONLYTO) )
1785 if(!(d->
path.empty())){
1790 else if(d->
mask & U_DRAW_CLOSED){
1799 d->
outsvg +=
" \" /> \n";
1812 dbg_str <<
"<!-- U_EMR_HEADER -->\n";
1814 d->
outdef +=
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
1824 tmp_outdef <<
"<svg\n";
1825 tmp_outdef <<
" xmlns:svg=\"http://www.w3.org/2000/svg\"\n";
1826 tmp_outdef <<
" xmlns=\"http://www.w3.org/2000/svg\"\n";
1827 tmp_outdef <<
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n";
1828 tmp_outdef <<
" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n";
1829 tmp_outdef <<
" version=\"1.0\"\n";
1878 " width=\"" << d->
MMX <<
"mm\"\n" <<
1879 " height=\"" << d->
MMY <<
"mm\">\n";
1885 tmp_outsvg <<
"\n</defs>\n\n";
1895 for(
int i=0; i < d->
n_obj; ++i )
1905 case U_EMR_POLYBEZIER:
1907 dbg_str <<
"<!-- U_EMR_POLYBEZIER -->\n";
1915 d->
mask |= emr_mask;
1921 for (i=1; i<pEmr->
cptl; ) {
1922 tmp_str <<
"\n\tC ";
1923 for (j=0; j<3 && i<pEmr->
cptl; j++,i++) {
1928 tmp_path << tmp_str.
str().c_str();
1934 dbg_str <<
"<!-- U_EMR_POLYGON -->\n";
1942 d->
mask |= emr_mask;
1948 for (i=1; i<pEmr->
cptl; i++) {
1954 tmp_path << tmp_str.
str().c_str();
1959 case U_EMR_POLYLINE:
1961 dbg_str <<
"<!-- U_EMR_POLYLINE -->\n";
1969 d->
mask |= emr_mask;
1975 for (i=1; i<pEmr->
cptl; i++) {
1981 tmp_path << tmp_str.
str().c_str();
1985 case U_EMR_POLYBEZIERTO:
1987 dbg_str <<
"<!-- U_EMR_POLYBEZIERTO -->\n";
1992 d->
mask |= emr_mask;
1994 for (i=0; i<pEmr->
cptl;) {
1995 tmp_path <<
"\n\tC ";
1996 for (j=0; j<3 && i<pEmr->
cptl; j++,i++) {
2004 case U_EMR_POLYLINETO:
2006 dbg_str <<
"<!-- U_EMR_POLYLINETO -->\n";
2011 d->
mask |= emr_mask;
2013 for (i=0; i<pEmr->
cptl;i++) {
2021 case U_EMR_POLYPOLYLINE:
2022 case U_EMR_POLYPOLYGON:
2024 if (lpEMFR->
iType == U_EMR_POLYPOLYLINE)
2025 dbg_str <<
"<!-- U_EMR_POLYPOLYLINE -->\n";
2026 if (lpEMFR->
iType == U_EMR_POLYPOLYGON)
2027 dbg_str <<
"<!-- U_EMR_POLYPOLYGON -->\n";
2030 unsigned int n, i, j;
2032 d->
mask |= emr_mask;
2040 poly_path <<
"\n\tM " <<
pix_to_xy( d, aptl[i].x, aptl[i].y) <<
" ";
2044 poly_path <<
"\n\tL " <<
pix_to_xy( d, aptl[i].x, aptl[i].y) <<
" ";
2048 tmp_str << poly_path.
str().c_str();
2049 if (lpEMFR->
iType == U_EMR_POLYPOLYGON)
2054 tmp_path << tmp_str.
str().c_str();
2058 case U_EMR_SETWINDOWEXTEX:
2060 dbg_str <<
"<!-- U_EMR_SETWINDOWEXTEX -->\n";
2093 case U_EMR_SETWINDOWORGEX:
2095 dbg_str <<
"<!-- U_EMR_SETWINDOWORGEX -->\n";
2101 case U_EMR_SETVIEWPORTEXTEX:
2103 dbg_str <<
"<!-- U_EMR_SETVIEWPORTEXTEX -->\n";
2136 case U_EMR_SETVIEWPORTORGEX:
2138 dbg_str <<
"<!-- U_EMR_SETVIEWPORTORGEX -->\n";
2144 case U_EMR_SETBRUSHORGEX: dbg_str <<
"<!-- U_EMR_SETBRUSHORGEX -->\n";
break;
2147 dbg_str <<
"<!-- U_EMR_EOF -->\n";
2149 tmp_outsvg <<
"</svg>\n";
2154 case U_EMR_SETPIXELV: dbg_str <<
"<!-- U_EMR_SETPIXELV -->\n";
break;
2155 case U_EMR_SETMAPPERFLAGS: dbg_str <<
"<!-- U_EMR_SETMAPPERFLAGS -->\n";
break;
2156 case U_EMR_SETMAPMODE:
2158 dbg_str <<
"<!-- U_EMR_SETMAPMODE -->\n";
2160 switch (pEmr->
iMode){
2170 case U_MM_LOENGLISH:
2171 case U_MM_HIENGLISH:
2176 case U_MM_ISOTROPIC:
2177 case U_MM_ANISOTROPIC:
2182 case U_EMR_SETBKMODE:
2184 dbg_str <<
"<!-- U_EMR_SETBKMODE -->\n";
2186 tbkMode = pEmr->
iMode;
2197 case U_EMR_SETPOLYFILLMODE:
2199 dbg_str <<
"<!-- U_EMR_SETPOLYFILLMODE -->\n";
2203 (pEmr->
iMode == U_ALTERNATE
2210 dbg_str <<
"<!-- U_EMR_SETROP2 -->\n";
2215 case U_EMR_SETSTRETCHBLTMODE:
2219 dbg_str <<
"<!-- U_EMR_SETSTRETCHBLTMODE -->\n";
2222 case U_EMR_SETTEXTALIGN:
2224 dbg_str <<
"<!-- U_EMR_SETTEXTALIGN -->\n";
2230 case U_EMR_SETCOLORADJUSTMENT:
2231 dbg_str <<
"<!-- U_EMR_SETCOLORADJUSTMENT -->\n";
2233 case U_EMR_SETTEXTCOLOR:
2235 dbg_str <<
"<!-- U_EMR_SETTEXTCOLOR -->\n";
2246 case U_EMR_SETBKCOLOR:
2248 dbg_str <<
"<!-- U_EMR_SETBKCOLOR -->\n";
2260 case U_EMR_OFFSETCLIPRGN:
2262 dbg_str <<
"<!-- U_EMR_OFFSETCLIPRGN -->\n";
2276 case U_EMR_MOVETOEX:
2278 dbg_str <<
"<!-- U_EMR_MOVETOEX -->\n";
2282 d->
mask |= emr_mask;
2290 case U_EMR_SETMETARGN: dbg_str <<
"<!-- U_EMR_SETMETARGN -->\n";
break;
2291 case U_EMR_EXCLUDECLIPRECT:
2293 dbg_str <<
"<!-- U_EMR_EXCLUDECLIPRECT -->\n";
2306 tmp_path <<
"M " <<
pix_to_xy( d,
rc.left ,
rc.top ) <<
" ";
2307 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.top ) <<
" ";
2308 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.bottom ) <<
" ";
2309 tmp_path <<
"L " <<
pix_to_xy( d,
rc.left,
rc.bottom ) <<
" ";
2318 case U_EMR_INTERSECTCLIPRECT:
2320 dbg_str <<
"<!-- U_EMR_INTERSECTCLIPRECT -->\n";
2326 tmp_path <<
"M " <<
pix_to_xy( d,
rc.left ,
rc.top ) <<
" ";
2327 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.top ) <<
" ";
2328 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.bottom ) <<
" ";
2329 tmp_path <<
"L " <<
pix_to_xy( d,
rc.left,
rc.bottom ) <<
" ";
2338 case U_EMR_SCALEVIEWPORTEXTEX: dbg_str <<
"<!-- U_EMR_SCALEVIEWPORTEXTEX -->\n";
break;
2339 case U_EMR_SCALEWINDOWEXTEX: dbg_str <<
"<!-- U_EMR_SCALEWINDOWEXTEX -->\n";
break;
2341 dbg_str <<
"<!-- U_EMR_SAVEDC -->\n";
2343 if (d->
level < EMF_MAX_DC) {
2351 case U_EMR_RESTOREDC:
2353 dbg_str <<
"<!-- U_EMR_RESTOREDC -->\n";
2356 int old_level = d->
level;
2365 while (old_level > d->
level) {
2379 case U_EMR_SETWORLDTRANSFORM:
2381 dbg_str <<
"<!-- U_EMR_SETWORLDTRANSFORM -->\n";
2387 case U_EMR_MODIFYWORLDTRANSFORM:
2389 dbg_str <<
"<!-- U_EMR_MODIFYWORLDTRANSFORM -->\n";
2392 switch (pEmr->
iMode)
2394 case U_MWT_IDENTITY:
2402 case U_MWT_LEFTMULTIPLY:
2426 float c11 = a11*b11 + a12*b21 + a13*b31;;
2427 float c12 = a11*b12 + a12*b22 + a13*b32;;
2429 float c21 = a21*b11 + a22*b21 + a23*b31;;
2430 float c22 = a21*b12 + a22*b22 + a23*b32;;
2432 float c31 = a31*b11 + a32*b21 + a33*b31;;
2433 float c32 = a31*b12 + a32*b22 + a33*b32;;
2445 case U_MWT_RIGHTMULTIPLY:
2469 float c11 = a11*b11 + a12*b21 + a13*b31;;
2470 float c12 = a11*b12 + a12*b22 + a13*b32;;
2472 float c21 = a21*b11 + a22*b21 + a23*b31;;
2473 float c22 = a21*b12 + a22*b22 + a23*b32;;
2475 float c31 = a31*b11 + a32*b21 + a33*b31;;
2476 float c32 = a31*b12 + a32*b22 + a33*b32;;
2495 case U_EMR_SELECTOBJECT:
2497 dbg_str <<
"<!-- U_EMR_SELECTOBJECT -->\n";
2500 unsigned int index = pEmr->
ihObject;
2502 if (index & U_STOCK_OBJECT) {
2509 case U_DKGRAY_BRUSH:
2511 case U_LTGRAY_BRUSH:
2519 case U_DKGRAY_BRUSH:
2523 val = 128.0 / 255.0;
2525 case U_LTGRAY_BRUSH:
2526 val = 192.0 / 255.0;
2529 val = 255.0 / 255.0;
2545 float val = index == U_BLACK_PEN ? 0 : 1;
2557 if ( index < (
unsigned int) d->
n_obj) {
2560 case U_EMR_CREATEPEN:
2563 case U_EMR_CREATEBRUSHINDIRECT:
2564 case U_EMR_CREATEDIBPATTERNBRUSHPT:
2565 case U_EMR_CREATEMONOBRUSH:
2568 case U_EMR_EXTCREATEPEN:
2571 case U_EMR_EXTCREATEFONTINDIRECTW:
2579 case U_EMR_CREATEPEN:
2581 dbg_str <<
"<!-- U_EMR_CREATEPEN -->\n";
2587 case U_EMR_CREATEBRUSHINDIRECT:
2589 dbg_str <<
"<!-- U_EMR_CREATEBRUSHINDIRECT -->\n";
2595 case U_EMR_DELETEOBJECT:
2596 dbg_str <<
"<!-- U_EMR_DELETEOBJECT -->\n";
2599 case U_EMR_ANGLEARC:
2600 dbg_str <<
"<!-- U_EMR_ANGLEARC -->\n";
2604 dbg_str <<
"<!-- U_EMR_ELLIPSE -->\n";
2615 tmp_ellipse <<
"cx=\"" << cx <<
"\" ";
2616 tmp_ellipse <<
"cy=\"" << cy <<
"\" ";
2617 tmp_ellipse <<
"rx=\"" << rx <<
"\" ";
2618 tmp_ellipse <<
"ry=\"" << ry <<
"\" ";
2620 d->
mask |= emr_mask;
2622 d->
outsvg +=
" <ellipse ";
2630 case U_EMR_RECTANGLE:
2632 dbg_str <<
"<!-- U_EMR_RECTANGLE -->\n";
2638 tmp_rectangle <<
"\n\tM " <<
pix_to_xy( d,
rc.left ,
rc.top ) <<
" ";
2639 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
rc.right,
rc.top ) <<
" ";
2640 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
rc.right,
rc.bottom ) <<
" ";
2641 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
rc.left,
rc.bottom ) <<
" ";
2642 tmp_rectangle <<
"\n\tz";
2644 d->
mask |= emr_mask;
2646 tmp_path << tmp_rectangle.
str().c_str();
2649 case U_EMR_ROUNDRECT:
2651 dbg_str <<
"<!-- U_EMR_ROUNDRECT -->\n";
2656 double f = 4.*(
sqrt(2) - 1)/3;
2657 double f1 = 1.0 - f;
2658 double cnx = corner.
cx/2;
2659 double cny = corner.
cy/2;
2663 tmp_rectangle <<
"\n"
2667 tmp_rectangle <<
" C "
2674 tmp_rectangle <<
" L "
2677 tmp_rectangle <<
" C "
2684 tmp_rectangle <<
" L "
2687 tmp_rectangle <<
" C "
2694 tmp_rectangle <<
" L "
2697 tmp_rectangle <<
" C "
2704 tmp_rectangle <<
" z\n";
2707 d->
mask |= emr_mask;
2709 tmp_path << tmp_rectangle.
str().c_str();
2714 dbg_str <<
"<!-- U_EMR_ARC -->\n";
2717 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2718 int stat = emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size);
2725 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2727 d->
mask |= emr_mask;
2730 dbg_str <<
"<!-- ARC record is invalid -->\n";
2736 dbg_str <<
"<!-- U_EMR_CHORD -->\n";
2739 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2740 if(!emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size)){
2746 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2749 d->
mask |= emr_mask;
2752 dbg_str <<
"<!-- CHORD record is invalid -->\n";
2758 dbg_str <<
"<!-- U_EMR_PIE -->\n";
2761 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2762 if(!emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size)){
2763 tmp_path <<
"\n\tM " <<
pix_to_xy(d, center.
x, center.
y);
2769 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2772 d->
mask |= emr_mask;
2775 dbg_str <<
"<!-- PIE record is invalid -->\n";
2779 case U_EMR_SELECTPALETTE: dbg_str <<
"<!-- U_EMR_SELECTPALETTE -->\n";
break;
2780 case U_EMR_CREATEPALETTE: dbg_str <<
"<!-- U_EMR_CREATEPALETTE -->\n";
break;
2781 case U_EMR_SETPALETTEENTRIES: dbg_str <<
"<!-- U_EMR_SETPALETTEENTRIES -->\n";
break;
2782 case U_EMR_RESIZEPALETTE: dbg_str <<
"<!-- U_EMR_RESIZEPALETTE -->\n";
break;
2783 case U_EMR_REALIZEPALETTE: dbg_str <<
"<!-- U_EMR_REALIZEPALETTE -->\n";
break;
2784 case U_EMR_EXTFLOODFILL: dbg_str <<
"<!-- U_EMR_EXTFLOODFILL -->\n";
break;
2787 dbg_str <<
"<!-- U_EMR_LINETO -->\n";
2791 d->
mask |= emr_mask;
2799 dbg_str <<
"<!-- U_EMR_ARCTO -->\n";
2802 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2803 if(!emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size)){
2810 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2813 d->
mask |= emr_mask;
2816 dbg_str <<
"<!-- ARCTO record is invalid -->\n";
2820 case U_EMR_POLYDRAW: dbg_str <<
"<!-- U_EMR_POLYDRAW -->\n";
break;
2821 case U_EMR_SETARCDIRECTION:
2823 dbg_str <<
"<!-- U_EMR_SETARCDIRECTION -->\n";
2825 if(d->
arcdir == U_AD_CLOCKWISE || d->
arcdir == U_AD_COUNTERCLOCKWISE){
2830 case U_EMR_SETMITERLIMIT:
2832 dbg_str <<
"<!-- U_EMR_SETMITERLIMIT -->\n";
2837 float miterlimit = *((int32_t *) &(pEmr->
eMiterLimit));
2843 case U_EMR_BEGINPATH:
2845 dbg_str <<
"<!-- U_EMR_BEGINPATH -->\n";
2848 if(d->
mask & U_DRAW_VISIBLE){
2851 d->
mask |= emr_mask;
2856 dbg_str <<
"<!-- U_EMR_ENDPATH -->\n";
2857 d->
mask &= (0xFFFFFFFF - U_DRAW_ONLYTO);
2860 case U_EMR_CLOSEFIGURE:
2862 dbg_str <<
"<!-- U_EMR_CLOSEFIGURE -->\n";
2864 tmp_path <<
"\n\tz";
2865 d->
mask |= U_DRAW_CLOSED;
2868 case U_EMR_FILLPATH:
2870 dbg_str <<
"<!-- U_EMR_FILLPATH -->\n";
2871 if(d->
mask & U_DRAW_PATH){
2872 if(!(d->
mask & U_DRAW_CLOSED)){
2873 tmp_path <<
"\n\tz";
2874 d->
mask |= U_DRAW_CLOSED;
2876 d->
mask |= emr_mask;
2881 case U_EMR_STROKEANDFILLPATH:
2883 dbg_str <<
"<!-- U_EMR_STROKEANDFILLPATH -->\n";
2884 if(d->
mask & U_DRAW_PATH){
2885 if(!(d->
mask & U_DRAW_CLOSED)){
2886 tmp_path <<
"\n\tz";
2887 d->
mask |= U_DRAW_CLOSED;
2889 d->
mask |= emr_mask;
2890 d->
drawtype = U_EMR_STROKEANDFILLPATH;
2894 case U_EMR_STROKEPATH:
2896 dbg_str <<
"<!-- U_EMR_STROKEPATH -->\n";
2897 if(d->
mask & U_DRAW_PATH){
2898 d->
mask |= emr_mask;
2903 case U_EMR_FLATTENPATH: dbg_str <<
"<!-- U_EMR_FLATTENPATH -->\n";
break;
2904 case U_EMR_WIDENPATH: dbg_str <<
"<!-- U_EMR_WIDENPATH -->\n";
break;
2905 case U_EMR_SELECTCLIPPATH:
2907 dbg_str <<
"<!-- U_EMR_SELECTCLIPPATH -->\n";
2909 int logic = pEmr->
iMode;
2911 if ((logic < U_RGN_MIN) || (logic > U_RGN_MAX)){
break; }
2917 case U_EMR_ABORTPATH:
2919 dbg_str <<
"<!-- U_EMR_ABORTPATH -->\n";
2924 case U_EMR_UNDEF69: dbg_str <<
"<!-- U_EMR_UNDEF69 -->\n";
break;
2927 dbg_str <<
"<!-- U_EMR_COMMENT -->\n";
2931 char *szTxt = (
char *) pEmr->
Data;
2933 for (uint32_t i = 0; i < pEmr->
cbData; i++) {
2935 if ( *szTxt >=
' ' && *szTxt <
'z' && *szTxt !=
'<' && *szTxt !=
'>' ) {
2942 if (
false && strlen(tmp_str.
str().c_str())) {
2943 tmp_outsvg <<
" <!-- \"";
2944 tmp_outsvg << tmp_str.
str().c_str();
2945 tmp_outsvg <<
"\" -->\n";
2950 case U_EMR_FILLRGN: dbg_str <<
"<!-- U_EMR_FILLRGN -->\n";
break;
2951 case U_EMR_FRAMERGN: dbg_str <<
"<!-- U_EMR_FRAMERGN -->\n";
break;
2952 case U_EMR_INVERTRGN: dbg_str <<
"<!-- U_EMR_INVERTRGN -->\n";
break;
2953 case U_EMR_PAINTRGN: dbg_str <<
"<!-- U_EMR_PAINTRGN -->\n";
break;
2954 case U_EMR_EXTSELECTCLIPRGN:
2956 dbg_str <<
"<!-- U_EMR_EXTSELECTCLIPRGN -->\n";
2960 if (pEmr->
iMode == U_RGN_COPY) {
2967 dbg_str <<
"<!-- U_EMR_BITBLT -->\n";
2975 if(pEmr->
dwRop == U_NOOP)
break;
2977 int32_t dy = pEmr->
Dest.
y;
2978 int32_t dw = pEmr->
cDest.
x;
2979 int32_t dh = pEmr->
cDest.
y;
2981 tmp_rectangle <<
"\n\tM " <<
pix_to_xy( d,
dx, dy ) <<
" ";
2982 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
dx + dw, dy ) <<
" ";
2983 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
dx + dw, dy + dh ) <<
" ";
2984 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
dx, dy + dh ) <<
" ";
2985 tmp_rectangle <<
"\n\tz";
2987 d->
mask |= emr_mask;
2989 d->
mask |= U_DRAW_CLOSED;
2991 tmp_path << tmp_rectangle.
str().c_str();
3005 common_image_extraction(d,pEmr,
dx,dy,dw,dh,sx,sy,sw,sh,
3010 case U_EMR_STRETCHBLT:
3012 dbg_str <<
"<!-- U_EMR_STRETCHBLT -->\n";
3023 int sw = pEmr->
cSrc.
x;
3024 int sh = pEmr->
cSrc.
y;
3025 common_image_extraction(d,pEmr,
dx,dy,dw,dh,sx,sy,sw,sh,
3032 dbg_str <<
"<!-- U_EMR_MASKBLT -->\n";
3044 common_image_extraction(d,pEmr,
dx,dy,dw,dh,sx,sy,sw,sh,
3049 case U_EMR_PLGBLT: dbg_str <<
"<!-- U_EMR_PLGBLT -->\n";
break;
3050 case U_EMR_SETDIBITSTODEVICE: dbg_str <<
"<!-- U_EMR_SETDIBITSTODEVICE -->\n";
break;
3051 case U_EMR_STRETCHDIBITS:
3064 int sx = pEmr->
Src.
x;
3065 int sy = pEmr->
Src.
y;
3066 int sw = pEmr->
cSrc.
x;
3067 int sh = pEmr->
cSrc.
y;
3068 common_image_extraction(d,pEmr,
dx,dy,dw,dh,sx,sy,sw,sh,
3071 dbg_str <<
"<!-- U_EMR_STRETCHDIBITS -->\n";
3074 case U_EMR_EXTCREATEFONTINDIRECTW:
3076 dbg_str <<
"<!-- U_EMR_EXTCREATEFONTINDIRECTW -->\n";
3082 case U_EMR_EXTTEXTOUTA:
3083 case U_EMR_EXTTEXTOUTW:
3084 case U_EMR_SMALLTEXTOUT:
3086 dbg_str <<
"<!-- U_EMR_EXTTEXTOUTA/W -->\n";
3094 if(lpEMFR->
iType==U_EMR_SMALLTEXTOUT){
3117 uint32_t *dup_wt =
nullptr;
3119 if( lpEMFR->
iType==U_EMR_EXTTEXTOUTA){
3129 else if( lpEMFR->
iType==U_EMR_EXTTEXTOUTW){
3134 if(pEmrS->
fuOptions & U_ETO_SMALL_CHARS){
3154 if(*((uint8_t *)ansi_text) <= 0x1F){
3163 gchar *escaped_text = g_markup_escape_text(ansi_text, -1);
3173 tsp.
italics = FC_SLANT_OBLIQUE;
break;
3175 tsp.
italics = FC_SLANT_ITALIC;
break;
3178 tsp.
italics = FC_SLANT_ROMAN;
break;
3194 default: tsp.
weight = FC_WEIGHT_NORMAL ;
break;
3210 if( (fOptions & U_ETO_RTLREADING) || (d->
dc[d->
level].
textAlign & U_TA_RTLREADING) ){ tsp.
ldir = LDIR_RL; }
3211 else{ tsp.
ldir = LDIR_LR; }
3231 tmp_clip <<
"\n<g\n\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n>";
3244 g_free(escaped_text);
3250 case U_EMR_POLYBEZIER16:
3252 dbg_str <<
"<!-- U_EMR_POLYBEZIER16 -->\n";
3261 d->
mask |= emr_mask;
3263 tmp_str <<
"\n\tM " <<
pix_to_xy( d, apts[0].x, apts[0].y ) <<
" ";
3265 for (i=1; i<pEmr->
cpts; ) {
3266 tmp_str <<
"\n\tC ";
3267 for (j=0; j<3 && i<pEmr->
cpts; j++,i++) {
3268 tmp_str <<
pix_to_xy( d, apts[i].x, apts[i].y ) <<
" ";
3272 tmp_path << tmp_str.
str().c_str();
3276 case U_EMR_POLYGON16:
3278 dbg_str <<
"<!-- U_EMR_POLYGON16 -->\n";
3284 unsigned int first = 0;
3286 d->
mask |= emr_mask;
3289 tmp_poly <<
"\n\tM " <<
pix_to_xy( d, apts[first].x, apts[first].y ) <<
" ";
3291 for (i=first+1; i<pEmr->
cpts; i++) {
3292 tmp_poly <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y ) <<
" ";
3295 tmp_path << tmp_poly.
str().c_str();
3296 tmp_path <<
"\n\tz";
3297 d->
mask |= U_DRAW_CLOSED;
3301 case U_EMR_POLYLINE16:
3303 dbg_str <<
"<!-- U_EMR_POLYLINE16 -->\n";
3312 d->
mask |= emr_mask;
3314 tmp_str <<
"\n\tM " <<
pix_to_xy( d, apts[0].x, apts[0].y ) <<
" ";
3316 for (i=1; i<pEmr->
cpts; i++) {
3317 tmp_str <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y ) <<
" ";
3320 tmp_path << tmp_str.
str().c_str();
3324 case U_EMR_POLYBEZIERTO16:
3326 dbg_str <<
"<!-- U_EMR_POLYBEZIERTO16 -->\n";
3332 d->
mask |= emr_mask;
3334 for (i=0; i<pEmr->
cpts;) {
3335 tmp_path <<
"\n\tC ";
3336 for (j=0; j<3 && i<pEmr->
cpts; j++,i++) {
3337 tmp_path <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3343 case U_EMR_POLYLINETO16:
3345 dbg_str <<
"<!-- U_EMR_POLYLINETO16 -->\n";
3351 d->
mask |= emr_mask;
3353 for (i=0; i<pEmr->
cpts;i++) {
3354 tmp_path <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3359 case U_EMR_POLYPOLYLINE16:
3360 case U_EMR_POLYPOLYGON16:
3362 if (lpEMFR->
iType == U_EMR_POLYPOLYLINE16)
3363 dbg_str <<
"<!-- U_EMR_POLYPOLYLINE16 -->\n";
3364 if (lpEMFR->
iType == U_EMR_POLYPOLYGON16)
3365 dbg_str <<
"<!-- U_EMR_POLYPOLYGON16 -->\n";
3368 unsigned int n, i, j;
3370 d->
mask |= emr_mask;
3378 poly_path <<
"\n\tM " <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3382 poly_path <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3386 tmp_str << poly_path.
str().c_str();
3387 if (lpEMFR->
iType == U_EMR_POLYPOLYGON16)
3392 tmp_path << tmp_str.
str().c_str();
3396 case U_EMR_POLYDRAW16: dbg_str <<
"<!-- U_EMR_POLYDRAW16 -->\n";
break;
3397 case U_EMR_CREATEMONOBRUSH:
3399 dbg_str <<
"<!-- U_EMR_CREATEDIBPATTERNBRUSHPT -->\n";
3405 case U_EMR_CREATEDIBPATTERNBRUSHPT:
3407 dbg_str <<
"<!-- U_EMR_CREATEDIBPATTERNBRUSHPT -->\n";
3413 case U_EMR_EXTCREATEPEN:
3415 dbg_str <<
"<!-- U_EMR_EXTCREATEPEN -->\n";
3421 case U_EMR_POLYTEXTOUTA: dbg_str <<
"<!-- U_EMR_POLYTEXTOUTA -->\n";
break;
3422 case U_EMR_POLYTEXTOUTW: dbg_str <<
"<!-- U_EMR_POLYTEXTOUTW -->\n";
break;
3423 case U_EMR_SETICMMODE:
3425 dbg_str <<
"<!-- U_EMR_SETICMMODE -->\n";
3430 case U_EMR_CREATECOLORSPACE: dbg_str <<
"<!-- U_EMR_CREATECOLORSPACE -->\n";
break;
3431 case U_EMR_SETCOLORSPACE: dbg_str <<
"<!-- U_EMR_SETCOLORSPACE -->\n";
break;
3432 case U_EMR_DELETECOLORSPACE: dbg_str <<
"<!-- U_EMR_DELETECOLORSPACE -->\n";
break;
3433 case U_EMR_GLSRECORD: dbg_str <<
"<!-- U_EMR_GLSRECORD -->\n";
break;
3434 case U_EMR_GLSBOUNDEDRECORD: dbg_str <<
"<!-- U_EMR_GLSBOUNDEDRECORD -->\n";
break;
3435 case U_EMR_PIXELFORMAT: dbg_str <<
"<!-- U_EMR_PIXELFORMAT -->\n";
break;
3436 case U_EMR_DRAWESCAPE: dbg_str <<
"<!-- U_EMR_DRAWESCAPE -->\n";
break;
3437 case U_EMR_EXTESCAPE: dbg_str <<
"<!-- U_EMR_EXTESCAPE -->\n";
break;
3438 case U_EMR_UNDEF107: dbg_str <<
"<!-- U_EMR_UNDEF107 -->\n";
break;
3440 case U_EMR_FORCEUFIMAPPING: dbg_str <<
"<!-- U_EMR_FORCEUFIMAPPING -->\n";
break;
3441 case U_EMR_NAMEDESCAPE: dbg_str <<
"<!-- U_EMR_NAMEDESCAPE -->\n";
break;
3442 case U_EMR_COLORCORRECTPALETTE: dbg_str <<
"<!-- U_EMR_COLORCORRECTPALETTE -->\n";
break;
3443 case U_EMR_SETICMPROFILEA: dbg_str <<
"<!-- U_EMR_SETICMPROFILEA -->\n";
break;
3444 case U_EMR_SETICMPROFILEW: dbg_str <<
"<!-- U_EMR_SETICMPROFILEW -->\n";
break;
3445 case U_EMR_ALPHABLEND: dbg_str <<
"<!-- U_EMR_ALPHABLEND -->\n";
break;
3446 case U_EMR_SETLAYOUT: dbg_str <<
"<!-- U_EMR_SETLAYOUT -->\n";
break;
3447 case U_EMR_TRANSPARENTBLT: dbg_str <<
"<!-- U_EMR_TRANSPARENTBLT -->\n";
break;
3448 case U_EMR_UNDEF117: dbg_str <<
"<!-- U_EMR_UNDEF117 -->\n";
break;
3449 case U_EMR_GRADIENTFILL:
3460 dbg_str <<
"<!-- U_EMR_GRADIENTFILL -->\n";
3465 if( pEmr->
ulMode == U_GRADIENT_FILL_RECT_H ||
3466 pEmr->
ulMode == U_GRADIENT_FILL_RECT_V
3472 tmp_rectangle <<
"\n<path d=\"";
3474 tmp_rectangle <<
"\n\tM " <<
pix_to_xy( d, tv[rcs[i].UpperLeft ].x , tv[rcs[i].UpperLeft ].y ) <<
" ";
3475 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, tv[rcs[i].LowerRight].x , tv[rcs[i].UpperLeft ].y ) <<
" ";
3476 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, tv[rcs[i].LowerRight].x , tv[rcs[i].LowerRight].y ) <<
" ";
3477 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, tv[rcs[i].UpperLeft ].x , tv[rcs[i].LowerRight].y ) <<
" ";
3478 tmp_rectangle <<
"\n\tz\"";
3479 tmp_rectangle <<
"\n\tstyle=\"stroke:none;fill:url(#";
3481 tmp_rectangle <<
");\"\n";
3483 tmp_rectangle <<
"\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n";
3485 tmp_rectangle <<
"/>\n";
3487 d->
outsvg += tmp_rectangle.
str().c_str();
3489 else if(pEmr->
ulMode == U_GRADIENT_FILL_TRIANGLE){
3495 tmp_triangle <<
"\n<path d=\"";
3497 tmp_triangle <<
"\n\tM " <<
pix_to_xy( d, tv[tris[i].Vertex1].x , tv[tris[i].Vertex1].y ) <<
" ";
3498 tmp_triangle <<
"\n\tL " <<
pix_to_xy( d, tv[tris[i].Vertex2].x , tv[tris[i].Vertex2].y ) <<
" ";
3499 tmp_triangle <<
"\n\tL " <<
pix_to_xy( d, tv[tris[i].Vertex3].x , tv[tris[i].Vertex3].y ) <<
" ";
3500 tmp_triangle <<
"\n\tz\"";
3501 tmp_triangle <<
"\n\tstyle=\"stroke:none;fill:#";
3502 tmp_triangle << tmpcolor;
3503 tmp_triangle <<
";\"\n/>\n";
3505 d->
outsvg += tmp_triangle.
str().c_str();
3511 case U_EMR_SETLINKEDUFIS: dbg_str <<
"<!-- U_EMR_SETLINKEDUFIS -->\n";
break;
3512 case U_EMR_SETTEXTJUSTIFICATION: dbg_str <<
"<!-- U_EMR_SETTEXTJUSTIFICATION -->\n";
break;
3513 case U_EMR_COLORMATCHTOTARGETW: dbg_str <<
"<!-- U_EMR_COLORMATCHTOTARGETW -->\n";
break;
3514 case U_EMR_CREATECOLORSPACEW: dbg_str <<
"<!-- U_EMR_CREATECOLORSPACEW -->\n";
break;
3516 dbg_str <<
"<!-- U_EMR_??? -->\n";
3525 d->
path += tmp_path.
str().c_str();
3531 std::cout << d->
outsvg << std::endl;
3533 (void) emr_properties(U_EMR_INVALID);
3535 return(file_status);
3540 for(
int i=0; i< name.
count; i++){ free(name.
strings[i]); }
3550 if (uri ==
nullptr) {
3555 char *oldlocale = g_strdup(setlocale(LC_NUMERIC,
nullptr));
3556 setlocale(LC_NUMERIC,
"C");
3567 d.
defs +=
" <pattern id=\"EMFhbasepattern\" \n";
3568 d.
defs +=
" patternUnits=\"userSpaceOnUse\"\n";
3569 d.
defs +=
" width=\"6\" \n";
3570 d.
defs +=
" height=\"6\" \n";
3571 d.
defs +=
" x=\"0\" \n";
3572 d.
defs +=
" y=\"0\"> \n";
3573 d.
defs +=
" </pattern> \n";
3578 if(emf_readdata(uri, &contents, &
length))
return(
nullptr);
3585 FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP,
3586 FT_KERNING_UNSCALED);
3607 for (i=0; i<d.
n_obj; i++)
3614 for(
int i=0; i<=EMF_MAX_DC; i++){
3623 setlocale(LC_NUMERIC, oldlocale);
3636 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
3637 "<name>" N_(
"EMF Input")
"</name>\n"
3638 "<id>org.inkscape.input.emf</id>\n"
3640 "<extension>.emf</extension>\n"
3641 "<mimetype>image/x-emf</mimetype>\n"
3642 "<filetypename>" N_(
"Enhanced Metafiles (*.emf)")
"</filetypename>\n"
3643 "<filetypetooltip>" N_(
"Enhanced Metafiles")
"</filetypetooltip>\n"
3645 "</inkscape-extension>", std::make_unique<Emf>());
3651 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
3652 "<name>" N_(
"EMF Output")
"</name>\n"
3653 "<id>org.inkscape.output.emf</id>\n"
3654 "<param name=\"textToPath\" gui-text=\"" N_(
"Convert texts to paths")
"\" type=\"bool\">true</param>\n"
3655 "<param name=\"TnrToSymbol\" gui-text=\"" N_(
"Map Unicode to Symbol font")
"\" type=\"bool\">true</param>\n"
3656 "<param name=\"TnrToWingdings\" gui-text=\"" N_(
"Map Unicode to Wingdings")
"\" type=\"bool\">true</param>\n"
3657 "<param name=\"TnrToZapfDingbats\" gui-text=\"" N_(
"Map Unicode to Zapf Dingbats")
"\" type=\"bool\">true</param>\n"
3658 "<param name=\"UsePUA\" gui-text=\"" N_(
"Use MS Unicode PUA (0xF020-0xF0FF) for converted characters")
"\" type=\"bool\">false</param>\n"
3659 "<param name=\"FixPPTCharPos\" gui-text=\"" N_(
"Compensate for PPT font bug")
"\" type=\"bool\">false</param>\n"
3660 "<param name=\"FixPPTDashLine\" gui-text=\"" N_(
"Convert dashed/dotted lines to single lines")
"\" type=\"bool\">false</param>\n"
3661 "<param name=\"FixPPTGrad2Polys\" gui-text=\"" N_(
"Convert gradients to colored polygon series")
"\" type=\"bool\">false</param>\n"
3662 "<param name=\"FixPPTLinGrad\" gui-text=\"" N_(
"Use native rectangular linear gradients")
"\" type=\"bool\">false</param>\n"
3663 "<param name=\"FixPPTPatternAsHatch\" gui-text=\"" N_(
"Map all fill patterns to standard EMF hatches")
"\" type=\"bool\">false</param>\n"
3664 "<param name=\"FixImageRot\" gui-text=\"" N_(
"Ignore image rotations")
"\" type=\"bool\">false</param>\n"
3666 "<extension>.emf</extension>\n"
3667 "<mimetype>image/x-emf</mimetype>\n"
3668 "<filetypename>" N_(
"Enhanced Metafile (*.emf)")
"</filetypename>\n"
3669 "<filetypetooltip>" N_(
"Enhanced Metafile")
"</filetypetooltip>\n"
3671 "</inkscape-extension>", std::make_unique<Emf>());
3x3 matrix representing an affine transformation.
constexpr Coord y() const noexcept
constexpr Coord x() const noexcept
void setRoot(DrawingItem *root)
Extension * get(const gchar *key) const
This function looks up a Inkscape::Extension::Extension by using its unique id. It then returns a ref...
The object that is the basis for the Extension system.
bool set_param_bool(char const *name, bool value)
Sets a parameter identified by name with the boolean in the parameter value.
static void enlarge_clips(PEMF_CALLBACK_DATA d)
static void free_emf_strings(EMF_STRINGS name)
static int myEnhMetaFileProc(char *contents, unsigned int length, PEMF_CALLBACK_DATA d)
static int in_clips(PEMF_CALLBACK_DATA d, const char *test)
static void add_clips(PEMF_CALLBACK_DATA d, const char *clippath, unsigned int logic)
static double _pix_y_to_point(PEMF_CALLBACK_DATA d, double py)
static void select_pen(PEMF_CALLBACK_DATA d, int index)
static uint32_t add_gradient(PEMF_CALLBACK_DATA d, uint32_t gradientType, U_TRIVERTEX tv1, U_TRIVERTEX tv2)
static double current_scale(PEMF_CALLBACK_DATA d)
static uint32_t add_image(PEMF_CALLBACK_DATA d, void *pEmr, uint32_t cbBits, uint32_t cbBmi, uint32_t iUsage, uint32_t offBits, uint32_t offBmi)
static void delete_object(PEMF_CALLBACK_DATA d, int index)
static void enlarge_hatches(PEMF_CALLBACK_DATA d)
static double pix_to_x_point(PEMF_CALLBACK_DATA d, double px, double py)
static std::string current_matrix(PEMF_CALLBACK_DATA d, double x, double y, int useoffset)
void save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) override
Find out information about the file.
static int AI_hack(PU_EMRHEADER pEmr)
static void enlarge_images(PEMF_CALLBACK_DATA d)
static uint32_t add_hatch(PEMF_CALLBACK_DATA d, uint32_t hatchType, U_COLORREF hatchColor)
bool check(Inkscape::Extension::Extension *module) override
Verify any dependencies.
static void insert_object(PEMF_CALLBACK_DATA d, int index, int type, PU_ENHMETARECORD pObj)
static void select_font(PEMF_CALLBACK_DATA d, int index)
static std::string pix_to_xy(PEMF_CALLBACK_DATA d, double x, double y)
SPDocument * open(Inkscape::Extension::Input *mod, const gchar *uri) override
static void print_document_to_file(SPDocument *doc, const gchar *filename)
static void enlarge_gradients(PEMF_CALLBACK_DATA d)
static void snap_to_faraway_pair(double *x, double *y)
static void output_style(PEMF_CALLBACK_DATA d, int iType)
static uint32_t * unknown_chars(size_t count)
static int in_hatches(PEMF_CALLBACK_DATA d, char *test)
static void select_extpen(PEMF_CALLBACK_DATA d, int index)
static double current_rotation(PEMF_CALLBACK_DATA d)
static double pix_to_y_point(PEMF_CALLBACK_DATA d, double px, double py)
static double _pix_x_to_point(PEMF_CALLBACK_DATA d, double px)
static double pix_to_abs_size(PEMF_CALLBACK_DATA d, double px)
static int in_gradients(PEMF_CALLBACK_DATA d, const char *test)
static void common_image_extraction(PEMF_CALLBACK_DATA d, void *pEmr, double dx, double dy, double dw, double dh, int sx, int sy, int sw, int sh, uint32_t iUsage, uint32_t offBits, uint32_t cbBits, uint32_t offBmi, uint32_t cbBmi)
static int in_images(PEMF_CALLBACK_DATA d, const char *test)
static void select_brush(PEMF_CALLBACK_DATA d, int index)
Generic failure for an undescribed reason.
static double convert(double from_dist, Unit const *from, Unit const *to)
Convert distances.
Typed SVG document implementation.
SPRoot * getRoot()
Returns our SPRoot.
int ensureUpToDate()
Repeatedly works on getting the document updated, since sometimes it takes more than one pass to get ...
static SPDocument * createNewDocFromMem(char const *buffer, int length, bool keepalive, Glib::ustring const &filename="")
Length type internal to SPStyle.
static unsigned int display_key_new(unsigned numkeys)
Allocates unique integer keys.
T< SPAttr::TEXT_DECORATION_LINE, SPITextDecorationLine > text_decoration_line
CSS 3 2.1, 2.2, 2.3.
T< SPAttr::FONT_WEIGHT, SPIEnum< SPCSSFontWeight > > font_weight
Weight of the font.
T< SPAttr::FILL, SPIPaint > fill
fill
T< SPAttr::STROKE_DASHARRAY, SPIDashArray > stroke_dasharray
stroke-dasharray
T< SPAttr::STROKE, SPIPaint > stroke
stroke
T< SPAttr::STROKE_WIDTH, SPILength > stroke_width
stroke-width
T< SPAttr::FILL_RULE, SPIEnum< SPWindRule > > fill_rule
fill-rule: 0 nonzero, 1 evenodd
T< SPAttr::FONT_STYLE, SPIEnum< SPCSSFontStyle > > font_style
Font style.
T< SPAttr::STROKE_LINEJOIN, SPIEnum< SPStrokeJoinType > > stroke_linejoin
stroke-linejoin
T< SPAttr::STROKE_MITERLIMIT, SPIFloat > stroke_miterlimit
stroke-miterlimit
T< SPAttr::STROKE_LINECAP, SPIEnum< SPStrokeCapType > > stroke_linecap
stroke-linecap
T< SPAttr::FONT_SIZE, SPIFontSize > font_size
Size of the font.
T< SPAttr::BASELINE_SHIFT, SPIBaselineShift > baseline_shift
Baseline shift (svg1.1 10.9.2)
A way to clear the N_ macro, which is defined as an inline function.
TODO: insert short description here.
Canvas item belonging to an SVG drawing element.
Enhanced Metafile Input/Output.
Enhanced Metafile printing - implementation.
Coord length(LineSegment const &seg)
double atan2(Point const &p)
SBasisN< n > sqrt(SBasisN< n > const &a, int k)
Point abs(Point const &b)
U_COLORREF trivertex_to_colorref(U_TRIVERTEX tv)
DB db
This is the actual database object.
Print * get_print(gchar const *key)
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
CMYK to sRGB conversion routines.
Geom::PathVector sp_pathvector_boolop(Geom::PathVector const &pathva, Geom::PathVector const &pathvb, BooleanOp bop, FillRule fra, FillRule frb, bool livarotonly, bool flattenbefore)
void invert(const double v[16], double alpha[16])
SPRoot: SVG <svg> implementation.
EMF_DEVICE_CONTEXT dc[EMF_MAX_DC+1]
Inkscape::Extension::Print * module
Information for a single text object.
int decoration
text decorations, ignored during assembly, used during output
int weight
weight, as in FontConfig
int taln
text alignment with respect to x,y
double boff
Y LL corner - boff finds baseline
int spaces
count of spaces converted from wide kerning (1 or 2)
int co
condensed override, if set Font name included narrow
double ori
Orientation, angle of characters with respect to baseline in degrees.
int fi_idx
index of the font it uses
uint8_t * string
UTF-8 text
double fs
font size of text
int ldir
language direction LDIR_*
double vadvance
Line spacing typically 1.25 or 1.2, only set on the first text element in a complex
int italics
italics, as in FontConfig
double x
x coordinate, relative to TR_INFO x,y, in points
double y
y coordinate, relative to TR_INFO x,y, in points
int condensed
condensed, as in FontConfig
uint8_t Red
Red color (0-255)
uint8_t Green
Green color (0-255)
uint8_t Reserved
Not used.
uint8_t Blue
Blue color (0-255)
uint8_t * out
buffer to hold formatted output
int dirty
1 if text records are loaded
FT_INFO * fti
Font info storage
uint8_t Red
Red color (0-255)
uint8_t Reserved
Not used.
uint8_t Blue
Blue color (0-255)
uint8_t Green
Green color (0-255)
U_OFFBITSSRC offBitsSrc
Offset in bytes to the bitmap (within bitmapbuffer)
U_OFFBMISRC offBmiSrc
Offset in bytes to U_BITMAPINFO (within bitmapbuffer)
U_POINTL Dest
Destination UL corner in logical units.
U_XFORM xformSrc
Source bitmap transform (world to page coordinates)
uint32_t dwRop
Ternary Raster Operation enumeration.
U_POINTL cDest
Destination width in logical units.
U_CBBITS cbBitsSrc
Size in bytes of bitmap Record may include optional bitmapbuffer.
uint32_t iUsageSrc
DIBcolors Enumeration.
U_CBBMISRC cbBmiSrc
Size in bytes of U_BITMAPINFO.
U_POINTL Src
Source retangle UL corner in logical units.
uint32_t ihBrush
Index to place object in EMF object table (this entry must not yet exist)
U_LOGBRUSH lb
Brush properties.
U_OFFBITS offBits
Offset in bytes to the DIB bitmap data (within DIB bitmapbuffer.
uint32_t ihBrush
Index to place object in EMF object table (this entry must not yet exist)
U_OFFBMI offBmi
Offset in bytes to U_BITMAPINFO (within DIB bitmapbuffer)
uint32_t iUsage
DIBcolors Enumeration.
U_CBBITS cbBits
Size in bytes of DIB bitmap Record may include optional DIB bitmapbuffer.
U_CBBMI cbBmi
Size in bytes of U_BITMAPINFO.
uint32_t ihBrush
Index to place object in EMF object table (this entry must not yet exist)
U_LOGPEN lopn
Pen properties.
uint32_t ihPen
Index to place object in EMF object table (this entry must not yet exist)
uint32_t ihObject
Number of a stock or created object.
U_RECTL rclBox
bounding rectangle in logical units
U_RECTL rclClip
Clipping Region.
U_LOGFONT_PANOSE elfw
Font parameters, either U_LOGFONT or U_LOGFONT_PANOSE, the latter is bigger so use that type here.
uint32_t ihFont
Index of the font in the EMF object table.
U_CBBITS cbBits
Size in bytes of DIB bitmap.
uint32_t ihPen
Index to place object in EMF object table (this entry must not yet exist)
U_EXTLOGPEN elp
Pen parameters (Size is Variable!!!!) Record may include optional DIB bitmap.
uint32_t iMode
RegionMode Enumeration
U_EMRTEXT emrtext
Text parameters.
U_NUM_GRADOBJ nGradObj
Number of gradient triangle/rectangle objects.
uint32_t ulMode
Gradientfill Enumeration (determines Triangle/Rectangle)
U_NUM_TRIVERTEX nTriVert
Number of TriVertex objects.
U_OFFBMISRC offBmiSrc
Offset in bytes to U_BITMAPINFO (within srcbitmapbuffer)
U_POINTL Src
Source UL corner in logical units.
uint32_t iUsageSrc
DIBcolors Enumeration.
U_POINTL Dest
Destination UL corner in logical units.
U_XFORM xformSrc
Transform to apply to source.
U_POINTL cDest
Destination width in logical units.
U_OFFBITSSRC offBitsSrc
Offset in bytes to the src bitmap (within srcbitmapbuffer)
U_CBBITS cbBitsSrc
Size in bytes of src bitmap.
U_CBBMISRC cbBmiSrc
Size in bytes of U_BITMAPINFO.
EMF manual 2.3.11.4 EMF manual 2.3.5.13
U_POINTL ptl
Point coordinates.
U_POINTL ptlOffset
Clipping region.
U_POINT16 apts[1]
Array of POINT16.
U_NUM_POINT16 cpts
Number of POINT16 in array.
U_NUM_POINTL cptl
Number of points to draw.
U_POINTL aptl[1]
array of points
U_NUM_POINT16 cpts
Total number of points (over all poly)
U_NUM_POLYCOUNTS nPolys
Number of elements in aPolyCounts.
U_POLYCOUNTS aPolyCounts[1]
Number of points in each poly (sequential)
U_POLYCOUNTS aPolyCounts[1]
Number of points in each poly (sequential)
U_NUM_POINTL cptl
Total number of points (over all poly)
U_NUM_POLYCOUNTS nPolys
Number of elements in aPolyCounts.
int32_t iRelative
DC to restore. -1 is preceding.
U_RECTL rclBox
bounding rectangle in logical units
U_SIZEL szlCorner
W & H in logical units of ellipse used to round corner.
uint32_t iArcDirection
ArcDirection Enumeration.
EMF manual 2.3.11.19 MapMode enumeration.
uint32_t iMode
enumeration varies with type
uint32_t eMiterLimit
Miter limit (max value of mitered length / line width)
U_SIZEL szlExtent
H & V extent in logical units.
U_POINTL ptlOrigin
H & V origin in logical units.
U_POINTL Dest
Where to draw the text.
U_NUM_STR cChars
Characters in TextString (not null terminated)
uint32_t fuOptions
ExtTextOutOptions Enumeration.
U_CBBITS cbBitsSrc
Size in bytes of bitmap.
U_OFFBMISRC offBmiSrc
Offset in bytes to U_BITMAPINFO (within bitmapbuffer)
U_POINTL cSrc
Src W & H in logical units Record may include optional bitmapbuffer.
U_OFFBITSSRC offBitsSrc
Offset in bytes to the bitmap (within bitmapbuffer)
uint32_t iUsageSrc
DIBcolors Enumeration.
U_XFORM xformSrc
Transform to apply to source.
U_POINTL Src
Source UL corner in logical units.
U_CBBMISRC cbBmiSrc
Size in bytes of U_BITMAPINFO.
U_POINTL Dest
Destination UL corner in logical units.
U_POINTL cDest
Destination width in logical units.
U_POINTL cDest
Destination W & H in logical units Record may includes optional bitmapbuffer.
U_POINTL Src
Source UL corner in logical units.
U_POINTL Dest
Destination UL corner in logical units.
U_OFFBITSSRC offBitsSrc
Offset in bytes to bitmap.
U_CBBITS cbBitsSrc
Size in bytes of bitmap.
U_CBBMISRC cbBmiSrc
Size in bytes of U_BITMAPINFO.
U_OFFBMISRC offBmiSrc
Offset in bytes to U_BITMAPINFO (within bitmapbuffer)
U_POINTL cSrc
Source W & H in logical units.
uint32_t iUsageSrc
DIBColors Enumeration.
uint32_t fOptions
ExtTextOutOptions Enumeration.
U_POINTL ptlReference
String start coordinates.
U_OFFSTR offString
Offset in bytes to the string from the start of the RECORD.
U_NUM_STR nChars
Number of characters in the string.
First two fields of all EMF records, First two fields of all EMF+ records (1 or more within an EMF co...
uint32_t iType
Type of EMR record.
uint32_t nSize
Size of entire record in bytes (multiple of 4).
U_NUM_STYLEENTRY elpNumEntries
Count of StyleEntry array.
U_STYLEENTRY elpStyleEntry[1]
Array of StyleEntry (For user specified dot/dash patterns)
uint32_t elpWidth
Width in logical units (elpPenStyle & U_PS_GEOMETRIC) or 1 (pixel)
uint32_t elpPenStyle
PenStyle Enumeration.
U_COLORREF elpColor
Pen color.
uint32_t elpBrushStyle
LB_Style Enumeration.
uint32_t elpHatch
HatchStyle Enumeration.
For U_EMRGRADIENTFILL GradObj field.
For U_EMRGRADIENTFILL GradObj field.
uint32_t UpperLeft
Index of UL corner in an array of U_TRIVERTEX objects.
uint32_t LowerRight
Index of LR corner in an array of U_TRIVERTEX objects.
U_COLORREF lbColor
Brush color.
uint32_t lbHatch
HatchStyle Enumeration.
uint32_t lbStyle
< In MS documentation this is LogBrushEx Object
U_LOGFONT elfLogFont
Basic font attributes.
uint8_t lfUnderline
LF_Underline Enumeration.
uint8_t lfItalic
LF_Italic Enumeration.
uint8_t lfStrikeOut
LF_StrikeOut Enumeration.
int32_t lfEscapement
Angle in 0.1 degrees betweem escapement vector and X axis.
int32_t lfHeight
Height in Logical units.
uint16_t lfFaceName[U_LF_FACESIZE]
Name of font. If <U_LF_FACESIZE chars must be null terminated.
int32_t lfWeight
LF_Weight Enumeration.
uint32_t lopnStyle
PenStyle Enumeration.
U_POINT lopnWidth
Width of pen set by X, Y is ignored.
U_COLORREF lopnColor
Pen color value.
Any generic pair of floats.
int32_t left
left coordinate
int32_t right
right coordinate
int32_t bottom
bottom coordinate
int32_t top
top coordinate
For GRADIENT_[TRIANGLE|U_RECT].
uint16_t Green
Green component.
uint16_t Red
Red component.
uint16_t Alpha
Alpha Transparency.
uint16_t Blue
Bule component.
@ SP_CSS_FONT_WEIGHT_LIGHTER
@ SP_CSS_FONT_WEIGHT_NORMAL
@ SP_CSS_FONT_WEIGHT_BOLD
@ SP_CSS_FONT_WEIGHT_BOLDER
@ SP_STROKE_LINEJOIN_MITER
@ SP_STROKE_LINEJOIN_BEVEL
@ SP_STROKE_LINEJOIN_ROUND
@ SP_CSS_FONT_STYLE_NORMAL
@ SP_CSS_FONT_STYLE_OBLIQUE
@ SP_CSS_FONT_STYLE_ITALIC
@ SP_STROKE_LINECAP_SQUARE
@ SP_STROKE_LINECAP_ROUND
Geom::PathVector sp_svg_read_pathv(char const *str)
static void sp_svg_write_path(Inkscape::SVG::PathString &str, Geom::Path const &p, bool normalize=false)
Enhanced Metafile Input/Output.
int NonToUnicode(uint32_t *text, char *font)
void msdepua(uint32_t *text)
void TableGen(bool symb, bool wing, bool zdng, bool pua)
int trinfo_load_qe(TR_INFO *tri, double qe)
TR_INFO * trinfo_init(TR_INFO *tri)
char * TR_construct_fontspec(const TCHUNK_SPECS *tsp, const char *fontname)
int TR_layout_analyze(TR_INFO *tri)
int trinfo_load_bk(TR_INFO *tri, int usebk, TRCOLORREF bkcolor)
void TR_layout_2_svg(TR_INFO *tri)
TR_INFO * trinfo_clear(TR_INFO *tri)
TR_INFO * trinfo_release_except_FC(TR_INFO *tri)
int trinfo_load_ft_opts(TR_INFO *tri, int use_kern, int load_flags, int kern_mode)
int TR_findcasesub(const char *string, const char *sub)
int trinfo_load_textrec(TR_INFO *tri, const TCHUNK_SPECS *tsp, double escapement, int flags)
int ftinfo_load_fontname(FT_INFO *fti, const char *fontspec)
struct U_EMREXCLUDECLIPRECT * PU_EMREXCLUDECLIPRECT
EMF manual 2.3.2.1.
struct U_EMRSETWINDOWORGEX * PU_EMRSETWINDOWORGEX
EMF manual 2.3.11.31.
struct U_RECT U_RECTL
WMF manual 2.2.2.19.
struct U_EMRMODIFYWORLDTRANSFORM * PU_EMRMODIFYWORLDTRANSFORM
EMF manual 2.3.12.1.
struct U_EMRSETMITERLIMIT * PU_EMRSETMITERLIMIT
EMF manual 2.3.11.21
struct U_EMRPOLYPOLYLINE * PU_EMRPOLYPOLYGON
EMF manual 2.3.5.28.
struct U_EMRSETMAPMODE * PU_EMRSETTEXTALIGN
EMF manual 2.3.11.25 TextAlignment enumeration.
struct U_EMRSETWINDOWORGEX * PU_EMRSETVIEWPORTORGEX
EMF manual 2.3.11.29.
struct U_EMRMOVETOEX * PU_EMRMOVETOEX
EMF manual 2.3.11.4.
struct U_EMRSTRETCHBLT * PU_EMRSTRETCHBLT
EMF manual 2.3.1.6.
struct U_EMRPOLYBEZIER * PU_EMRPOLYGON
EMF manual 2.3.5.22.
struct U_EMRSETWINDOWEXTEX * PU_EMRSETWINDOWEXTEX
EMF manual manual 2.3.11.30.
struct U_EMRSETMAPMODE * PU_EMRSETMAPMODE
EMF manual 2.3.11.19 MapMode enumeration.
struct U_EMRSTRETCHDIBITS * PU_EMRSTRETCHDIBITS
EMF manual 2.3.1.7.
struct U_POINT16 * PU_POINT16
WMF manual 2.2.2.16.
struct U_EMRSETWORLDTRANSFORM * PU_EMRSETWORLDTRANSFORM
EMF manual 2.3.12.2.
struct U_EMRSETMAPMODE * PU_EMRSETPOLYFILLMODE
EMF manual 2.3.11.22 PolygonFillMode Enumeration.
struct U_EMRSETMAPMODE * PU_EMRSETBKMODE
EMF manual 2.3.11.11 BackgroundMode Enumeration.
struct U_EMRSETTEXTCOLOR * PU_EMRSETTEXTCOLOR
EMF manual 2.3.11.26.
struct U_EMRSETMAPMODE * PU_EMRSELECTCLIPPATH
EMF manual 2.3.2.5 RegionMode Enumeration.
struct U_EMRMOVETOEX * PU_EMRLINETO
EMF manual 2.3.5.13.
struct U_EMRBITBLT * PU_EMRBITBLT
EMF manual 2.3.1.2.
struct U_EMRPOLYBEZIER * PU_EMRPOLYBEZIERTO
EMF manual 2.3.5.18.
struct U_EMRCOMMENT * PU_EMRCOMMENT
EMF manual 2.3.3.1, AKA GDICOMMENT.
struct U_EMREXTCREATEPEN * PU_EMREXTCREATEPEN
EMF manual 2.3.7.9.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYLINETO16
EMF manual 2.3.5.27.
struct U_ENHMETARECORD * PU_ENHMETARECORD
General form of an EMF record.
struct U_EMROFFSETCLIPRGN * PU_EMROFFSETCLIPRGN
EMF manual 2.3.2.4.
struct U_EMRHEADER * PU_EMRHEADER
EMF manual 2.2.9.
struct U_EMRSETARCDIRECTION * PU_EMRSETARCDIRECTION
EMF manual 2.3.11.9.
struct U_EMRSMALLTEXTOUT * PU_EMRSMALLTEXTOUT
EMF manual 2.3.5.37.
struct U_EMRCREATEBRUSHINDIRECT * PU_EMRCREATEBRUSHINDIRECT
EMF manual 2.3.7.1
struct U_EMRSETMAPMODE * PU_EMRSETICMMODE
EMF manual 2.3.11.14 ICMMode Enumeration.
struct U_EMRROUNDRECT * PU_EMRROUNDRECT
EMF manual 2.3.5.35
struct U_EMRPOLYBEZIER * PU_EMRPOLYBEZIER
EMF manual 2.3.5.16.
struct U_EMRRESTOREDC * PU_EMRRESTOREDC
EMF manual 2.3.11.6.
struct U_EMREXTTEXTOUTA * PU_EMREXTTEXTOUTW
EMF manual 2.3.5.8.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYGON16
EMF manual 2.3.5.23.
struct U_EMRPOLYBEZIER * PU_EMRPOLYLINE
EMF manual 2.3.5.24.
struct U_EMRDELETEOBJECT * PU_EMRSELECTOBJECT
EMF manual 2.3.8.5.
struct U_EMR * PU_EMR
First two fields of all EMF records,.
struct U_EMRCREATEDIBPATTERNBRUSHPT * PU_EMRCREATEDIBPATTERNBRUSHPT
EMF manual 2.3.7.4.
struct U_EMRCREATEMONOBRUSH * PU_EMRCREATEMONOBRUSH
EMF manual 2.3.7.5.
struct U_EMRELLIPSE * PU_EMRELLIPSE
EMF manual 2.3.5.5.
struct U_EMRSETWINDOWEXTEX * PU_EMRSETVIEWPORTEXTEX
EMF manual manual 2.3.11.28.
struct U_EMRPOLYPOLYLINE16 * PU_EMRPOLYPOLYGON16
EMF manual 2.3.5.29.
struct U_EMRSETMAPMODE * PU_EMRSETSTRETCHBLTMODE
EMF manual 2.3.11.24 StretchMode Enumeration.
struct U_EMRELLIPSE * PU_EMRRECTANGLE
EMF manual 2.3.5.34.
struct U_EMRCREATEPEN * PU_EMRCREATEPEN
EMF manual 2.3.7.7.
struct U_PAIR * PU_POINTL
WMF manual 2.2.2.15.
struct U_EMRPOLYBEZIER * PU_EMRPOLYLINETO
EMF manual 2.3.5.26.
struct U_EMREXCLUDECLIPRECT * PU_EMRINTERSECTCLIPRECT
EMF manual 2.3.2.3.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYLINE16
EMF manual 2.3.5.25.
struct U_EMRSETTEXTCOLOR * PU_EMRSETBKCOLOR
EMF manual 2.3.11.10.
struct U_EMRMASKBLT * PU_EMRMASKBLT
EMF manual 2.3.1.3.
struct U_EMRSETMAPMODE * PU_EMRSETROP2
EMF manual 2.3.11.23 Binary Raster Operation Enumeration.
struct U_EMREXTSELECTCLIPRGN * PU_EMREXTSELECTCLIPRGN
EMF manual 2.3.2.2.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYBEZIER16
EMF manual 2.3.5.17.
struct U_EMRGRADIENTFILL * PU_EMRGRADIENTFILL
EMF manual 2.3.5.12.
struct U_EMRPOLYBEZIER16 * PU_EMRPOLYBEZIERTO16
EMF manual 2.3.5.19.
struct U_EMREXTCREATEFONTINDIRECTW * PU_EMREXTCREATEFONTINDIRECTW
EMF manual 2.3.7.8.
int U_emf_record_safe(const char *record)
uint32_t * U_Utf8ToUtf32le(const char *src, size_t max, size_t *len)
char * U_Utf16leToUtf8(const uint16_t *src, size_t max, size_t *len)
char * U_strdup(const char *s)
uint32_t * U_Latin1ToUtf32le(const char *src, size_t max, size_t *len)
uint32_t * U_Utf16leToUtf32le(const uint16_t *src, size_t max, size_t *len)
char * U_Utf32leToUtf8(const uint32_t *src, size_t max, size_t *len)