55#define U_PS_JOIN_MASK (U_PS_JOIN_BEVEL|U_PS_JOIN_MITER|U_PS_JOIN_ROUND)
74 const gchar *oldconst;
81 oldconst = mod->get_param_string(
"destination");
82 oldoutput = g_strdup(oldconst);
83 mod->set_param_string(
"destination", filename);
92 mod->root = mod->base->invoke_show(drawing, mod->dkey, SP_ITEM_SHOW_DISPLAY);
95 ret = mod->begin(doc);
100 mod->base->invoke_print(&context);
101 (void) mod->finish();
103 mod->base->invoke_hide(mod->dkey);
108 mod->set_param_string(
"destination", oldoutput);
124 bool new_val = mod->get_param_bool(
"textToPath");
125 bool new_FixPPTCharPos = mod->get_param_bool(
"FixPPTCharPos");
127 bool new_FixPPTDashLine = mod->get_param_bool(
"FixPPTDashLine");
128 bool new_FixPPTGrad2Polys = mod->get_param_bool(
"FixPPTGrad2Polys");
129 bool new_FixPPTLinGrad = mod->get_param_bool(
"FixPPTLinGrad");
130 bool new_FixPPTPatternAsHatch = mod->get_param_bool(
"FixPPTPatternAsHatch");
131 bool new_FixImageRot = mod->get_param_bool(
"FixImageRot");
134 mod->get_param_bool(
"TnrToSymbol"),
135 mod->get_param_bool(
"TnrToWingdings"),
136 mod->get_param_bool(
"TnrToZapfDingbats"),
137 mod->get_param_bool(
"UsePUA")
144 ext->
set_param_bool(
"FixPPTPatternAsHatch",new_FixPPTPatternAsHatch);
149 char *oldlocale = g_strdup(setlocale(LC_NUMERIC,
nullptr));
150 setlocale(LC_NUMERIC,
"C");
155 setlocale(LC_NUMERIC, oldlocale);
181 cxform <<
"\"matrix(";
190 cxform << x - newx; cxform <<
",";
197 return(cxform.
str());
236 case U_HS_SOLIDTEXTCLR:
237 case U_HS_DITHEREDTEXTCLR:
240 case U_HS_SOLIDBKCLR:
241 case U_HS_DITHEREDBKCLR:
245 safeprintf(tmpcolor,
"%6.6X",
sethexcolor(hatchColor));
253 safeprintf(hpathname,
"EMFhpath%d_%s",hatchType,tmpcolor);
255 auto & defs = d->
defs;
262 case U_HS_HORIZONTAL:
263 defs +=
" <path id=\"";
265 defs +=
"\" d=\"M 0 0 6 0\" style=\"fill:none;stroke:#";
270 defs +=
" <path id=\"";
272 defs +=
"\" d=\"M 0 0 0 6\" style=\"fill:none;stroke:#";
277 defs +=
" <line id=\"sub";
279 defs +=
"\" x1=\"-1\" y1=\"-1\" x2=\"7\" y2=\"7\" stroke=\"#";
284 defs +=
" <line id=\"sub";
286 defs +=
"\" x1=\"-1\" y1=\"7\" x2=\"7\" y2=\"-1\" stroke=\"#";
291 defs +=
" <path id=\"";
293 defs +=
"\" d=\"M 0 0 6 0 M 0 0 0 6\" style=\"fill:none;stroke:#";
298 defs +=
" <line id=\"subfd";
300 defs +=
"\" x1=\"-1\" y1=\"-1\" x2=\"7\" y2=\"7\" stroke=\"#";
303 defs +=
" <line id=\"subbd";
305 defs +=
"\" x1=\"-1\" y1=\"7\" x2=\"7\" y2=\"-1\" stroke=\"#";
310 case U_HS_DITHEREDCLR:
311 case U_HS_SOLIDTEXTCLR:
312 case U_HS_DITHEREDTEXTCLR:
313 case U_HS_SOLIDBKCLR:
314 case U_HS_DITHEREDBKCLR:
316 defs +=
" <path id=\"";
318 defs +=
"\" d=\"M 0 0 6 0 6 6 0 6 z\" style=\"fill:#";
320 defs +=
";stroke:none";
328 case U_HS_HORIZONTAL:
332 case U_HS_DITHEREDCLR:
333 case U_HS_SOLIDTEXTCLR:
334 case U_HS_DITHEREDTEXTCLR:
335 case U_HS_SOLIDBKCLR:
336 case U_HS_DITHEREDBKCLR:
338 refpath +=
" <use xlink:href=\"#";
339 refpath += hpathname;
340 refpath +=
"\" />\n";
344 refpath +=
" <use xlink:href=\"#sub";
345 refpath += hpathname;
346 refpath +=
"\" />\n";
347 refpath +=
" <use xlink:href=\"#sub";
348 refpath += hpathname;
349 refpath +=
"\" transform=\"translate(6,0)\" />\n";
350 refpath +=
" <use xlink:href=\"#sub";
351 refpath += hpathname;
352 refpath +=
"\" transform=\"translate(-6,0)\" />\n";
355 refpath +=
" <use xlink:href=\"#subfd";
356 refpath += hpathname;
357 refpath +=
"\" />\n";
358 refpath +=
" <use xlink:href=\"#subfd";
359 refpath += hpathname;
360 refpath +=
"\" transform=\"translate(6,0)\"/>\n";
361 refpath +=
" <use xlink:href=\"#subfd";
362 refpath += hpathname;
363 refpath +=
"\" transform=\"translate(-6,0)\"/>\n";
364 refpath +=
" <use xlink:href=\"#subbd";
365 refpath += hpathname;
366 refpath +=
"\" />\n";
367 refpath +=
" <use xlink:href=\"#subbd";
368 refpath += hpathname;
369 refpath +=
"\" transform=\"translate(6,0)\"/>\n";
370 refpath +=
" <use xlink:href=\"#subbd";
371 refpath += hpathname;
372 refpath +=
"\" transform=\"translate(-6,0)\"/>\n";
376 if(d->
dc[d->
level].
bkMode == U_TRANSPARENT || hatchType >= U_HS_SOLIDCLR){
377 safeprintf(hatchname,
"EMFhatch%d_%s",hatchType,tmpcolor);
378 safeprintf(hpathname,
"EMFhpath%d_%s",hatchType,tmpcolor);
384 defs +=
" <pattern id=\"";
386 defs +=
"\" xlink:href=\"#EMFhbasepattern\">\n";
388 defs +=
" </pattern>\n";
395 safeprintf(hbkname,
"EMFhbkclr_%s",bkcolor);
402 defs +=
" <rect id=\"";
404 defs +=
"\" x=\"0\" y=\"0\" width=\"6\" height=\"6\" fill=\"#";
410 safeprintf(hatchname,
"EMFhatch%d_%s_%s",hatchType,tmpcolor,bkcolor);
416 defs +=
" <pattern id=\"";
418 defs +=
"\" xlink:href=\"#EMFhbasepattern\">\n";
419 defs +=
" <use xlink:href=\"#";
423 defs +=
" </pattern>\n";
454 uint32_t iUsage, uint32_t offBits, uint32_t offBmi){
460 int dibparams = U_BI_UNKNOWN;
465 char *rgba_px =
nullptr;
466 const char *px =
nullptr;
470 if(cbBits && cbBmi && (iUsage == U_DIB_RGB_COLORS)){
472 dibparams = get_DIB_params((
const char *)pEmr, offBits, offBmi, &px, (
const U_RGBQUAD **) &ct,
474 if(dibparams ==U_BI_RGB){
476 if(((
PU_EMR)pEmr)->iType == U_EMR_CREATEMONOBRUSH){
483 return(U_EMR_INVALID);
508 gchar *base64String=
nullptr;
509 if(dibparams == U_BI_JPEG || dibparams==U_BI_PNG){
510 base64String = g_base64_encode((guchar*) px, numCt );
513 base64String = g_base64_encode((guchar*) mempng.
buffer, mempng.
size );
522 idx =
in_images(d, (
char *) base64String);
523 auto & defs = d->
defs;
529 safeprintf(imagename,
"EMFimage%d",idx++);
530 safeprintf(xywh,
" x=\"0\" y=\"0\" width=\"%d\" height=\"%d\" ",
width,
height);
533 defs +=
" <image id=\"";
538 if(dibparams == U_BI_JPEG){ defs +=
" xlink:href=\"data:image/jpeg;base64,"; }
539 else { defs +=
" xlink:href=\"data:image/png;base64,"; }
540 defs += base64String;
542 defs +=
" preserveAspectRatio=\"none\"\n";
547 defs +=
" <pattern id=\"";
551 defs +=
"\n patternUnits=\"userSpaceOnUse\"";
553 defs +=
" <use id=\"";
556 defs +=
" xlink:href=\"#";
560 defs +=
" </pattern>\n";
562 g_free(base64String);
575 safeprintf(imrotname,
"EMFrotimage%d_%d",idx-1,tangle);
576 base64String = g_base64_encode((guchar*) imrotname, strlen(imrotname) );
577 idx =
in_images(d, (
char *) base64String);
582 safeprintf(imrotname,
"EMFimage%d",idx++);
585 defs +=
" <pattern\n";
589 defs +=
" xlink:href=\"#";
592 defs +=
" patternTransform=";
596 g_free(base64String);
644 safeprintf(tmpcolor1,
"%6.6X",
sethexcolor(gradientColor1));
645 safeprintf(tmpcolor2,
"%6.6X",
sethexcolor(gradientColor2));
646 switch(gradientType){
647 case U_GRADIENT_FILL_RECT_H:
652 case U_GRADIENT_FILL_RECT_V:
669 safeprintf(hgradname,
"LinGrd%c_%s_%s_%d",gradc,tmpcolor1,tmpcolor2,tangle);
677 stmp <<
" <linearGradient id=\"";
694 stmp <<
"\" gradientTransform=\"(1,0,0,1,0,0)\"";
695 stmp <<
" gradientUnits=\"userSpaceOnUse\"\n";
697 stmp <<
" <stop offset=\"0\" style=\"stop-color:#";
699 stmp <<
";stop-opacity:1\" />\n";
700 stmp <<
" <stop offset=\"1\" style=\"stop-color:#";
702 stmp <<
";stop-opacity:1\" />\n";
703 stmp <<
" </linearGradient>\n";
734 std::string combined;
746 uint32_t idx =
in_clips(d, combined.c_str());
752 tmp_clippath <<
"\n<clipPath";
753 tmp_clippath <<
"\n\tclipPathUnits=\"userSpaceOnUse\" ";
754 tmp_clippath <<
"\n\tid=\"clipEmfPath" << d->
dc[d->
level].
clip_id <<
"\"";
755 tmp_clippath <<
" >";
756 tmp_clippath <<
"\n\t<path d=\"";
757 tmp_clippath << combined;
758 tmp_clippath <<
"\"";
759 tmp_clippath <<
"\n\t/>";
760 tmp_clippath <<
"\n</clipPath>";
775 char tmp[1024] = {0};
820 case U_R2_NOTMERGEPEN:
821 case U_R2_MASKNOTPEN:
823 case U_R2_NOTCOPYPEN:
827 case U_R2_MASKPENNOT:
830 case U_R2_NOTMASKPEN:
833 case U_R2_MERGENOTPEN:
836 case U_R2_MERGEPENNOT:
850 d->
outsvg +=
"\n\tstyle=\"";
852 tmp_style <<
"fill:none;";
861 snprintf(tmp, 1023,
"fill:url(#EMFimage%d_ref); ",d->
dc[d->
level].
fill_idx);
868 tmp_style <<
"fill:" <<
fill.toString(
false).c_str() <<
";";
877 tmp_style <<
"fill-opacity:1;";
895 tmp_style <<
"stroke:none;";
911 tmp_style <<
"stroke:" <<
stroke.toString(
false).c_str() <<
";";
914 tmp_style <<
"stroke-width:" <<
917 tmp_style <<
"stroke-linecap:" <<
925 tmp_style <<
"stroke-linejoin:" <<
934 tmp_style <<
"stroke-miterlimit:" <<
940 tmp_style <<
"stroke-dasharray:";
947 tmp_style <<
"stroke-dashoffset:0;";
949 tmp_style <<
"stroke-dasharray:none;";
951 tmp_style <<
"stroke-opacity:1;";
955 tmp_style <<
"\n\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\" ";
1033 return(cxform.
str());
1042 if (
index >= 0 && index < d->n_obj){
1046 if (!pEmr){
return; }
1052 case U_PS_DASHDOTDOT:
1060 if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1066 if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1070 if (penstyle==U_PS_DASHDOTDOT) {
1090 case U_PS_ENDCAP_FLAT:
1097 case U_PS_JOIN_ROUND:
1107 int cur_level = d->
level;
1110 d->
level = cur_level;
1114 int cur_level = d->
level;
1117 d->
level = cur_level;
1128 if (
index >= 0 && index < d->n_obj)
1135 case U_PS_USERSTYLE:
1156 case U_PS_DASHDOTDOT:
1164 if (penstyle==U_PS_DASH || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1170 if (penstyle==U_PS_DOT || penstyle==U_PS_DASHDOT || penstyle==U_PS_DASHDOTDOT) {
1176 if (penstyle==U_PS_DASHDOTDOT) {
1201 case U_PS_ENDCAP_ROUND:
1206 case U_PS_ENDCAP_SQUARE:
1211 case U_PS_ENDCAP_FLAT:
1220 case U_PS_JOIN_BEVEL:
1225 case U_PS_JOIN_MITER:
1230 case U_PS_JOIN_ROUND:
1248 int cur_level = d->
level;
1251 d->
level = cur_level;
1255 int cur_level = d->
level;
1258 d->
level = cur_level;
1293 if (
index >= 0 && index < d->n_obj){
1295 if(iType == U_EMR_CREATEBRUSHINDIRECT){
1302 else if(pEmr->
lb.
lbStyle == U_BS_HATCHED){
1309 else if(iType == U_EMR_CREATEDIBPATTERNBRUSHPT || iType == U_EMR_CREATEMONOBRUSH){
1312 if(tidx == U_EMR_INVALID){
1331 if (
index >= 0 && index < d->n_obj)
1341 int cur_level = d->
level;
1349 font_size = round(20.0 * 0.8 * font_size)/(20.0 * 0.8);
1350 d->
level = cur_level;
1390 if (
index >= 0 && index < d->n_obj) {
1406 if (
index >= 0 && index < d->n_obj) {
1422 char *
string =
nullptr;
1426 (0==strcmp(
"Adobe Systems",
string)) &&
1427 (nEmr->
emr.
iType == U_EMR_SETMAPMODE) &&
1428 (nEmr->
iMode == U_MM_ANISOTROPIC)){ ret=1; }
1439 uint32_t *res = (uint32_t *) malloc(
sizeof(uint32_t) * (count + 1));
1440 if(!res)
throw "Inkscape fatal memory allocation error - cannot continue";
1441 for(uint32_t i=0; i<count; i++){ res[i] = 0xFFFD; }
1463 double dx,
double dy,
double dw,
double dh,
int sx,
int sy,
int sw,
int sh,
1464 uint32_t iUsage, uint32_t offBits, uint32_t cbBits, uint32_t offBmi, uint32_t cbBmi){
1467 int dibparams = U_BI_UNKNOWN;
1469 tmp_image <<
"\n\t <image\n";
1471 tmp_image <<
"\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n";
1473 tmp_image <<
" y=\"" << dy <<
"\"\n x=\"" << dx <<
"\"\n ";
1478 char *rgba_px =
nullptr;
1479 char *sub_px =
nullptr;
1480 const char *px =
nullptr;
1483 if(cbBits && cbBmi && (iUsage == U_DIB_RGB_COLORS)){
1485 dibparams = get_DIB_params((
const char *)pEmr, offBits, offBmi, &px, (
const U_RGBQUAD **) &ct,
1487 if(dibparams ==U_BI_RGB){
1488 if(sw == 0 || sh == 0){
1504 sub_px = RGBA_to_RGBA(
1512 if(!sub_px)sub_px=rgba_px;
1523 gchar *base64String=
nullptr;
1524 if(dibparams == U_BI_JPEG){
1525 tmp_image <<
" xlink:href=\"data:image/jpeg;base64,";
1526 base64String = g_base64_encode((guchar*) px, numCt );
1528 else if(dibparams==U_BI_PNG){
1529 tmp_image <<
" xlink:href=\"data:image/png;base64,";
1530 base64String = g_base64_encode((guchar*) px, numCt );
1533 tmp_image <<
" xlink:href=\"data:image/png;base64,";
1534 base64String = g_base64_encode((guchar*) mempng.
buffer, mempng.
size );
1538 tmp_image <<
" xlink:href=\"data:image/png;base64,";
1541 tmp_image << base64String;
1542 g_free(base64String);
1544 tmp_image <<
"\"\n height=\"" << dh <<
"\"\n width=\"" << dw <<
"\"\n";
1547 tmp_image <<
" preserveAspectRatio=\"none\"\n";
1548 tmp_image <<
"/> \n";
1569 const char *blimit = contents + length;
1572 uint32_t tbkMode = U_TRANSPARENT;
1579 char const* eDbgString = getenv(
"INKSCAPE_DBG_EMF" );
1580 if ( eDbgString !=
nullptr ) {
1581 if(strstr(eDbgString,
"RECORD")){ eDbgRecord = 1; }
1582 if(strstr(eDbgString,
"COMMENT")){ eDbgComment = 1; }
1583 if(strstr(eDbgString,
"FINAL")){ eDbgFinal = 1; }
1594 tsp.
taln = ALILEFT + ALIBASE;
1609 if(
off>=length)
return(0);
1613 if (!U_emf_record_sizeok(contents +
off, blimit, &nSize, &iType, 1) ||
1618 emr_mask = emr_properties(iType);
1619 if (emr_mask == U_EMR_INVALID) { badrec = 1; }
1631 std::cout <<
"record type: " << iType <<
" name " << U_emr_names(iType) <<
" length: " << nSize <<
" offset: " <<
off <<std::endl;
1646 if ((d->
dc[d->
level].
dirty & DIRTY_TEXT) || ((emr_mask != U_EMR_INVALID) && (emr_mask & U_DRAW_TEXT) && d->
tri->
dirty)){
1650 tmp_clip <<
"\n<g\n\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n>";
1701 (emr_mask != U_EMR_INVALID) &&
1702 (d->
mask & U_DRAW_VISIBLE) &&
1704 (d->
mask & U_DRAW_FORCE) ||
1705 (emr_mask & U_DRAW_ALTERS) ||
1707 (emr_mask & U_DRAW_VISIBLE) &&
1709 ( !(d->
mask & U_DRAW_ONLYTO) ) ||
1710 ((d->
mask & U_DRAW_ONLYTO) && !(emr_mask & U_DRAW_ONLYTO) )
1716 if(!(d->
path.empty())){
1721 else if(d->
mask & U_DRAW_CLOSED){
1730 d->
outsvg +=
" \" /> \n";
1743 dbg_str <<
"<!-- U_EMR_HEADER -->\n";
1745 d->
outdef +=
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n";
1755 tmp_outdef <<
"<svg\n";
1756 tmp_outdef <<
" xmlns:svg=\"http://www.w3.org/2000/svg\"\n";
1757 tmp_outdef <<
" xmlns=\"http://www.w3.org/2000/svg\"\n";
1758 tmp_outdef <<
" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n";
1759 tmp_outdef <<
" xmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\"\n";
1760 tmp_outdef <<
" version=\"1.0\"\n";
1809 " width=\"" << d->
MMX <<
"mm\"\n" <<
1810 " height=\"" << d->
MMY <<
"mm\">\n";
1816 tmp_outsvg <<
"\n</defs>\n\n";
1826 for(
int i=0; i < d->
n_obj; ++i )
1836 case U_EMR_POLYBEZIER:
1838 dbg_str <<
"<!-- U_EMR_POLYBEZIER -->\n";
1846 d->
mask |= emr_mask;
1852 for (i=1; i<pEmr->
cptl; ) {
1853 tmp_str <<
"\n\tC ";
1854 for (j=0; j<3 && i<pEmr->
cptl; j++,i++) {
1859 tmp_path << tmp_str.
str().c_str();
1865 dbg_str <<
"<!-- U_EMR_POLYGON -->\n";
1873 d->
mask |= emr_mask;
1879 for (i=1; i<pEmr->
cptl; i++) {
1885 tmp_path << tmp_str.
str().c_str();
1890 case U_EMR_POLYLINE:
1892 dbg_str <<
"<!-- U_EMR_POLYLINE -->\n";
1900 d->
mask |= emr_mask;
1906 for (i=1; i<pEmr->
cptl; i++) {
1912 tmp_path << tmp_str.
str().c_str();
1916 case U_EMR_POLYBEZIERTO:
1918 dbg_str <<
"<!-- U_EMR_POLYBEZIERTO -->\n";
1923 d->
mask |= emr_mask;
1925 for (i=0; i<pEmr->
cptl;) {
1926 tmp_path <<
"\n\tC ";
1927 for (j=0; j<3 && i<pEmr->
cptl; j++,i++) {
1935 case U_EMR_POLYLINETO:
1937 dbg_str <<
"<!-- U_EMR_POLYLINETO -->\n";
1942 d->
mask |= emr_mask;
1944 for (i=0; i<pEmr->
cptl;i++) {
1952 case U_EMR_POLYPOLYLINE:
1953 case U_EMR_POLYPOLYGON:
1955 if (lpEMFR->
iType == U_EMR_POLYPOLYLINE)
1956 dbg_str <<
"<!-- U_EMR_POLYPOLYLINE -->\n";
1957 if (lpEMFR->
iType == U_EMR_POLYPOLYGON)
1958 dbg_str <<
"<!-- U_EMR_POLYPOLYGON -->\n";
1961 unsigned int n, i, j;
1963 d->
mask |= emr_mask;
1968 for (n=0; n<pEmr->
nPolys && i<pEmr->
cptl; n++) {
1971 poly_path <<
"\n\tM " <<
pix_to_xy( d, aptl[i].x, aptl[i].y) <<
" ";
1975 poly_path <<
"\n\tL " <<
pix_to_xy( d, aptl[i].x, aptl[i].y) <<
" ";
1979 tmp_str << poly_path.
str().c_str();
1980 if (lpEMFR->
iType == U_EMR_POLYPOLYGON)
1985 tmp_path << tmp_str.
str().c_str();
1989 case U_EMR_SETWINDOWEXTEX:
1991 dbg_str <<
"<!-- U_EMR_SETWINDOWEXTEX -->\n";
2024 case U_EMR_SETWINDOWORGEX:
2026 dbg_str <<
"<!-- U_EMR_SETWINDOWORGEX -->\n";
2032 case U_EMR_SETVIEWPORTEXTEX:
2034 dbg_str <<
"<!-- U_EMR_SETVIEWPORTEXTEX -->\n";
2067 case U_EMR_SETVIEWPORTORGEX:
2069 dbg_str <<
"<!-- U_EMR_SETVIEWPORTORGEX -->\n";
2075 case U_EMR_SETBRUSHORGEX: dbg_str <<
"<!-- U_EMR_SETBRUSHORGEX -->\n";
break;
2078 dbg_str <<
"<!-- U_EMR_EOF -->\n";
2080 tmp_outsvg <<
"</svg>\n";
2085 case U_EMR_SETPIXELV: dbg_str <<
"<!-- U_EMR_SETPIXELV -->\n";
break;
2086 case U_EMR_SETMAPPERFLAGS: dbg_str <<
"<!-- U_EMR_SETMAPPERFLAGS -->\n";
break;
2087 case U_EMR_SETMAPMODE:
2089 dbg_str <<
"<!-- U_EMR_SETMAPMODE -->\n";
2091 switch (pEmr->
iMode){
2101 case U_MM_LOENGLISH:
2102 case U_MM_HIENGLISH:
2107 case U_MM_ISOTROPIC:
2108 case U_MM_ANISOTROPIC:
2113 case U_EMR_SETBKMODE:
2115 dbg_str <<
"<!-- U_EMR_SETBKMODE -->\n";
2117 tbkMode = pEmr->
iMode;
2128 case U_EMR_SETPOLYFILLMODE:
2130 dbg_str <<
"<!-- U_EMR_SETPOLYFILLMODE -->\n";
2134 (pEmr->
iMode == U_ALTERNATE
2141 dbg_str <<
"<!-- U_EMR_SETROP2 -->\n";
2146 case U_EMR_SETSTRETCHBLTMODE:
2150 dbg_str <<
"<!-- U_EMR_SETSTRETCHBLTMODE -->\n";
2153 case U_EMR_SETTEXTALIGN:
2155 dbg_str <<
"<!-- U_EMR_SETTEXTALIGN -->\n";
2161 case U_EMR_SETCOLORADJUSTMENT:
2162 dbg_str <<
"<!-- U_EMR_SETCOLORADJUSTMENT -->\n";
2164 case U_EMR_SETTEXTCOLOR:
2166 dbg_str <<
"<!-- U_EMR_SETTEXTCOLOR -->\n";
2177 case U_EMR_SETBKCOLOR:
2179 dbg_str <<
"<!-- U_EMR_SETBKCOLOR -->\n";
2191 case U_EMR_OFFSETCLIPRGN:
2193 dbg_str <<
"<!-- U_EMR_OFFSETCLIPRGN -->\n";
2207 case U_EMR_MOVETOEX:
2209 dbg_str <<
"<!-- U_EMR_MOVETOEX -->\n";
2213 d->
mask |= emr_mask;
2221 case U_EMR_SETMETARGN: dbg_str <<
"<!-- U_EMR_SETMETARGN -->\n";
break;
2222 case U_EMR_EXCLUDECLIPRECT:
2224 dbg_str <<
"<!-- U_EMR_EXCLUDECLIPRECT -->\n";
2237 tmp_path <<
"M " <<
pix_to_xy( d,
rc.left ,
rc.top ) <<
" ";
2238 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.top ) <<
" ";
2239 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.bottom ) <<
" ";
2240 tmp_path <<
"L " <<
pix_to_xy( d,
rc.left,
rc.bottom ) <<
" ";
2249 case U_EMR_INTERSECTCLIPRECT:
2251 dbg_str <<
"<!-- U_EMR_INTERSECTCLIPRECT -->\n";
2257 tmp_path <<
"M " <<
pix_to_xy( d,
rc.left ,
rc.top ) <<
" ";
2258 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.top ) <<
" ";
2259 tmp_path <<
"L " <<
pix_to_xy( d,
rc.right,
rc.bottom ) <<
" ";
2260 tmp_path <<
"L " <<
pix_to_xy( d,
rc.left,
rc.bottom ) <<
" ";
2269 case U_EMR_SCALEVIEWPORTEXTEX: dbg_str <<
"<!-- U_EMR_SCALEVIEWPORTEXTEX -->\n";
break;
2270 case U_EMR_SCALEWINDOWEXTEX: dbg_str <<
"<!-- U_EMR_SCALEWINDOWEXTEX -->\n";
break;
2272 dbg_str <<
"<!-- U_EMR_SAVEDC -->\n";
2282 case U_EMR_RESTOREDC:
2284 dbg_str <<
"<!-- U_EMR_RESTOREDC -->\n";
2287 int old_level = d->
level;
2296 while (old_level > d->
level) {
2310 case U_EMR_SETWORLDTRANSFORM:
2312 dbg_str <<
"<!-- U_EMR_SETWORLDTRANSFORM -->\n";
2318 case U_EMR_MODIFYWORLDTRANSFORM:
2320 dbg_str <<
"<!-- U_EMR_MODIFYWORLDTRANSFORM -->\n";
2323 switch (pEmr->
iMode)
2325 case U_MWT_IDENTITY:
2333 case U_MWT_LEFTMULTIPLY:
2357 float c11 = a11*b11 + a12*b21 + a13*b31;;
2358 float c12 = a11*b12 + a12*b22 + a13*b32;;
2360 float c21 = a21*b11 + a22*b21 + a23*b31;;
2361 float c22 = a21*b12 + a22*b22 + a23*b32;;
2363 float c31 = a31*b11 + a32*b21 + a33*b31;;
2364 float c32 = a31*b12 + a32*b22 + a33*b32;;
2376 case U_MWT_RIGHTMULTIPLY:
2400 float c11 = a11*b11 + a12*b21 + a13*b31;;
2401 float c12 = a11*b12 + a12*b22 + a13*b32;;
2403 float c21 = a21*b11 + a22*b21 + a23*b31;;
2404 float c22 = a21*b12 + a22*b22 + a23*b32;;
2406 float c31 = a31*b11 + a32*b21 + a33*b31;;
2407 float c32 = a31*b12 + a32*b22 + a33*b32;;
2426 case U_EMR_SELECTOBJECT:
2428 dbg_str <<
"<!-- U_EMR_SELECTOBJECT -->\n";
2433 if (
index & U_STOCK_OBJECT) {
2440 case U_DKGRAY_BRUSH:
2442 case U_LTGRAY_BRUSH:
2450 case U_DKGRAY_BRUSH:
2454 val = 128.0 / 255.0;
2456 case U_LTGRAY_BRUSH:
2457 val = 192.0 / 255.0;
2460 val = 255.0 / 255.0;
2475 float val =
index == U_BLACK_PEN ? 0 : 1;
2490 case U_EMR_CREATEPEN:
2493 case U_EMR_CREATEBRUSHINDIRECT:
2494 case U_EMR_CREATEDIBPATTERNBRUSHPT:
2495 case U_EMR_CREATEMONOBRUSH:
2498 case U_EMR_EXTCREATEPEN:
2501 case U_EMR_EXTCREATEFONTINDIRECTW:
2509 case U_EMR_CREATEPEN:
2511 dbg_str <<
"<!-- U_EMR_CREATEPEN -->\n";
2517 case U_EMR_CREATEBRUSHINDIRECT:
2519 dbg_str <<
"<!-- U_EMR_CREATEBRUSHINDIRECT -->\n";
2525 case U_EMR_DELETEOBJECT:
2526 dbg_str <<
"<!-- U_EMR_DELETEOBJECT -->\n";
2529 case U_EMR_ANGLEARC:
2530 dbg_str <<
"<!-- U_EMR_ANGLEARC -->\n";
2534 dbg_str <<
"<!-- U_EMR_ELLIPSE -->\n";
2545 tmp_ellipse <<
"cx=\"" << cx <<
"\" ";
2546 tmp_ellipse <<
"cy=\"" << cy <<
"\" ";
2547 tmp_ellipse <<
"rx=\"" << rx <<
"\" ";
2548 tmp_ellipse <<
"ry=\"" << ry <<
"\" ";
2550 d->
mask |= emr_mask;
2552 d->
outsvg +=
" <ellipse ";
2560 case U_EMR_RECTANGLE:
2562 dbg_str <<
"<!-- U_EMR_RECTANGLE -->\n";
2568 tmp_rectangle <<
"\n\tM " <<
pix_to_xy( d,
rc.left ,
rc.top ) <<
" ";
2569 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
rc.right,
rc.top ) <<
" ";
2570 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
rc.right,
rc.bottom ) <<
" ";
2571 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d,
rc.left,
rc.bottom ) <<
" ";
2572 tmp_rectangle <<
"\n\tz";
2574 d->
mask |= emr_mask;
2576 tmp_path << tmp_rectangle.
str().c_str();
2579 case U_EMR_ROUNDRECT:
2581 dbg_str <<
"<!-- U_EMR_ROUNDRECT -->\n";
2586 double f = 4.*(sqrt(2) - 1)/3;
2587 double f1 = 1.0 - f;
2588 double cnx = corner.
cx/2;
2589 double cny = corner.
cy/2;
2593 tmp_rectangle <<
"\n"
2597 tmp_rectangle <<
" C "
2604 tmp_rectangle <<
" L "
2607 tmp_rectangle <<
" C "
2614 tmp_rectangle <<
" L "
2617 tmp_rectangle <<
" C "
2624 tmp_rectangle <<
" L "
2627 tmp_rectangle <<
" C "
2634 tmp_rectangle <<
" z\n";
2637 d->
mask |= emr_mask;
2639 tmp_path << tmp_rectangle.
str().c_str();
2644 dbg_str <<
"<!-- U_EMR_ARC -->\n";
2647 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2648 int stat = emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size);
2655 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2657 d->
mask |= emr_mask;
2660 dbg_str <<
"<!-- ARC record is invalid -->\n";
2666 dbg_str <<
"<!-- U_EMR_CHORD -->\n";
2669 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2670 if(!emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size)){
2676 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2679 d->
mask |= emr_mask;
2682 dbg_str <<
"<!-- CHORD record is invalid -->\n";
2688 dbg_str <<
"<!-- U_EMR_PIE -->\n";
2691 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2692 if(!emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size)){
2693 tmp_path <<
"\n\tM " <<
pix_to_xy(d, center.
x, center.
y);
2699 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2702 d->
mask |= emr_mask;
2705 dbg_str <<
"<!-- PIE record is invalid -->\n";
2709 case U_EMR_SELECTPALETTE: dbg_str <<
"<!-- U_EMR_SELECTPALETTE -->\n";
break;
2710 case U_EMR_CREATEPALETTE: dbg_str <<
"<!-- U_EMR_CREATEPALETTE -->\n";
break;
2711 case U_EMR_SETPALETTEENTRIES: dbg_str <<
"<!-- U_EMR_SETPALETTEENTRIES -->\n";
break;
2712 case U_EMR_RESIZEPALETTE: dbg_str <<
"<!-- U_EMR_RESIZEPALETTE -->\n";
break;
2713 case U_EMR_REALIZEPALETTE: dbg_str <<
"<!-- U_EMR_REALIZEPALETTE -->\n";
break;
2714 case U_EMR_EXTFLOODFILL: dbg_str <<
"<!-- U_EMR_EXTFLOODFILL -->\n";
break;
2717 dbg_str <<
"<!-- U_EMR_LINETO -->\n";
2721 d->
mask |= emr_mask;
2729 dbg_str <<
"<!-- U_EMR_ARCTO -->\n";
2732 int f2 = (d->
arcdir == U_AD_COUNTERCLOCKWISE ? 0 : 1);
2733 if(!emr_arc_points( lpEMFR, &f1, f2, ¢er, &
start, &
end, &
size)){
2740 tmp_path <<
" " << f1 <<
"," << f2 <<
" ";
2743 d->
mask |= emr_mask;
2746 dbg_str <<
"<!-- ARCTO record is invalid -->\n";
2750 case U_EMR_POLYDRAW: dbg_str <<
"<!-- U_EMR_POLYDRAW -->\n";
break;
2751 case U_EMR_SETARCDIRECTION:
2753 dbg_str <<
"<!-- U_EMR_SETARCDIRECTION -->\n";
2755 if(d->
arcdir == U_AD_CLOCKWISE || d->
arcdir == U_AD_COUNTERCLOCKWISE){
2760 case U_EMR_SETMITERLIMIT:
2762 dbg_str <<
"<!-- U_EMR_SETMITERLIMIT -->\n";
2767 float miterlimit = *((int32_t *) &(pEmr->
eMiterLimit));
2773 case U_EMR_BEGINPATH:
2775 dbg_str <<
"<!-- U_EMR_BEGINPATH -->\n";
2778 if(d->
mask & U_DRAW_VISIBLE){
2781 d->
mask |= emr_mask;
2786 dbg_str <<
"<!-- U_EMR_ENDPATH -->\n";
2787 d->
mask &= (0xFFFFFFFF - U_DRAW_ONLYTO);
2790 case U_EMR_CLOSEFIGURE:
2792 dbg_str <<
"<!-- U_EMR_CLOSEFIGURE -->\n";
2794 tmp_path <<
"\n\tz";
2795 d->
mask |= U_DRAW_CLOSED;
2798 case U_EMR_FILLPATH:
2800 dbg_str <<
"<!-- U_EMR_FILLPATH -->\n";
2801 if(d->
mask & U_DRAW_PATH){
2802 if(!(d->
mask & U_DRAW_CLOSED)){
2803 tmp_path <<
"\n\tz";
2804 d->
mask |= U_DRAW_CLOSED;
2806 d->
mask |= emr_mask;
2811 case U_EMR_STROKEANDFILLPATH:
2813 dbg_str <<
"<!-- U_EMR_STROKEANDFILLPATH -->\n";
2814 if(d->
mask & U_DRAW_PATH){
2815 if(!(d->
mask & U_DRAW_CLOSED)){
2816 tmp_path <<
"\n\tz";
2817 d->
mask |= U_DRAW_CLOSED;
2819 d->
mask |= emr_mask;
2820 d->
drawtype = U_EMR_STROKEANDFILLPATH;
2824 case U_EMR_STROKEPATH:
2826 dbg_str <<
"<!-- U_EMR_STROKEPATH -->\n";
2827 if(d->
mask & U_DRAW_PATH){
2828 d->
mask |= emr_mask;
2833 case U_EMR_FLATTENPATH: dbg_str <<
"<!-- U_EMR_FLATTENPATH -->\n";
break;
2834 case U_EMR_WIDENPATH: dbg_str <<
"<!-- U_EMR_WIDENPATH -->\n";
break;
2835 case U_EMR_SELECTCLIPPATH:
2837 dbg_str <<
"<!-- U_EMR_SELECTCLIPPATH -->\n";
2839 int logic = pEmr->
iMode;
2841 if ((logic < U_RGN_MIN) || (logic > U_RGN_MAX)){
break; }
2847 case U_EMR_ABORTPATH:
2849 dbg_str <<
"<!-- U_EMR_ABORTPATH -->\n";
2854 case U_EMR_UNDEF69: dbg_str <<
"<!-- U_EMR_UNDEF69 -->\n";
break;
2857 dbg_str <<
"<!-- U_EMR_COMMENT -->\n";
2861 char *szTxt = (
char *) pEmr->
Data;
2863 for (uint32_t i = 0; i < pEmr->
cbData; i++) {
2865 if ( *szTxt >=
' ' && *szTxt <
'z' && *szTxt !=
'<' && *szTxt !=
'>' ) {
2872 if (
false && strlen(tmp_str.
str().c_str())) {
2873 tmp_outsvg <<
" <!-- \"";
2874 tmp_outsvg << tmp_str.
str().c_str();
2875 tmp_outsvg <<
"\" -->\n";
2880 case U_EMR_FILLRGN: dbg_str <<
"<!-- U_EMR_FILLRGN -->\n";
break;
2881 case U_EMR_FRAMERGN: dbg_str <<
"<!-- U_EMR_FRAMERGN -->\n";
break;
2882 case U_EMR_INVERTRGN: dbg_str <<
"<!-- U_EMR_INVERTRGN -->\n";
break;
2883 case U_EMR_PAINTRGN: dbg_str <<
"<!-- U_EMR_PAINTRGN -->\n";
break;
2884 case U_EMR_EXTSELECTCLIPRGN:
2886 dbg_str <<
"<!-- U_EMR_EXTSELECTCLIPRGN -->\n";
2890 if (pEmr->
iMode == U_RGN_COPY) {
2897 dbg_str <<
"<!-- U_EMR_BITBLT -->\n";
2905 if(pEmr->
dwRop == U_NOOP)
break;
2906 int32_t dx = pEmr->
Dest.
x;
2907 int32_t dy = pEmr->
Dest.
y;
2908 int32_t dw = pEmr->
cDest.
x;
2909 int32_t dh = pEmr->
cDest.
y;
2911 tmp_rectangle <<
"\n\tM " <<
pix_to_xy( d, dx, dy ) <<
" ";
2912 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, dx + dw, dy ) <<
" ";
2913 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, dx + dw, dy + dh ) <<
" ";
2914 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, dx, dy + dh ) <<
" ";
2915 tmp_rectangle <<
"\n\tz";
2917 d->
mask |= emr_mask;
2919 d->
mask |= U_DRAW_CLOSED;
2921 tmp_path << tmp_rectangle.
str().c_str();
2935 common_image_extraction(d,pEmr,dx,dy,dw,dh,sx,sy,sw,sh,
2940 case U_EMR_STRETCHBLT:
2942 dbg_str <<
"<!-- U_EMR_STRETCHBLT -->\n";
2953 int sw = pEmr->
cSrc.
x;
2954 int sh = pEmr->
cSrc.
y;
2955 common_image_extraction(d,pEmr,dx,dy,dw,dh,sx,sy,sw,sh,
2962 dbg_str <<
"<!-- U_EMR_MASKBLT -->\n";
2974 common_image_extraction(d,pEmr,dx,dy,dw,dh,sx,sy,sw,sh,
2979 case U_EMR_PLGBLT: dbg_str <<
"<!-- U_EMR_PLGBLT -->\n";
break;
2980 case U_EMR_SETDIBITSTODEVICE: dbg_str <<
"<!-- U_EMR_SETDIBITSTODEVICE -->\n";
break;
2981 case U_EMR_STRETCHDIBITS:
2994 int sx = pEmr->
Src.
x;
2995 int sy = pEmr->
Src.
y;
2996 int sw = pEmr->
cSrc.
x;
2997 int sh = pEmr->
cSrc.
y;
2998 common_image_extraction(d,pEmr,dx,dy,dw,dh,sx,sy,sw,sh,
3001 dbg_str <<
"<!-- U_EMR_STRETCHDIBITS -->\n";
3004 case U_EMR_EXTCREATEFONTINDIRECTW:
3006 dbg_str <<
"<!-- U_EMR_EXTCREATEFONTINDIRECTW -->\n";
3012 case U_EMR_EXTTEXTOUTA:
3013 case U_EMR_EXTTEXTOUTW:
3014 case U_EMR_SMALLTEXTOUT:
3016 dbg_str <<
"<!-- U_EMR_EXTTEXTOUTA/W -->\n";
3024 if(lpEMFR->
iType==U_EMR_SMALLTEXTOUT){
3047 uint32_t *dup_wt =
nullptr;
3049 if( lpEMFR->
iType==U_EMR_EXTTEXTOUTA){
3059 else if( lpEMFR->
iType==U_EMR_EXTTEXTOUTW){
3064 if(pEmrS->
fuOptions & U_ETO_SMALL_CHARS){
3084 if(*((uint8_t *)ansi_text) <= 0x1F){
3093 gchar *escaped_text = g_markup_escape_text(ansi_text, -1);
3103 tsp.
italics = FC_SLANT_OBLIQUE;
break;
3105 tsp.
italics = FC_SLANT_ITALIC;
break;
3108 tsp.
italics = FC_SLANT_ROMAN;
break;
3124 default: tsp.
weight = FC_WEIGHT_NORMAL ;
break;
3140 if( (fOptions & U_ETO_RTLREADING) || (d->
dc[d->
level].
textAlign & U_TA_RTLREADING) ){ tsp.
ldir = LDIR_RL; }
3141 else{ tsp.
ldir = LDIR_LR; }
3161 tmp_clip <<
"\n<g\n\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n>";
3174 g_free(escaped_text);
3180 case U_EMR_POLYBEZIER16:
3182 dbg_str <<
"<!-- U_EMR_POLYBEZIER16 -->\n";
3191 d->
mask |= emr_mask;
3193 tmp_str <<
"\n\tM " <<
pix_to_xy( d, apts[0].x, apts[0].y ) <<
" ";
3195 for (i=1; i<pEmr->
cpts; ) {
3196 tmp_str <<
"\n\tC ";
3197 for (j=0; j<3 && i<pEmr->
cpts; j++,i++) {
3198 tmp_str <<
pix_to_xy( d, apts[i].x, apts[i].y ) <<
" ";
3202 tmp_path << tmp_str.
str().c_str();
3206 case U_EMR_POLYGON16:
3208 dbg_str <<
"<!-- U_EMR_POLYGON16 -->\n";
3214 unsigned int first = 0;
3216 d->
mask |= emr_mask;
3219 tmp_poly <<
"\n\tM " <<
pix_to_xy( d, apts[first].x, apts[first].y ) <<
" ";
3221 for (i=first+1; i<pEmr->
cpts; i++) {
3222 tmp_poly <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y ) <<
" ";
3225 tmp_path << tmp_poly.
str().c_str();
3226 tmp_path <<
"\n\tz";
3227 d->
mask |= U_DRAW_CLOSED;
3231 case U_EMR_POLYLINE16:
3233 dbg_str <<
"<!-- U_EMR_POLYLINE16 -->\n";
3242 d->
mask |= emr_mask;
3244 tmp_str <<
"\n\tM " <<
pix_to_xy( d, apts[0].x, apts[0].y ) <<
" ";
3246 for (i=1; i<pEmr->
cpts; i++) {
3247 tmp_str <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y ) <<
" ";
3250 tmp_path << tmp_str.
str().c_str();
3254 case U_EMR_POLYBEZIERTO16:
3256 dbg_str <<
"<!-- U_EMR_POLYBEZIERTO16 -->\n";
3262 d->
mask |= emr_mask;
3264 for (i=0; i<pEmr->
cpts;) {
3265 tmp_path <<
"\n\tC ";
3266 for (j=0; j<3 && i<pEmr->
cpts; j++,i++) {
3267 tmp_path <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3273 case U_EMR_POLYLINETO16:
3275 dbg_str <<
"<!-- U_EMR_POLYLINETO16 -->\n";
3281 d->
mask |= emr_mask;
3283 for (i=0; i<pEmr->
cpts;i++) {
3284 tmp_path <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3289 case U_EMR_POLYPOLYLINE16:
3290 case U_EMR_POLYPOLYGON16:
3292 if (lpEMFR->
iType == U_EMR_POLYPOLYLINE16)
3293 dbg_str <<
"<!-- U_EMR_POLYPOLYLINE16 -->\n";
3294 if (lpEMFR->
iType == U_EMR_POLYPOLYGON16)
3295 dbg_str <<
"<!-- U_EMR_POLYPOLYGON16 -->\n";
3298 unsigned int n, i, j;
3300 d->
mask |= emr_mask;
3305 for (n=0; n<pEmr->
nPolys && i<pEmr->
cpts; n++) {
3308 poly_path <<
"\n\tM " <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3312 poly_path <<
"\n\tL " <<
pix_to_xy( d, apts[i].x, apts[i].y) <<
" ";
3316 tmp_str << poly_path.
str().c_str();
3317 if (lpEMFR->
iType == U_EMR_POLYPOLYGON16)
3322 tmp_path << tmp_str.
str().c_str();
3326 case U_EMR_POLYDRAW16: dbg_str <<
"<!-- U_EMR_POLYDRAW16 -->\n";
break;
3327 case U_EMR_CREATEMONOBRUSH:
3329 dbg_str <<
"<!-- U_EMR_CREATEDIBPATTERNBRUSHPT -->\n";
3335 case U_EMR_CREATEDIBPATTERNBRUSHPT:
3337 dbg_str <<
"<!-- U_EMR_CREATEDIBPATTERNBRUSHPT -->\n";
3343 case U_EMR_EXTCREATEPEN:
3345 dbg_str <<
"<!-- U_EMR_EXTCREATEPEN -->\n";
3351 case U_EMR_POLYTEXTOUTA: dbg_str <<
"<!-- U_EMR_POLYTEXTOUTA -->\n";
break;
3352 case U_EMR_POLYTEXTOUTW: dbg_str <<
"<!-- U_EMR_POLYTEXTOUTW -->\n";
break;
3353 case U_EMR_SETICMMODE:
3355 dbg_str <<
"<!-- U_EMR_SETICMMODE -->\n";
3360 case U_EMR_CREATECOLORSPACE: dbg_str <<
"<!-- U_EMR_CREATECOLORSPACE -->\n";
break;
3361 case U_EMR_SETCOLORSPACE: dbg_str <<
"<!-- U_EMR_SETCOLORSPACE -->\n";
break;
3362 case U_EMR_DELETECOLORSPACE: dbg_str <<
"<!-- U_EMR_DELETECOLORSPACE -->\n";
break;
3363 case U_EMR_GLSRECORD: dbg_str <<
"<!-- U_EMR_GLSRECORD -->\n";
break;
3364 case U_EMR_GLSBOUNDEDRECORD: dbg_str <<
"<!-- U_EMR_GLSBOUNDEDRECORD -->\n";
break;
3365 case U_EMR_PIXELFORMAT: dbg_str <<
"<!-- U_EMR_PIXELFORMAT -->\n";
break;
3366 case U_EMR_DRAWESCAPE: dbg_str <<
"<!-- U_EMR_DRAWESCAPE -->\n";
break;
3367 case U_EMR_EXTESCAPE: dbg_str <<
"<!-- U_EMR_EXTESCAPE -->\n";
break;
3368 case U_EMR_UNDEF107: dbg_str <<
"<!-- U_EMR_UNDEF107 -->\n";
break;
3370 case U_EMR_FORCEUFIMAPPING: dbg_str <<
"<!-- U_EMR_FORCEUFIMAPPING -->\n";
break;
3371 case U_EMR_NAMEDESCAPE: dbg_str <<
"<!-- U_EMR_NAMEDESCAPE -->\n";
break;
3372 case U_EMR_COLORCORRECTPALETTE: dbg_str <<
"<!-- U_EMR_COLORCORRECTPALETTE -->\n";
break;
3373 case U_EMR_SETICMPROFILEA: dbg_str <<
"<!-- U_EMR_SETICMPROFILEA -->\n";
break;
3374 case U_EMR_SETICMPROFILEW: dbg_str <<
"<!-- U_EMR_SETICMPROFILEW -->\n";
break;
3375 case U_EMR_ALPHABLEND: dbg_str <<
"<!-- U_EMR_ALPHABLEND -->\n";
break;
3376 case U_EMR_SETLAYOUT: dbg_str <<
"<!-- U_EMR_SETLAYOUT -->\n";
break;
3377 case U_EMR_TRANSPARENTBLT: dbg_str <<
"<!-- U_EMR_TRANSPARENTBLT -->\n";
break;
3378 case U_EMR_UNDEF117: dbg_str <<
"<!-- U_EMR_UNDEF117 -->\n";
break;
3379 case U_EMR_GRADIENTFILL:
3390 dbg_str <<
"<!-- U_EMR_GRADIENTFILL -->\n";
3395 if( pEmr->
ulMode == U_GRADIENT_FILL_RECT_H ||
3396 pEmr->
ulMode == U_GRADIENT_FILL_RECT_V
3402 tmp_rectangle <<
"\n<path d=\"";
3404 tmp_rectangle <<
"\n\tM " <<
pix_to_xy( d, tv[rcs[i].UpperLeft ].x , tv[rcs[i].UpperLeft ].y ) <<
" ";
3405 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, tv[rcs[i].LowerRight].x , tv[rcs[i].UpperLeft ].y ) <<
" ";
3406 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, tv[rcs[i].LowerRight].x , tv[rcs[i].LowerRight].y ) <<
" ";
3407 tmp_rectangle <<
"\n\tL " <<
pix_to_xy( d, tv[rcs[i].UpperLeft ].x , tv[rcs[i].LowerRight].y ) <<
" ";
3408 tmp_rectangle <<
"\n\tz\"";
3409 tmp_rectangle <<
"\n\tstyle=\"stroke:none;fill:url(#";
3411 tmp_rectangle <<
");\"\n";
3413 tmp_rectangle <<
"\tclip-path=\"url(#clipEmfPath" << d->
dc[d->
level].
clip_id <<
")\"\n";
3415 tmp_rectangle <<
"/>\n";
3417 d->
outsvg += tmp_rectangle.
str().c_str();
3419 else if(pEmr->
ulMode == U_GRADIENT_FILL_TRIANGLE){
3425 tmp_triangle <<
"\n<path d=\"";
3427 tmp_triangle <<
"\n\tM " <<
pix_to_xy( d, tv[tris[i].Vertex1].x , tv[tris[i].Vertex1].y ) <<
" ";
3428 tmp_triangle <<
"\n\tL " <<
pix_to_xy( d, tv[tris[i].Vertex2].x , tv[tris[i].Vertex2].y ) <<
" ";
3429 tmp_triangle <<
"\n\tL " <<
pix_to_xy( d, tv[tris[i].Vertex3].x , tv[tris[i].Vertex3].y ) <<
" ";
3430 tmp_triangle <<
"\n\tz\"";
3431 tmp_triangle <<
"\n\tstyle=\"stroke:none;fill:#";
3432 tmp_triangle << tmpcolor;
3433 tmp_triangle <<
";\"\n/>\n";
3435 d->
outsvg += tmp_triangle.
str().c_str();
3441 case U_EMR_SETLINKEDUFIS: dbg_str <<
"<!-- U_EMR_SETLINKEDUFIS -->\n";
break;
3442 case U_EMR_SETTEXTJUSTIFICATION: dbg_str <<
"<!-- U_EMR_SETTEXTJUSTIFICATION -->\n";
break;
3443 case U_EMR_COLORMATCHTOTARGETW: dbg_str <<
"<!-- U_EMR_COLORMATCHTOTARGETW -->\n";
break;
3444 case U_EMR_CREATECOLORSPACEW: dbg_str <<
"<!-- U_EMR_CREATECOLORSPACEW -->\n";
break;
3446 dbg_str <<
"<!-- U_EMR_??? -->\n";
3455 d->
path += tmp_path.
str().c_str();
3461 std::cout << d->
outsvg << std::endl;
3463 (void) emr_properties(U_EMR_INVALID);
3465 return(file_status);
3470 for(
int i=0; i<
name.count; i++){ free(
name.strings[i]); }
3484 char *oldlocale = g_strdup(setlocale(LC_NUMERIC,
nullptr));
3485 setlocale(LC_NUMERIC,
"C");
3496 d.
defs +=
" <pattern id=\"EMFhbasepattern\" \n";
3497 d.
defs +=
" patternUnits=\"userSpaceOnUse\"\n";
3498 d.
defs +=
" width=\"6\" \n";
3499 d.
defs +=
" height=\"6\" \n";
3500 d.
defs +=
" x=\"0\" \n";
3501 d.
defs +=
" y=\"0\"> \n";
3502 d.
defs +=
" </pattern> \n";
3507 if(emf_readdata(uri, &contents, &length))
return(
nullptr);
3514 FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP,
3515 FT_KERNING_UNSCALED);
3524 std::unique_ptr<SPDocument> doc;
3536 for (i=0; i<d.
n_obj; i++)
3552 setlocale(LC_NUMERIC, oldlocale);
3563 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
3564 "<name>" N_(
"EMF Input")
"</name>\n"
3565 "<id>org.inkscape.input.emf</id>\n"
3567 "<extension>.emf</extension>\n"
3568 "<mimetype>image/x-emf</mimetype>\n"
3569 "<filetypename>" N_(
"Enhanced Metafiles (*.emf)")
"</filetypename>\n"
3570 "<filetypetooltip>" N_(
"Enhanced Metafiles")
"</filetypetooltip>\n"
3572 "</inkscape-extension>", std::make_unique<Emf>());
3578 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI
"\">\n"
3579 "<name>" N_(
"EMF Output")
"</name>\n"
3580 "<id>org.inkscape.output.emf</id>\n"
3581 "<param name=\"textToPath\" gui-text=\"" N_(
"Convert texts to paths")
"\" type=\"bool\">true</param>\n"
3582 "<param name=\"TnrToSymbol\" gui-text=\"" N_(
"Map Unicode to Symbol font")
"\" type=\"bool\">true</param>\n"
3583 "<param name=\"TnrToWingdings\" gui-text=\"" N_(
"Map Unicode to Wingdings")
"\" type=\"bool\">true</param>\n"
3584 "<param name=\"TnrToZapfDingbats\" gui-text=\"" N_(
"Map Unicode to Zapf Dingbats")
"\" type=\"bool\">true</param>\n"
3585 "<param name=\"UsePUA\" gui-text=\"" N_(
"Use MS Unicode PUA (0xF020-0xF0FF) for converted characters")
"\" type=\"bool\">false</param>\n"
3586 "<param name=\"FixPPTCharPos\" gui-text=\"" N_(
"Compensate for PPT font bug")
"\" type=\"bool\">false</param>\n"
3587 "<param name=\"FixPPTDashLine\" gui-text=\"" N_(
"Convert dashed/dotted lines to single lines")
"\" type=\"bool\">false</param>\n"
3588 "<param name=\"FixPPTGrad2Polys\" gui-text=\"" N_(
"Convert gradients to colored polygon series")
"\" type=\"bool\">false</param>\n"
3589 "<param name=\"FixPPTLinGrad\" gui-text=\"" N_(
"Use native rectangular linear gradients")
"\" type=\"bool\">false</param>\n"
3590 "<param name=\"FixPPTPatternAsHatch\" gui-text=\"" N_(
"Map all fill patterns to standard EMF hatches")
"\" type=\"bool\">false</param>\n"
3591 "<param name=\"FixImageRot\" gui-text=\"" N_(
"Ignore image rotations")
"\" type=\"bool\">false</param>\n"
3593 "<extension>.emf</extension>\n"
3594 "<mimetype>image/x-emf</mimetype>\n"
3595 "<filetypename>" N_(
"Enhanced Metafile (*.emf)")
"</filetypename>\n"
3596 "<filetypetooltip>" N_(
"Enhanced Metafile")
"</filetypetooltip>\n"
3598 "</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.
virtual unsigned fill(Inkscape::Extension::Print *, Geom::PathVector const &, Geom::Affine const &, SPStyle const *, Geom::OptRect const &, Geom::OptRect const &, Geom::OptRect const &)
virtual unsigned stroke(Inkscape::Extension::Print *, Geom::PathVector const &, Geom::Affine const &, SPStyle const *, Geom::OptRect const &, Geom::OptRect const &, Geom::OptRect const &)
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)
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)
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)
std::unique_ptr< SPDocument > open(Inkscape::Extension::Input *mod, char const *uri, bool is_importing) override
Open a file.
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)
void save(Inkscape::Extension::Output *mod, SPDocument *doc, char const *filename) override
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.
static std::unique_ptr< SPDocument > createNewDocFromMem(std::span< char const > buffer, bool keepalive, std::string const &filename="")
SPRoot * getRoot()
Returns our SPRoot.
int ensureUpToDate(unsigned int object_modified_tag=0)
Repeatedly works on getting the document updated, since sometimes it takes more than one pass to get ...
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.
constexpr uint32_t SP_RGBA32_F_COMPOSE(double r, double g, double b, double a)
Canvas item belonging to an SVG drawing element.
Enhanced Metafile Input/Output.
Enhanced Metafile printing - implementation.
constexpr auto EMF_MAX_DC
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.
Geom::PathVector sp_pathvector_boolop(Geom::PathVector const &pathva, Geom::PathVector const &pathvb, BooleanOp bop, FillRule fra, FillRule frb)
Perform a boolean operation on two pathvectors.
void invert(const double v[16], double alpha[16])
SPRoot: SVG <svg> implementation.
EMF_DEVICE_CONTEXT dc[EMF_MAX_DC+1]
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_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
@ SP_CSS_FONT_WEIGHT_LIGHTER
@ SP_CSS_FONT_WEIGHT_NORMAL
@ SP_CSS_FONT_WEIGHT_BOLD
@ SP_CSS_FONT_WEIGHT_BOLDER
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)