c73823892aa5384025c64a22b5da8e4332d38efd braney Wed Sep 30 14:53:48 2020 -0700 get the postscript driver to allow font specification. Use the correct names for fonts. diff --git src/inc/vGfx.h src/inc/vGfx.h index 3101aba..a80afc3 100644 --- src/inc/vGfx.h +++ src/inc/vGfx.h @@ -97,31 +97,31 @@ /* Draw a segment of an anti-aliased curve within 3 points (quadratic Bezier) * Return max y value. Optionally draw curve as dashed line. */ void (*setHint)(void *v, char *hint, char *value); /* Set hint */ char *(*getHint)(void *v, char *hint); /* Get hint */ int (*getFontPixelHeight)(void *v, void *font); /* How high in pixels is font? */ int (*getFontStringWidth)(void *v, void *font, char *string); /* How wide is a string? */ - void (*setFontMethod)(void *v, unsigned int method, char *fontFile); + void (*setFontMethod)(void *v, unsigned int method, char *fontName, char *fontFile); /* Which font drawing method shoud we use. */ }; struct vGfx *vgOpenPng(int width, int height, char *fileName, boolean useTransparency); /* Open up something that will write out a PNG file upon vgClose. * If useTransparency, then the first color in memgfx's colormap/palette is * assumed to be the image background color, and pixels of that color * are made transparent. */ struct vGfx *vgOpenPostScript(int width, int height, char *fileName); /* Open up something that will someday be a PostScript file. */ void vgClose(struct vGfx **pVg); /* Close down virtual graphics object, and finish writing it to file. */ @@ -207,26 +207,26 @@ v->setHint(v->data,hint,value) /* Set hint */ #define vgGetHint(v,hint) \ v->getHint(v->data,hint) /* Get hint */ #define vgGetFontPixelHeight(v,font) \ v->getFontPixelHeight(v->data,font) /* How high in pixels is font? */ #define vgGetFontStringWidth(v,font,string) \ v->getFontStringWidth(v->data,font,string) /* How wide is a string? */ -#define vgSetFontMethod(v,method,fontFile) \ - v->setFontMethod(v->data,method,fontFile) +#define vgSetFontMethod(v,method,fontName,fontFile) \ + v->setFontMethod(v->data,method,fontName,fontFile) int vgFindRgb(struct vGfx *vg, struct rgbColor *rgb); /* Find color index corresponding to rgb color. */ Color vgContrastingColor(struct vGfx *vg, int backgroundIx); /* Return black or white whichever would be more visible over * background. */ #endif /* VGFX_H */