op->span->str = strdup (op->op.u.text.text);
op->span->just = adjust [op->op.u.text.align];
/* FIXME - use mkFont() */
- op->span->font = NEW(htmlfont_t);
+ op->span->font = NEW(textfont_t);
op->span->font->name=fontname;
op->span->font->size=fontsize;
op->span->font->flags=0;
pointf textspan_size(GVC_t *gvc, textspan_t * span)
{
char **fpp = NULL, *fontpath = NULL;
- htmlfont_t *font;
+ textfont_t *font;
assert(span->font);
+/* FIXME -- move into font creation function */
font = span->font;
font->postscript_alias = translate_postscript_fontname(font->name);
+/**/
if (Verbose && emit_once(font->name))
fpp = &fontpath;
return 0;
}
-static int fontcolorfn(htmlfont_t * p, char *v)
+static int fontcolorfn(textfont_t * p, char *v)
{
p->color = strdup(v);
return 0;
}
-static int facefn(htmlfont_t * p, char *v)
+static int facefn(textfont_t * p, char *v)
{
p->name = strdup(v);
return 0;
}
-static int ptsizefn(htmlfont_t * p, char *v)
+static int ptsizefn(textfont_t * p, char *v)
{
long u;
return img;
}
-static htmlfont_t *mkFont(char **atts, int flags, int ul)
+static textfont_t *mkFont(char **atts, int flags, int ul)
{
- htmlfont_t *font = NEW(htmlfont_t);
+ textfont_t *font = NEW(textfont_t);
font->size = -1.0; /* unassigned */
font->flags = flags;
extern int yyparse(void);
typedef struct sfont_t {
- htmlfont_t *cfont;
+ textfont_t *cfont;
struct sfont_t *pfont;
} sfont_t;
/* dupFont:
*/
-static htmlfont_t *
-dupFont (htmlfont_t *f)
+static textfont_t *
+dupFont (textfont_t *f)
{
if (f) f->cnt++;
return f;
* Fonts are allocated in the lexer.
*/
static void
-pushFont (htmlfont_t *f)
+pushFont (textfont_t *f)
{
sfont_t *ft = NEW(sfont_t);
- htmlfont_t* curfont = HTMLstate.fontstack->cfont;
+ textfont_t* curfont = HTMLstate.fontstack->cfont;
if (curfont) {
if (!f->color && curfont->color)
htmltxt_t* txt;
htmlcell_t* cell;
htmltbl_t* tbl;
- htmlfont_t* font;
+ textfont_t* font;
htmlimg_t* img;
pitem* p;
}
typedef struct {
pointf pos;
- htmlfont_t finfo;
+ textfont_t finfo;
void *obj;
graph_t *g;
char *imgscale;
* set in env. The attributes are restored via popFontInfo.
*/
static void
-pushFontInfo(htmlenv_t * env, htmlfont_t * fp, htmlfont_t * savp)
+pushFontInfo(htmlenv_t * env, textfont_t * fp, textfont_t * savp)
{
if (env->finfo.name) {
if (fp->name) {
* Restore saved font attributes.
* Copy only set values.
*/
-static void popFontInfo(htmlenv_t * env, htmlfont_t * savp)
+static void popFontInfo(htmlenv_t * env, textfont_t * savp)
{
if (savp->name)
env->finfo.name = savp->name;
static void
emit_htextspans(GVJ_t * job, int nspans, htextspan_t * spans, pointf p,
- double halfwidth_x, htmlfont_t finfo, boxf b, int simple)
+ double halfwidth_x, textfont_t finfo, boxf b, int simple)
{
int i, j;
double center_x, left_x, right_x;
textspan_t tl;
- htmlfont_t tf;
+ textfont_t tf;
pointf p_ = { 0.0, 0.0 };
textspan_t *ti;
pointf pos = env->pos;
htmlcell_t **cells = tbl->u.n.cells;
htmlcell_t *cp;
- static htmlfont_t savef;
+ static textfont_t savef;
htmlmap_data_t saved;
int anchor; /* if true, we need to undo anchor settings. */
int doAnchor = (tbl->data.href || tbl->data.target);
freeObj(job);
}
-void free_html_font(htmlfont_t * fp)
+void free_html_font(textfont_t * fp)
{
fp->cnt--;
if (fp->cnt == 0) {
double width;
char *fname;
textspan_t lp;
- htmlfont_t lhf;
+ textfont_t lhf;
double maxoffset, mxysize;
int simple = 1; /* one item per span, same font size/face, no flags */
double prev_fsize = -1;
{
int i, wd, ht;
int rv = 0;
- static htmlfont_t savef;
+ static textfont_t savef;
if (tbl->font)
pushFontInfo(env, tbl->font, &savef);
int *widths; /* widths of the columns */
int rc; /* number of rows */
int cc; /* number of columns */
- htmlfont_t *font; /* font info */
+ textfont_t *font; /* font info */
unsigned char flags;
};
extern void free_html_label(htmllabel_t *, int);
extern void free_html_data(htmldata_t *);
extern void free_html_text(htmltxt_t *);
- extern void free_html_font(htmlfont_t*);
+ extern void free_html_font(textfont_t*);
extern boxf *html_port(node_t * n, char *pname, int* sides);
extern int html_path(node_t * n, port* p, int side, boxf * rv, int *k);
span->just = terminator;
if (line && line[0]) {
/* FIXME -- use mkFont() */
- span->font = NEW(htmlfont_t);
+ span->font = NEW(textfont_t);
span->font->name = strdup(lp->fontname);
span->font->size = lp->fontsize;
span->font->color = NULL;
int flags:7; /* HTML_UL, HTML_IF, HTML_BF, etc. */
PostscriptAlias *postscript_alias;
int cnt:(sizeof(int) * 8 - 7); /* reference count */
- } htmlfont_t;
+ } textfont_t;
/* atomic unit of text emitted using a single htmlfont_t */
typedef struct {
char *str; /* stored in utf-8 */
- htmlfont_t *font;
+ textfont_t *font;
void *layout;
void (*free_layout) (void *layout); /* FIXME - this is ugly */
double yoffset_layout, yoffset_centerline;