Graphviz 14.0.1~dev.20250923.2039
Loading...
Searching...
No Matches
gvrender_lasi.cpp
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <cstdlib>
12#include <iostream>
13#include <fstream>
14#include <stdexcept>
15#include <string>
16#include <LASi.h>
17
18#include "config.h"
19
20#include <gvc/gvplugin_render.h>
21#include <gvc/gvplugin_device.h>
22#include <gvc/gvio.h>
23#include <gvc/gvcint.h>
24#include <common/const.h>
25#include <common/utils.h>
26#include <util/agxbuf.h>
27#include <util/prisize_t.h>
28#include <util/unreachable.h>
29#include "../core/ps.h"
30
31using namespace LASi;
32using namespace std;
33
34// J$: added `pdfmark' URL embedding. PostScript rendered from
35// dot files with URL attributes will get active PDF links
36// from Adobe's Distiller.
37#define PDFMAX 14400
38
40
41struct Context {
42 using write_fn = size_t(*)(GVJ_t*, const char*, size_t);
43
45
46 PostscriptDocument doc;
48};
49
50static size_t lasi_head_writer(GVJ_t * job, const char *s, size_t len)
51{
52 Context *ctxt = reinterpret_cast<Context*>(job->context);
53 ctxt->doc.osHeader() << s;
54 return len;
55}
56
57static size_t lasi_body_writer(GVJ_t * job, const char *s, size_t len)
58{
59 Context *ctxt = reinterpret_cast<Context*>(job->context);
60 ctxt->doc.osBody() << s;
61 return len;
62}
63
64static size_t lasi_footer_writer(GVJ_t * job, const char *s, size_t len)
65{
66 Context *ctxt = reinterpret_cast<Context*>(job->context);
67 ctxt->doc.osFooter() << s;
68 return len;
69}
70
71static void lasi_begin_job(GVJ_t * job)
72{
73 job->context = new Context(job->gvc->write_fn);
75
76 gvprintf(job, "%%%%Creator: %s version %s (%s)\n",
77 job->common->info[0], job->common->info[1], job->common->info[2]);
78}
79
80static void lasi_end_job(GVJ_t * job)
81{
83
84 if (job->render.id != FORMAT_EPS)
85 gvprintf(job, "%%%%Pages: %d\n", job->common->viewNum);
86 if (job->common->show_boxes == nullptr)
87 if (job->render.id != FORMAT_EPS)
88 gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
89 job->boundingBox.LL.x, job->boundingBox.LL.y,
90 job->boundingBox.UR.x, job->boundingBox.UR.y);
91 gvputs(job, "end\nrestore\n");
92
93 {
94 // create the new stream to "redirect" cout's output to
95 ostringstream output;
96
97 // smart class that will swap streambufs and replace them
98 // when object goes out of scope.
99 class StreamBuf_Swapper
100 {
101 public:
102 StreamBuf_Swapper(ostream & orig, ostream & replacement)
103 : buf_(orig.rdbuf()), str_(orig)
104 {
105 orig.rdbuf(replacement.rdbuf());
106 }
107 ~StreamBuf_Swapper()
108 {
109 str_.rdbuf(buf_);
110 }
111 private:
112 std::streambuf * buf_;
113 std::ostream & str_;
114 } swapper(cout, output);
115
116 Context *ctxt = reinterpret_cast<Context*>(job->context);
117 ctxt->doc.write(cout);
118
119 job->gvc->write_fn = ctxt->save_write_fn;
120 gvputs(job, output.str().c_str());
121
122 delete ctxt;
123 }
124}
125
126static void lasi_begin_graph(GVJ_t * job)
127{
128 obj_state_t *obj = job->obj;
129
131
132 if (job->common->viewNum == 0) {
133 gvprintf(job, "%%%%Title: %s\n", agnameof(obj->u.g));
134 if (job->render.id != FORMAT_EPS)
135 gvputs(job, "%%Pages: (atend)\n");
136 else
137 gvputs(job, "%%Pages: 1\n");
138 if (job->common->show_boxes == nullptr) {
139 if (job->render.id != FORMAT_EPS)
140 gvputs(job, "%%BoundingBox: (atend)\n");
141 else
142 gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
145 }
146 gvputs(job, "%%EndComments\nsave\n");
147 // include shape library
148 cat_libfile(job, job->common->lib, ps_txt);
149 // include epsf
150 epsf_define(job);
151 if (job->common->show_boxes) {
152 const char *args[2] = {job->common->show_boxes[0]};
153 cat_libfile(job, nullptr, args);
154 }
155 }
156 // Set base URL for relative links (for Distiller ≥ 3.0)
157 if (obj->url) {
158 char *const ps = ps_string(obj->url, CHAR_UTF8);
159 gvprintf(job, "[ {Catalog} << /URI << /Base %s >> >>\n/PUT pdfmark\n", ps);
160 free(ps);
161 }
162}
163
164static void lasi_begin_layer(GVJ_t * job, char*, int layerNum, int numLayers)
165{
166 gvprintf(job, "%d %d setlayer\n", layerNum, numLayers);
167}
168
169static void lasi_begin_page(GVJ_t * job)
170{
171 box pbr = job->pageBoundingBox;
172
173 gvprintf(job, "%%%%Page: %d %d\n",
174 job->common->viewNum + 1, job->common->viewNum + 1);
175 if (job->common->show_boxes == nullptr)
176 gvprintf(job, "%%%%PageBoundingBox: %d %d %d %d\n",
177 pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
178 gvprintf(job, "%%%%PageOrientation: %s\n",
179 (job->rotation ? "Landscape" : "Portrait"));
180 if (job->render.id == FORMAT_PS2)
181 gvprintf(job, "<< /PageSize [%d %d] >> setpagedevice\n",
182 pbr.UR.x, pbr.UR.y);
183 gvprintf(job, "%d %d %d beginpage\n",
184 job->pagesArrayElem.x, job->pagesArrayElem.y, job->numPages);
185 if (job->common->show_boxes == nullptr)
186 gvprintf(job, "gsave\n%d %d %d %d boxprim clip newpath\n",
187 pbr.LL.x, pbr.LL.y, pbr.UR.x-pbr.LL.x, pbr.UR.y-pbr.LL.y);
188 gvprintf(job, "%g %g set_scale %d rotate %g %g translate\n",
189 job->scale.x, job->scale.y,
190 job->rotation,
191 job->translation.x, job->translation.y);
192
193 // Define the size of the PS canvas
194 if (job->render.id == FORMAT_PS2) {
195 if (pbr.UR.x >= PDFMAX || pbr.UR.y >= PDFMAX)
196 job->common->errorfn("canvas size (%d,%d) exceeds PDF limit (%d)\n"
197 "\t(suggest setting a bounding box size, see dot(1))\n",
198 pbr.UR.x, pbr.UR.y, PDFMAX);
199 gvprintf(job, "[ /CropBox [%d %d %d %d] /PAGES pdfmark\n",
200 pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
201 }
202}
203
204static void lasi_end_page(GVJ_t * job)
205{
206 if (job->common->show_boxes) {
207 gvputs(job, "0 0 0 edgecolor\n");
208 cat_libfile(job, nullptr, job->common->show_boxes + 1);
209 }
210 // the showpage is really a no-op, but at least one PS processor
211 // out there needs to see this literal token. endpage does the real work.
212 gvputs(job, "endpage\nshowpage\ngrestore\n");
213 gvputs(job, "%%PageTrailer\n");
214 gvprintf(job, "%%%%EndPage: %d\n", job->common->viewNum);
215}
216
217static void lasi_begin_cluster(GVJ_t * job)
218{
219 obj_state_t *obj = job->obj;
220
221 gvprintf(job, "%% %s\n", agnameof(obj->u.sg));
222 gvputs(job, "gsave\n");
223}
224
225static void lasi_end_cluster(GVJ_t * job)
226{
227 gvputs(job, "grestore\n");
228}
229
230static void lasi_begin_node(GVJ_t * job)
231{
232 gvputs(job, "gsave\n");
233}
234
235static void lasi_end_node(GVJ_t * job)
236{
237 gvputs(job, "grestore\n");
238}
239
240static void
242{
243 gvputs(job, "gsave\n");
244}
245
246static void lasi_end_edge(GVJ_t * job)
247{
248 gvputs(job, "grestore\n");
249}
250
251static void lasi_begin_anchor(GVJ_t *job, char *url, char*, char*, char*)
252{
253 obj_state_t *obj = job->obj;
254
255 if (url && obj->url_map_p) {
256 gvputs(job, "[ /Rect [ ");
257 gvprintpointflist(job, obj->url_map_p, 2);
258 gvputs(job, " ]\n");
259 char *const ps = ps_string(url, CHAR_UTF8);
260 gvprintf(job, " /Border [ 0 0 0 ]\n"
261 " /Action << /Subtype /URI /URI %s >>\n"
262 " /Subtype /Link\n"
263 "/ANN pdfmark\n",
264 ps);
265 free(ps);
266 }
267}
268
269static void ps_set_pen_style(GVJ_t *job)
270{
271 double penwidth = job->obj->penwidth;
272 char *p, *line, **s = job->obj->rawstyle;
273
275 gvputs(job," setlinewidth\n");
276
277 while (s && (p = line = *s++)) {
278 if (line == std::string{"setlinewidth"})
279 continue;
280 while (*p)
281 p++;
282 p++;
283 while (*p) {
284 gvprintf(job,"%s ", p);
285 while (*p)
286 p++;
287 p++;
288 }
289 if (line == std::string{"invis"})
290 job->obj->penwidth = 0;
291 gvprintf(job, "%s\n", line);
292 }
293}
294
296{
297 const char *objtype;
298
299 if (color) {
300 switch (job->obj->type) {
302 case CLUSTER_OBJTYPE:
303 objtype = "graph";
304 break;
305 case NODE_OBJTYPE:
306 objtype = "node";
307 break;
308 case EDGE_OBJTYPE:
309 objtype = "edge";
310 break;
311 default:
312 objtype = "sethsb";
313 break;
314 }
315 gvprintf(job, "%.3g %.3g %.3g %scolor\n",
316 color->u.HSVA[0], color->u.HSVA[1], color->u.HSVA[2], objtype);
317 }
318}
319
320static void lasi_textspan(GVJ_t * job, pointf p, textspan_t * span)
321{
322 const char *font;
323 const PangoFontDescription *pango_font;
324 FontStretch stretch;
325 FontStyle style;
326 FontVariant variant;
327 FontWeight weight;
328 PostscriptAlias *pA;
329
330 if (job->obj->pencolor.u.HSVA[3] < .5)
331 return; // skip transparent text
332
333 if (span->layout) {
334 pango_font = pango_layout_get_font_description((PangoLayout*)(span->layout));
335 font = pango_font_description_get_family(pango_font);
336 switch (pango_font_description_get_stretch(pango_font)) {
337 case PANGO_STRETCH_ULTRA_CONDENSED: stretch = ULTRACONDENSED; break;
338 case PANGO_STRETCH_EXTRA_CONDENSED: stretch = EXTRACONDENSED; break;
339 case PANGO_STRETCH_CONDENSED: stretch = CONDENSED; break;
340 case PANGO_STRETCH_SEMI_CONDENSED: stretch = SEMICONDENSED; break;
341 case PANGO_STRETCH_NORMAL: stretch = NORMAL_STRETCH; break;
342 case PANGO_STRETCH_SEMI_EXPANDED: stretch = SEMIEXPANDED; break;
343 case PANGO_STRETCH_EXPANDED: stretch = EXPANDED; break;
344 case PANGO_STRETCH_EXTRA_EXPANDED: stretch = EXTRAEXPANDED; break;
345 case PANGO_STRETCH_ULTRA_EXPANDED: stretch = ULTRAEXPANDED; break;
346 default:
347 UNREACHABLE();
348 }
349 switch (pango_font_description_get_style(pango_font)) {
350 case PANGO_STYLE_NORMAL: style = NORMAL_STYLE; break;
351 case PANGO_STYLE_OBLIQUE: style = OBLIQUE; break;
352 case PANGO_STYLE_ITALIC: style = ITALIC; break;
353 default:
354 UNREACHABLE();
355 }
356 switch (pango_font_description_get_variant(pango_font)) {
357 case PANGO_VARIANT_NORMAL: variant = NORMAL_VARIANT; break;
358 case PANGO_VARIANT_SMALL_CAPS: variant = SMALLCAPS; break;
359#if PANGO_VERSION_CHECK(1, 50, 0)
360 case PANGO_VARIANT_ALL_SMALL_CAPS: variant = SMALLCAPS; break;
361 case PANGO_VARIANT_PETITE_CAPS: variant = SMALLCAPS; break;
362 case PANGO_VARIANT_ALL_PETITE_CAPS: variant = SMALLCAPS; break;
363 case PANGO_VARIANT_UNICASE: variant = SMALLCAPS; break;
364 case PANGO_VARIANT_TITLE_CAPS: variant = SMALLCAPS; break;
365#endif
366 default:
367 UNREACHABLE();
368 }
369 switch (pango_font_description_get_weight(pango_font)) {
370#if PANGO_VERSION_CHECK(1, 24, 0)
371 case PANGO_WEIGHT_THIN: weight = ULTRALIGHT; break; // no exact match in LASi
372#endif
373 case PANGO_WEIGHT_ULTRALIGHT: weight = ULTRALIGHT; break;
374 case PANGO_WEIGHT_LIGHT: weight = LIGHT; break;
375#if PANGO_VERSION_CHECK(1, 36, 7)
376 case PANGO_WEIGHT_SEMILIGHT: weight = LIGHT; break; // no exact match in LASi
377#endif
378#if PANGO_VERSION_CHECK(1, 24, 0)
379 case PANGO_WEIGHT_BOOK: weight = NORMAL_WEIGHT; break; // no exact match in LASi
380#endif
381 case PANGO_WEIGHT_NORMAL: weight = NORMAL_WEIGHT; break;
382#if PANGO_VERSION_CHECK(1, 24, 0)
383 case PANGO_WEIGHT_MEDIUM: weight = NORMAL_WEIGHT; break; // no exact match in LASi
384#endif
385 case PANGO_WEIGHT_SEMIBOLD: weight = BOLD; break; /* no exact match in lasi */
386 case PANGO_WEIGHT_BOLD: weight = BOLD; break;
387 case PANGO_WEIGHT_ULTRABOLD: weight = ULTRABOLD; break;
388 case PANGO_WEIGHT_HEAVY: weight = HEAVY; break;
389#if PANGO_VERSION_CHECK(1, 24, 0)
390 case PANGO_WEIGHT_ULTRAHEAVY: weight = HEAVY; break; // no exact match in LASi
391#endif
392 default:
393 UNREACHABLE();
394 }
395 }
396 else {
397 pA = span->font->postscript_alias;
398 font = pA->svg_font_family;
399 stretch = NORMAL_STRETCH;
400 if (pA->svg_font_style && pA->svg_font_style == std::string{"italic"})
401 style = ITALIC;
402 else
403 style = NORMAL_STYLE;
404 variant = NORMAL_VARIANT;
405 if (pA->svg_font_weight && pA->svg_font_weight == std::string{"bold"})
406 weight = BOLD;
407 else
408 weight = NORMAL_WEIGHT;
409 }
410
411 ps_set_color(job, &(job->obj->pencolor));
412 Context *ctxt = reinterpret_cast<Context*>(job->context);
413 ctxt->doc.osBody() << setFont(font, style, weight, variant, stretch) << setFontSize(span->font->size) << "\n";
414 switch (span->just) {
415 case 'r':
416 p.x -= span->size.x;
417 break;
418 case 'l':
419 p.x -= 0.0;
420 break;
421 case 'n':
422 default:
423 p.x -= span->size.x / 2.0;
424 break;
425 }
426 p.y += span->yoffset_centerline;
427 gvprintpointf(job, p);
428 gvputs(job, " moveto ");
429 ctxt->doc.osBody() << show(span->str) << "\n";
430
431}
432
433static void lasi_ellipse(GVJ_t * job, pointf * A, int filled)
434{
435 // A[] contains 2 points: the center and corner.
436 pointf AA[2];
437
438 AA[0] = A[0];
439 AA[1].x = A[1].x - A[0].x;
440 AA[1].y = A[1].y - A[0].y;
441
442 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
443 ps_set_color(job, &(job->obj->fillcolor));
444 gvprintpointflist(job, AA, 2);
445 gvputs(job, " ellipse_path fill\n");
446 }
447 if (job->obj->pencolor.u.HSVA[3] > .5) {
448 ps_set_pen_style(job);
449 ps_set_color(job, &(job->obj->pencolor));
450 gvprintpointflist(job, AA, 2);
451 gvputs(job, " ellipse_path stroke\n");
452 }
453}
454
455static void lasi_bezier(GVJ_t *job, pointf *A, size_t n, int filled) {
456 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
457 ps_set_color(job, &(job->obj->fillcolor));
458 gvputs(job, "newpath ");
459 gvprintpointf(job, A[0]);
460 gvputs(job, " moveto\n");
461 for (size_t j = 1; j < n; j += 3) {
462 gvprintpointflist(job, &A[j], 3);
463 gvputs(job, " curveto\n");
464 }
465 gvputs(job, "closepath fill\n");
466 }
467 if (job->obj->pencolor.u.HSVA[3] > .5) {
468 ps_set_pen_style(job);
469 ps_set_color(job, &(job->obj->pencolor));
470 gvputs(job, "newpath ");
471 gvprintpointf(job, A[0]);
472 gvputs(job, " moveto\n");
473 for (size_t j = 1; j < n; j += 3) {
474 gvprintpointflist(job, &A[j], 3);
475 gvputs(job, " curveto\n");
476 }
477 gvputs(job, "stroke\n");
478 }
479}
480
481static void lasi_polygon(GVJ_t *job, pointf *A, size_t n, int filled) {
482 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
483 ps_set_color(job, &(job->obj->fillcolor));
484 gvputs(job, "newpath ");
485 gvprintpointf(job, A[0]);
486 gvputs(job, " moveto\n");
487 for (size_t j = 1; j < n; j++) {
488 gvprintpointf(job, A[j]);
489 gvputs(job, " lineto\n");
490 }
491 gvputs(job, "closepath fill\n");
492 }
493 if (job->obj->pencolor.u.HSVA[3] > .5) {
494 ps_set_pen_style(job);
495 ps_set_color(job, &(job->obj->pencolor));
496 gvputs(job, "newpath ");
497 gvprintpointf(job, A[0]);
498 gvputs(job, " moveto\n");
499 for (size_t j = 1; j < n; j++) {
500 gvprintpointf(job, A[j]);
501 gvputs(job, " lineto\n");
502 }
503 gvputs(job, "closepath stroke\n");
504 }
505}
506
507static void lasi_polyline(GVJ_t *job, pointf *A, size_t n) {
508 if (job->obj->pencolor.u.HSVA[3] > .5) {
509 ps_set_pen_style(job);
510 ps_set_color(job, &(job->obj->pencolor));
511 gvputs(job, "newpath ");
512 gvprintpointf(job, A[0]);
513 gvputs(job, " moveto\n");
514 for (size_t j = 1; j < n; j++) {
515 gvprintpointf(job, A[j]);
516 gvputs(job, " lineto\n");
517 }
518 gvputs(job, "stroke\n");
519 }
520}
521
522static void lasi_comment(GVJ_t * job, char *str)
523{
524 gvputs(job, "% ");
525 gvputs(job, str);
526 gvputs(job, "\n");
527}
528
529static void lasi_library_shape(GVJ_t *job, char *name, pointf *A, size_t n,
530 int filled) {
531 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
532 ps_set_color(job, &(job->obj->fillcolor));
533 gvputs(job, "[ ");
534 gvprintpointflist(job, A, n);
535 gvputs(job, " ");
536 gvprintpointf(job, A[0]);
537 gvprintf(job, " ] %" PRISIZE_T " true %s\n", n, name);
538 }
539 if (job->obj->pencolor.u.HSVA[3] > .5) {
540 ps_set_pen_style(job);
541 ps_set_color(job, &(job->obj->pencolor));
542 gvputs(job, "[ ");
543 gvprintpointflist(job, A, n);
544 gvputs(job, " ");
545 gvprintpointf(job, A[0]);
546 gvprintf(job, " ] %" PRISIZE_T " false %s\n", n, name);
547 }
548}
549
554 0, // lasi_end_graph
556 0, // lasi_end_layer
561 0, // lasi_begin_nodes
562 0, // lasi_end_nodes
563 0, // lasi_begin_edges
564 0, // lasi_end_edges
570 0, // lasi_end_anchor
571 0, // lasi_begin_label
572 0, // lasi_end_label
574 0, // lasi_resolve_color
581};
582
588 4., // default pad - graph units
589 nullptr, // knowncolors
590 0, // sizeof knowncolors
591 HSVA_DOUBLE, // color_type
592};
593
596 | GVDEVICE_DOES_LAYERS, // flags
597 {36.,36.}, // default margin - points
598 {612.,792.}, // default page width, height - points
599 {72.,72.}, // default dpi
600};
601
603 0, // flags
604 {36.,36.}, // default margin - points
605 {612.,792.}, // default page width, height - points
606 {72.,72.}, // default dpi
607};
608
611 {0, nullptr, 0, nullptr, nullptr}
612};
613
615 {FORMAT_PS, "ps:lasi", -5, nullptr, &device_features_ps},
616 {FORMAT_PS2, "ps2:lasi", -5, nullptr, &device_features_ps},
617 {FORMAT_EPS, "eps:lasi", -5, nullptr, &device_features_eps},
618 {0, nullptr, 0, nullptr, nullptr}
619};
@ HSVA_DOUBLE
Definition color.h:26
#define CHAR_UTF8
Definition const.h:196
#define A(n, t)
Definition expr.h:76
static double len(glCompPoint p)
Definition glutils.c:136
void free(void *)
char * agnameof(void *)
returns a string descriptor for the object.
Definition id.c:143
#define BOLD
Definition gv2gml.c:51
#define GVRENDER_NO_WHITE_BG
Definition gvcjob.h:106
#define GVDEVICE_DOES_PAGES
Definition gvcjob.h:87
#define GVDEVICE_DOES_LAYERS
Definition gvcjob.h:88
#define GVRENDER_DOES_MAPS
Definition gvcjob.h:97
@ CLUSTER_OBJTYPE
Definition gvcjob.h:168
@ EDGE_OBJTYPE
Definition gvcjob.h:168
@ ROOTGRAPH_OBJTYPE
Definition gvcjob.h:168
@ NODE_OBJTYPE
Definition gvcjob.h:168
#define GVRENDER_DOES_TRANSFORM
Definition gvcjob.h:95
#define GVRENDER_DOES_MAP_RECTANGLE
Definition gvcjob.h:98
static void color(Agraph_t *g)
Definition gvcolor.c:129
int gvputs(GVJ_t *job, const char *s)
Definition gvdevice.c:266
void gvprintpointflist(GVJ_t *job, pointf *p, size_t n)
Definition gvdevice.c:544
void gvprintpointf(GVJ_t *job, pointf p)
Definition gvdevice.c:530
void gvprintf(GVJ_t *job, const char *format,...)
Definition gvdevice.c:402
void gvprintdouble(GVJ_t *job, double num)
Definition gvdevice.c:513
#define ITALIC
Definition gvrender.c:131
static double penwidth[]
static gvrender_engine_t lasi_engine
static size_t lasi_head_writer(GVJ_t *job, const char *s, size_t len)
static void lasi_begin_graph(GVJ_t *job)
static gvdevice_features_t device_features_eps
static void lasi_end_cluster(GVJ_t *job)
static size_t lasi_footer_writer(GVJ_t *job, const char *s, size_t len)
static size_t lasi_body_writer(GVJ_t *job, const char *s, size_t len)
static void lasi_end_edge(GVJ_t *job)
gvplugin_installed_t gvdevice_lasi_types[]
static void lasi_begin_cluster(GVJ_t *job)
static void lasi_begin_anchor(GVJ_t *job, char *url, char *, char *, char *)
static void lasi_comment(GVJ_t *job, char *str)
static void lasi_end_node(GVJ_t *job)
static void ps_set_color(GVJ_t *job, gvcolor_t *color)
static void lasi_begin_edge(GVJ_t *job)
static void lasi_polygon(GVJ_t *job, pointf *A, size_t n, int filled)
#define PDFMAX
Maximum size of PDF page.
static void lasi_library_shape(GVJ_t *job, char *name, pointf *A, size_t n, int filled)
static gvdevice_features_t device_features_ps
gvplugin_installed_t gvrender_lasi_types[]
static void lasi_textspan(GVJ_t *job, pointf p, textspan_t *span)
static void lasi_begin_node(GVJ_t *job)
static void lasi_end_job(GVJ_t *job)
static void lasi_polyline(GVJ_t *job, pointf *A, size_t n)
@ FORMAT_EPS
@ FORMAT_PS2
@ FORMAT_PS
static void lasi_begin_job(GVJ_t *job)
static void lasi_begin_page(GVJ_t *job)
static void lasi_end_page(GVJ_t *job)
static gvrender_features_t render_features_lasi
static void lasi_ellipse(GVJ_t *job, pointf *A, int filled)
static void lasi_begin_layer(GVJ_t *job, char *, int layerNum, int numLayers)
static void lasi_bezier(GVJ_t *job, pointf *A, size_t n, int filled)
static void ps_set_pen_style(GVJ_t *job)
textitem scanner parser str
Definition htmlparse.y:218
$2 font
Definition htmlparse.y:294
static int * ps
Definition lu.c:51
#define PRISIZE_T
Definition prisize_t.h:25
static const char * ps_txt[]
Definition ps.h:5
void epsf_define(GVJ_t *job)
char * ps_string(char *ins, int chset)
void cat_libfile(GVJ_t *job, const char **arglib, const char **stdlib)
Context(write_fn fn)
PostscriptDocument doc
write_fn save_write_fn
size_t(*)(GVJ_t *, const char *, size_t) write_fn
const char ** lib
Definition gvcommon.h:26
char ** info
Definition gvcommon.h:20
void(* errorfn)(const char *fmt,...)
Definition gvcommon.h:24
const char ** show_boxes
emit code for correct box coordinates
Definition gvcommon.h:25
int viewNum
rendering state
Definition gvcommon.h:29
size_t(* write_fn)(GVJ_t *job, const char *s, size_t len)
Definition gvcint.h:104
int rotation
Definition gvcjob.h:319
obj_state_t * obj
Definition gvcjob.h:269
void * context
Definition gvcjob.h:295
point pagesArrayElem
Definition gvcjob.h:308
gvplugin_active_render_t render
Definition gvcjob.h:285
GVCOMMON_t * common
Definition gvcjob.h:267
box pageBoundingBox
Definition gvcjob.h:329
box boundingBox
Definition gvcjob.h:330
pointf scale
Definition gvcjob.h:332
GVC_t * gvc
Definition gvcjob.h:263
int numPages
Definition gvcjob.h:309
pointf translation
Definition gvcjob.h:333
char * svg_font_style
Definition textspan.h:46
char * svg_font_weight
Definition textspan.h:45
char * svg_font_family
Definition textspan.h:44
Definition geom.h:39
point LL
Definition geom.h:39
point UR
Definition geom.h:39
double HSVA[4]
Definition color.h:33
union color_s::@71 u
ingroup plugin_api
Definition gvplugin.h:35
graph_t * g
Definition gvcjob.h:186
pointf * url_map_p
Definition gvcjob.h:240
gvcolor_t fillcolor
Definition gvcjob.h:194
char * url
Definition gvcjob.h:210
obj_type type
Definition gvcjob.h:184
graph_t * sg
Definition gvcjob.h:187
gvcolor_t pencolor
Definition gvcjob.h:194
char ** rawstyle
Definition gvcjob.h:200
union obj_state_s::@97 u
double penwidth
Definition gvcjob.h:199
int y
Definition geom.h:27
int x
Definition geom.h:27
double x
Definition geom.h:29
double y
Definition geom.h:29
PostscriptAlias * postscript_alias
Definition textspan.h:56
double size
Definition textspan.h:57
char * str
Definition textspan.h:65
char just
'l' 'n' 'r'
Definition textspan.h:71
void * layout
Definition textspan.h:67
pointf size
Definition textspan.h:70
textfont_t * font
Definition textspan.h:66
double yoffset_centerline
Definition textspan.h:69
Definition grammar.c:90
#define UNREACHABLE()
Definition unreachable.h:30