Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
textspan.h
Go to the documentation of this file.
1
8/*************************************************************************
9 * Copyright (c) 2011 AT&T Intellectual Property
10 * All rights reserved. This program and the accompanying materials
11 * are made available under the terms of the Eclipse Public License v1.0
12 * which accompanies this distribution, and is available at
13 * https://www.eclipse.org/legal/epl-v10.html
14 *
15 * Contributors: Details at https://graphviz.org
16 *************************************************************************/
17
18#pragma once
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#define GV_TEXTFONT_FLAGS_WIDTH 7
25
26/* Bold, Italic, Underline, Sup, Sub, Strike */
27/* Stored in textfont_t.flags, which is GV_TEXTFONT_FLAGS_WIDTH bits, so full */
28/* Probably should be moved to textspan_t */
29#define HTML_BF (1 << 0)
30#define HTML_IF (1 << 1)
31#define HTML_UL (1 << 2)
32#define HTML_SUP (1 << 3)
33#define HTML_SUB (1 << 4)
34#define HTML_S (1 << 5)
35#define HTML_OL (1 << 6)
36
48
49 /* font information
50 * If name or color is NULL, or size < 0, that attribute
51 * is unspecified.
52 */
53 typedef struct {
54 char* name;
55 char* color;
57 double size;
58 unsigned int flags:GV_TEXTFONT_FLAGS_WIDTH; // HTML_UL, HTML_IF, HTML_BF, etc.
59 unsigned int cnt:(sizeof(unsigned int) * 8 - GV_TEXTFONT_FLAGS_WIDTH);
61 } textfont_t;
62
63 /* atomic unit of text emitted using a single htmlfont_t */
64 typedef struct {
65 char *str; /* stored in utf-8 */
67 void *layout;
68 void (*free_layout) (void *layout); /* FIXME - this is ugly */
69 double yoffset_layout, yoffset_centerline;
71 char just;
72 } textspan_t;
73
74#ifdef __cplusplus
75}
76#endif
static int layout(graph_t *g, layout_info *infop)
Definition layout.c:811
char * svg_font_style
Definition textspan.h:46
char * svg_font_weight
Definition textspan.h:45
char * svg_font_family
Definition textspan.h:44
char * color
Definition textspan.h:55
char * name
Definition textspan.h:54
PostscriptAlias * postscript_alias
Definition textspan.h:56
unsigned int flags
Definition textspan.h:58
double size
Definition textspan.h:57
unsigned int cnt
reference count
Definition textspan.h:59
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
struct _PostscriptAlias PostscriptAlias
#define GV_TEXTFONT_FLAGS_WIDTH
Definition textspan.h:24