Graphviz  2.29.20120524.0446
lib/common/textpara.h
Go to the documentation of this file.
00001 /* $Id$ $Revision$ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /*************************************************************************
00005  * Copyright (c) 2011 AT&T Intellectual Property 
00006  * All rights reserved. This program and the accompanying materials
00007  * are made available under the terms of the Eclipse Public License v1.0
00008  * which accompanies this distribution, and is available at
00009  * http://www.eclipse.org/legal/epl-v10.html
00010  *
00011  * Contributors: See CVS logs. Details at http://www.graphviz.org/
00012  *************************************************************************/
00013 
00014 #ifndef TEXTPARA_H
00015 #define TEXTPARA_H
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 /* Bold, Italic, Underline */
00022 #define HTML_BF 1
00023 #define HTML_IF 2
00024 #define HTML_UL 4
00025 #define HTML_SUP 8
00026 #define HTML_SUB 16
00027 
00028     /* font information
00029      * If name or color is NULL, or size < 0, that attribute
00030      * is unspecified. 
00031      */
00032     typedef struct {
00033         char*  name;
00034         char*  color;
00035         int    flags:7;  /* HTML_UL, HTML_IF, HTML_BF */
00036         int    cnt;   /* reference count */
00037         double size;
00038     } htmlfont_t;
00039 
00040     typedef struct _PostscriptAlias {
00041         char* name;
00042         char* family;
00043         char* weight;
00044         char* stretch;
00045         char* style;
00046         int xfig_code;
00047         char* svg_font_family;
00048         char* svg_font_weight;
00049         char* svg_font_style;
00050     } PostscriptAlias;
00051 
00052     /* atomic unit of text emitted using a single htmlfont_t */
00053     typedef struct {
00054         char *str;      /* stored in utf-8 */
00055         PostscriptAlias *postscript_alias;
00056         void *layout;
00057         void (*free_layout) (void *layout);   /* FIXME - this is ugly */
00058         htmlfont_t *font;
00059         char *fontname; /* FIXME - use htmlfont_t */
00060         double fontsize; /* FIXME - use htmlfont_t */
00061         double size, yoffset_layout, yoffset_centerline;
00062         double width, height; /* FIXME */
00063         char just;      /* 'l' 'n' 'r' */ /* FIXME */
00064     } textpara_t;
00065 
00066 #ifdef __cplusplus
00067 }
00068 #endif
00069 #endif