nanogui: displaying texts/fonts
Subject:
Re: [nanogui] displaying texts/fonts
From:
Alex Holden ####@####.####
Date:
11 Feb 2006 10:24:18 +0000
Message-Id: <02695BEC-5FD0-4800-8180-1D01B16C8857@linuxhacker.org>
On 10 Feb 2006, at 21:37, Robbie wrote:
> It appears that I'll have to know (calculate, maybe) the number of
> pixels and display each separately using GrText().
I think you are looking for this API call:
/**
* GrGetGCTextSize:
* @gc: the graphics context
* @str: pointer to a text string
* @count: the length of the string
* @flags: text rendering flags (GR_TF*)
* @retwidth: pointer to the variable the width will be returned in
* @retheight: pointer to the variable the height will be returned in
* @retbase: pointer to the variable the baseline height will be
returned in
*
* Calculates the dimensions of the specified text string using the
current font
* and flags in the specified graphics context. The count argument
can be -1
* if the string is null terminated.
*/
void
GrGetGCTextSize(GR_GC_ID gc, void *str, int count, int flags,
GR_SIZE *retwidth, GR_SIZE *retheight, GR_SIZE *retbase)
--
------------ Alex Holden - http://www.alexholden.net/ ------------
If it doesn't work, you're not hitting it with a big enough hammer