Graphviz 16.1.0~dev.20260826.0140
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 v2.0
12 * which accompanies this distribution, and is available at
13 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
14 *
15 * Contributors: Details at https://graphviz.org
16 *************************************************************************/
17
18#pragma once
19
20#include "geom.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#define GV_TEXTFONT_FLAGS_WIDTH 7
27
28/* Bold, Italic, Underline, Sup, Sub, Strike */
29/* Stored in textfont_t.flags, which is GV_TEXTFONT_FLAGS_WIDTH bits, so full */
30/* Probably should be moved to textspan_t */
31#define HTML_BF (1 << 0)
32#define HTML_IF (1 << 1)
33#define HTML_UL (1 << 2)
34#define HTML_SUP (1 << 3)
35#define HTML_SUB (1 << 4)
36#define HTML_S (1 << 5)
37#define HTML_OL (1 << 6)
38
50
51/* font information
52 * If name or color is NULL, or size < 0, that attribute
53 * is unspecified.
54 */
55typedef struct {
56 char *name;
57 char *color;
59 double size;
60 unsigned int flags
61 : GV_TEXTFONT_FLAGS_WIDTH; // HTML_UL, HTML_IF, HTML_BF, etc.
62 unsigned int cnt : (sizeof(unsigned int) * 8 - GV_TEXTFONT_FLAGS_WIDTH);
65
66/* atomic unit of text emitted using a single htmlfont_t */
67typedef struct {
68 char *str; /* stored in utf-8 */
70 void *layout;
71 void (*free_layout)(void *layout); /* FIXME - this is ugly */
72 double yoffset_layout, yoffset_centerline;
74 char just;
76
77#ifdef __cplusplus
78}
79#endif
geometric types and macros (e.g. points and boxes)
static int layout(graph_t *g, layout_info *infop, size_t *counter)
Definition layout.c:800
char * svg_font_style
Definition textspan.h:48
char * svg_font_weight
Definition textspan.h:47
char * svg_font_family
Definition textspan.h:46
char * color
Definition textspan.h:57
char * name
Definition textspan.h:56
PostscriptAlias * postscript_alias
Definition textspan.h:58
unsigned int flags
Definition textspan.h:61
double size
Definition textspan.h:59
unsigned int cnt
reference count
Definition textspan.h:62
char * str
Definition textspan.h:68
char just
'l' 'n' 'r'
Definition textspan.h:74
void * layout
Definition textspan.h:70
pointf size
Definition textspan.h:73
textfont_t * font
Definition textspan.h:69
double yoffset_centerline
Definition textspan.h:72
struct _PostscriptAlias PostscriptAlias
#define GV_TEXTFONT_FLAGS_WIDTH
Definition textspan.h:26