Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:42:50

0001 /**
0002  * @file
0003  * @brief @ref textspan_t, @ref textfont_t, @ref PostscriptAlias
0004  * @ingroup public_apis
0005  * @ingroup common_render
0006  */
0007 
0008 /*************************************************************************
0009  * Copyright (c) 2011 AT&T Intellectual Property 
0010  * All rights reserved. This program and the accompanying materials
0011  * are made available under the terms of the Eclipse Public License v1.0
0012  * which accompanies this distribution, and is available at
0013  * https://www.eclipse.org/legal/epl-v10.html
0014  *
0015  * Contributors: Details at https://graphviz.org
0016  *************************************************************************/
0017 
0018 #pragma once
0019 
0020 #ifdef __cplusplus
0021 extern "C" {
0022 #endif
0023 
0024 #define GV_TEXTFONT_FLAGS_WIDTH 7
0025 
0026 /* Bold, Italic, Underline, Sup, Sub, Strike */
0027 /* Stored in textfont_t.flags, which is GV_TEXTFONT_FLAGS_WIDTH bits, so full */
0028 /* Probably should be moved to textspan_t */
0029 #define HTML_BF   (1 << 0)
0030 #define HTML_IF   (1 << 1)
0031 #define HTML_UL   (1 << 2)
0032 #define HTML_SUP  (1 << 3)
0033 #define HTML_SUB  (1 << 4)
0034 #define HTML_S    (1 << 5)
0035 #define HTML_OL   (1 << 6)
0036 
0037     typedef struct _PostscriptAlias {
0038         char* name;
0039         char* family;
0040         char* weight;
0041         char* stretch;
0042         char* style;
0043         int xfig_code;
0044     char* svg_font_family;
0045     char* svg_font_weight;
0046     char* svg_font_style;
0047     } PostscriptAlias;
0048 
0049     /* font information
0050      * If name or color is NULL, or size < 0, that attribute
0051      * is unspecified. 
0052      */
0053     typedef struct {
0054     char*  name;
0055     char*  color;
0056     PostscriptAlias *postscript_alias;
0057     double size;
0058     unsigned int flags:GV_TEXTFONT_FLAGS_WIDTH; // HTML_UL, HTML_IF, HTML_BF, etc.
0059     unsigned int cnt:(sizeof(unsigned int) * 8 - GV_TEXTFONT_FLAGS_WIDTH);
0060       ///< reference count
0061     } textfont_t;
0062 
0063     /* atomic unit of text emitted using a single htmlfont_t */
0064     typedef struct {
0065     char *str;      /* stored in utf-8 */
0066     textfont_t *font;
0067     void *layout;
0068     void (*free_layout) (void *layout);   /* FIXME - this is ugly */
0069     double yoffset_layout, yoffset_centerline;
0070     pointf size;
0071     char just; ///< 'l' 'n' 'r'
0072     } textspan_t;
0073 
0074 #ifdef __cplusplus
0075 }
0076 #endif