[GRASS-dev] Re: North Arrow updates

Michael Barton michael.barton at asu.edu
Wed Dec 13 12:01:39 EST 2006


OK. I'll work on this later today.

Michael


On 12/12/06 10:54 PM, "Hamish" <hamish_nospam at yahoo.com> wrote:

> Michael Barton wrote:
>> It seems like a good idea to be able to set the text
>> size too. Is there a variable/command to do this?
> 
> grab the font control from panel_label.tcl
> 
> 
> lib/ogsf/gsd_objs.c:
> /**************************************************************
>  * Function to draw North Arrow takes OpenGL coords and size
>  *************************************************************/
> int gsd_north_arrow (float *pos2, float len, GLuint fontbase,
>         unsigned long arw_clr, unsigned long text_clr) {
> 
> So yes, there is C support for setting a dynamic font.
> 
> 
> Right now the nviz north arrow and scale text is hardcoded as 18pt
> in nviz/src/draw.c:
>   FontBase = load_font(TOGL_BITMAP_HELVETICA_18);
> 
> but
> 
> nviz/src/label.c uses the same thing to set the font from the controls:
> 
>     sprintf(font, "%s", argv[2]);
>     size = (int) atoi(argv[3]);
> ..
>     /* Print the label */
>     FontBase = load_font(font);
> 
> which are the second and third arguments passed to Nplace_label
> ($font and $Nv_(labelFontSize)). So mimic panel_label and then it's just
> a quick modification to draw.c to use the variable value instead of the
> hardcoded one.
> 
> 
> 
> Hamish

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton 




More information about the grass-dev mailing list