49 *fontpath =
"[internal hard-coded]";
59static int fontcmpf(
const void *a,
const void *b)
69 if (key ==
NULL || strcasecmp(key, fontname)) {
91 if (!
font->postscript_alias)
102 fprintf(stderr,
"fontname: \"%s\" resolved to: %s\n",
103 font->name, fontpath);
105 fprintf(stderr,
"fontname: unable to resolve \"%s\"\n",
font->name);
141 if (f1->
name || f2->name) {
142 if (! f1->
name)
return -1;
143 if (! f2->name)
return 1;
144 rc = strcmp(f1->
name, f2->name);
147 if (f1->
color || f2->color) {
148 if (! f1->
color)
return -1;
149 if (! f2->color)
return 1;
150 rc = strcmp(f1->
color, f2->color);
153 if (f1->
flags < f2->flags)
return -1;
154 if (f1->
flags > f2->flags)
return 1;
155 if (f1->
size < f2->size)
return -1;
156 if (f1->
size > f2->size)
return 1;
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
static void * gv_alloc(size_t size)
#define DTDISC(dc, ky, sz, lk, mkf, frf, cmpf)
CDT_API int dtclose(Dt_t *)
CDT_API Dtmethod_t * Dtoset
ordered set (self-adjusting tree)
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
bool emit_once(char *str)
bool gvtextlayout(GVC_t *gvc, textspan_t *span, char **fontpath)
platform abstraction for case-insensitive string functions
PostscriptAlias * postscript_alias
double yoffset_centerline
void(* free_layout)(void *layout)
static void estimate_textspan_size(textspan_t *span, char **fontpath)
static void * textfont_makef(void *obj, Dtdisc_t *disc)
static PostscriptAlias postscript_alias[]
static PostscriptAlias * translate_postscript_fontname(char *fontname)
pointf textspan_size(GVC_t *gvc, textspan_t *span)
Estimates size of a textspan, in points.
static void textfont_freef(void *obj)
void textfont_dict_close(GVC_t *gvc)
void textfont_dict_open(GVC_t *gvc)
static int fontcmpf(const void *a, const void *b)
static int textfont_comparf(void *key1, void *key2)
double estimate_text_width_1pt(const char *font_name, const char *text, bool bold, bool italic)
lookup table for textspan