From 63f1d059307d05dad713706639238d7bd15328e9 Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Fri, 23 Aug 2013 16:19:43 -0400 Subject: [PATCH] Shrink class of HTML labels handled analogously to ordinary labels --- lib/common/htmltable.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 69fd52bbc..1d8ac4e7b 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -953,8 +953,9 @@ static int size_html_txt(graph_t * g, htmltxt_t * ftxt, htmlenv_t * env) textpara_t lp; htmlfont_t lhf; double maxoffset, mxysize; - int simple = 1; /* one item per param, same font size */ + int simple = 1; /* one item per param, same font size/face, no flags */ double prev_fsize = -1; + char* prev_fname = NULL; lp.font = &lhf; @@ -964,19 +965,35 @@ static int size_html_txt(graph_t * g, htmltxt_t * ftxt, htmlenv_t * env) break; } if (ftxt->paras[i].items[0].font) { + if (ftxt->paras[i].items[0].font->flags) { + simple = 0; + break; + } if (ftxt->paras[i].items[0].font->size > 0) fsize = ftxt->paras[i].items[0].font->size; else fsize = env->finfo.size; + if (ftxt->paras[i].items[0].font->name) + fname = ftxt->paras[i].items[0].font->name; + else + fname = env->finfo.name; } - else + else { fsize = env->finfo.size; + fname = env->finfo.name; + } if (prev_fsize == -1) prev_fsize = fsize; else if (fsize != prev_fsize) { simple = 0; break; } + if (prev_fname == NULL) + prev_fname = fname; + else if (strcmp(fname,prev_fname)) { + simple = 0; + break; + } } ftxt->simple = simple; -- 2.49.0