From 5eda58e2a80f388f9a275325f12c7a5ce16a9723 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 3 Jun 2003 17:20:17 +0000 Subject: [PATCH] fill in the font metrics api --- render2/font.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/render2/font.c b/render2/font.c index 3a21e16a..44ed5597 100644 --- a/render2/font.c +++ b/render2/font.c @@ -2,6 +2,7 @@ #include "instance.h" #include "font.h" #include +#include struct RrFont *RrFontOpen(struct RrInstance *inst, const char *fontstring) { @@ -23,7 +24,9 @@ void RrFontClose(struct RrFont *font) int RrFontMeasureString(struct RrFont *font, const char *string) { - return 20; + int w, h; + GlftMeasureString(font->font, string, strlen(string), &w, &h); + return w; } int RrFontHeight(struct RrFont *font) @@ -33,5 +36,5 @@ int RrFontHeight(struct RrFont *font) int RrFontMaxCharWidth(struct RrFont *font) { - return 5; + return GlftFontMaxCharWidth(font->font); } -- 2.34.1