char c, *p;
para->width = 0.0;
- para->width = fontsz;
+ para->height = fontsz;
para->xshow = NULL;
para->layout = NULL;
para->free_layout = NULL;
-#if defined(WITH_CODEGENS) && !defined(HAVE_GD_FREETYPE) && defined(HAVE_LIBGD)
- if (Output_codegen == &GD_CodeGen) {
- double scale = GD_drawing(g)->dpi / POINTS_PER_INCH;
- double fsize = fontsz * scale; /* in pixels */
- *fontpath = "[internal gd]";
- if ((p = para->str))
- para->width = strlen(p) * builtinFontWd(fsize) / scale;
- para->height = builtinFontHt(fsize) / scale;
- return;
- }
-#endif
if (!strncasecmp(fontname, "cour", 4)) {
*fontpath = "[internal courier]";
Fontwidth = courFontWidth;
}
}
-extern gdFontPtr gdFontTiny, gdFontSmall, gdFontMediumBold, gdFontLarge,
- gdFontGiant;
-
-#if defined(WITH_CODEGENS) && !defined(HAVE_GD_FREETYPE)
-/* builtinFont:
- * Map fontsz in pixels to builtin font.
- */
-static gdFontPtr builtinFont(double fsize)
-{
- if (fsize <= 8.5) {
- return gdFontTiny;
- } else if (fsize <= 9.5) {
- return gdFontSmall;
- } else if (fsize <= 10.5) {
- return gdFontMediumBold;
- } else if (fsize <= 11.5) {
- return gdFontLarge;
- } else {
- return gdFontGiant;
- }
-}
-
-int builtinFontHt(double fontsz)
-{
- gdFontPtr fp = builtinFont(fontsz);
- return fp->h;
-}
-int builtinFontWd(double fontsz)
-{
- gdFontPtr fp = builtinFont(fontsz);
- return fp->w;
-}
-#endif
-
static void gd_textpara(point p, textpara_t * para)
{
char *str, *fontlist;
#endif
#ifdef WITH_CODEGENS
-#ifndef HAVE_GD_FREETYPE
- extern void initDPI(graph_t *);
- extern double textheight(int nlines, double fontsz);
- extern int builtinFontHt(double fontsz);
- extern int builtinFontWd(double fontsz);
-#endif
extern codegen_info_t *first_codegen(void);
extern codegen_info_t *next_codegen(codegen_info_t * p);
#endif
}
}
-extern gdFontPtr gdFontTiny, gdFontSmall, gdFontMediumBold, gdFontLarge,
- gdFontGiant;
-
-#if defined(WITH_CODEGENS) && !defined(HAVE_GD_FREETYPE)
-
-/* builtinFont:
- * Map fontsz in pixels to builtin font.
- */
-static gdFontPtr builtinFont(double fsize)
-{
- if (fsize <= 8.5) {
- return gdFontTiny;
- } else if (fsize <= 9.5) {
- return gdFontSmall;
- } else if (fsize <= 10.5) {
- return gdFontMediumBold;
- } else if (fsize <= 11.5) {
- return gdFontLarge;
- } else {
- return gdFontGiant;
- }
-}
-#endif
-
static void gdgen_textpara(GVJ_t * job, pointf p, textpara_t * para)
{
gvstyle_t *style = job->style;