typedef struct {
Dtlink_t link;
- textitem_t ti;
+ textpara_t ti;
} fitem;
typedef struct {
static void
free_fpara(Dt_t* d, fpara* p, Dtdisc_t* ds)
{
- textitem_t* ti;
+ textpara_t* ti;
if (p->lp.nitems) {
int i;
ln->lp.just = v;
if (cnt) {
int i = 0;
- ln->lp.items = N_NEW(cnt, textitem_t);
+ ln->lp.items = N_NEW(cnt, textpara_t);
fi = (fitem*)dtflatten(ilist);
for (; fi; fi = (fitem*)dtlink(fitemList,(Dtlink_t*)fi)) {
char *fname_ , *fcolor_;
textpara_t tl;
pointf p_ = {0.0, 0.0};
- textitem_t* ti;
+ textpara_t* ti;
center_x = p.x;
left_x = center_x - halfwidth_x;
void free_html_text(htmltxt_t* t)
{
htextpara_t *tl;
- textitem_t *ti;
+ textpara_t *ti;
int i, j;
if (!t) return;
int i, j, w, width;
char *fname;
textpara_t lp;
+ htmlfont_t lhf;
+ lp.font = &lhf;
for (i = 0; i < ftxt->nparas; i++) {
width = w = 0;
mxfsize = 0;
for (j = 0; j < ftxt->paras[i].nitems; j++) {
lp.str = strdup_and_subst_obj (ftxt->paras[i].items[j].str, env->obj);
if (ftxt->paras[i].items[j].font) {
+ if(ftxt->paras[i].items[j].font->flags)
+ lp.font->flags = ftxt->paras[i].items[j].font->flags;
+ else if(env->finfo.flags > 0)
+ lp.font->flags = env->finfo.flags;
+ else
+ lp.font->flags = 0;
if (ftxt->paras[i].items[j].font->size > 0)
fsize = ftxt->paras[i].items[j].font->size;
else
#define UNSET_ALIGN 0
-/* Bold, Italic, Underline */
-#define HTML_BF 1
-#define HTML_IF 2
-#define HTML_UL 4
-
- /* font information
- * If name or color is NULL, or size < 0, that attribute
- * is unspecified.
- */
- typedef struct {
- char* name;
- char* color;
- int flags:7; /* HTML_UL, HTML_IF, HTML_BF */
- int cnt; /* reference count */
- double size;
- } htmlfont_t;
-
/* paras of text within a cell
* NOTE: As required, the str field in para is utf-8.
* This translation is done when libexpat scans the input.
*/
- /* atomic unit of text emitted using a single htmlfont_t */
- typedef struct {
- char *str;
- PostscriptAlias *postscript_alias;
- void *layout;
- void (*free_layout) (void *layout);
- htmlfont_t *font;
- double size, yoffset_layout, yoffset_centerline;
- } textitem_t;
-
- /* line of textitems_t */
+ /* line of textpara_t's */
typedef struct {
- textitem_t *items;
+ textpara_t *items;
short nitems;
char just;
double size; /* width of para */
extern "C" {
#endif
+/* Bold, Italic, Underline */
+#define HTML_BF 1
+#define HTML_IF 2
+#define HTML_UL 4
+
+ /* font information
+ * If name or color is NULL, or size < 0, that attribute
+ * is unspecified.
+ */
+ typedef struct {
+ char* name;
+ char* color;
+ int flags:7; /* HTML_UL, HTML_IF, HTML_BF */
+ int cnt; /* reference count */
+ double size;
+ } htmlfont_t;
+
typedef struct _PostscriptAlias {
char* name;
char* family;
char* svg_font_style;
} PostscriptAlias;
- typedef struct textpara_t {
+ /* atomic unit of text emitted using a single htmlfont_t */
+ typedef struct {
char *str; /* stored in utf-8 */
- char *fontname;
- PostscriptAlias *postscript_alias;
+ PostscriptAlias *postscript_alias;
void *layout;
void (*free_layout) (void *layout); /* FIXME - this is ugly */
- double fontsize, width, height, yoffset_layout, yoffset_centerline;
- char just; /* 'l' 'n' 'r' */
+ htmlfont_t *font;
+ char *fontname; /* FIXME - use htmlfont_t */
+ double fontsize; /* FIXME - use htmlfont_t */
+ double size, yoffset_layout, yoffset_centerline;
+ double width, height; /* FIXME */
+ char just; /* 'l' 'n' 'r' */ /* FIXME */
} textpara_t;
#ifdef __cplusplus