GRASS 8 Programmer's Manual 8.6.0dev(2026)-0f6a7341fc
Loading...
Searching...
No Matches
gsd_fonts.c
Go to the documentation of this file.
1/*!
2 \file lib/ogsf/gsd_fonts.c
3
4 \brief OGSF library - loading and manipulating surfaces
5
6 GRASS OpenGL gsurf OGSF Library
7
8 \todo This file needs to be re-written in OpenGL
9
10 SPDX-FileCopyrightText: 1999-2008 GRASS Development Team
11 SPDX-License-Identifier: GPL-2.0-or-later
12
13 \author Bill Brown USACERL, GMSL/University of Illinois
14 \author Doxygenized by Martin Landa <landa.martin gmail.com> (May 2008)
15 */
16
17#include <string.h>
18#include <assert.h>
19
20#include <grass/ogsf.h>
21
22#include "rgbpack.h"
23
24/*!
25 \brief Get text width
26
27 \param s text string
28 \param size size
29
30 \return text width
31 */
32int gsd_get_txtwidth(const char *s, int size)
33{
34 int width, len;
35
36 len = strlen(s);
37 width = (size * len) / 2;
38
39 return (width);
40}
41
42/*!
43 \brief Get text height
44
45 \param size size
46
47 \return text height
48 */
49int gsd_get_txtheight(int size)
50{
51 unsigned long height;
52
53 height = size / 2;
54
55 return (height);
56}
57
58/*!
59 \brief Get text descender
60
61 yorig ??
62
63 Is this defined somewhere ?
64
65 \return 2
66 */
68{
69 return (2);
70}
71
72/*!
73 \brief Get text offset
74
75 xorig ??
76
77 Is this defined somewhere ?
78
79 \return 0
80 */
82{
83 return (0);
84}
85
86/*!
87 \brief Display label
88
89 \param fontbase font-base
90 \param lab_pos label position
91 \param txt text string
92 */
93void do_label_display(GLuint fontbase, float *lab_pos, const char *txt)
94{
98
99 return;
100}
void do_label_display(GLuint fontbase, float *lab_pos, const char *txt)
Display label.
Definition gsd_fonts.c:93
int gsd_get_txtwidth(const char *s, int size)
Get text width.
Definition gsd_fonts.c:32
int get_txtdescender(void)
Get text descender.
Definition gsd_fonts.c:67
int gsd_get_txtheight(int size)
Get text height.
Definition gsd_fonts.c:49
int get_txtxoffset(void)
Get text offset.
Definition gsd_fonts.c:81
OGSF header file (structures)
#define X
Definition ogsf.h:141
#define Y
Definition ogsf.h:142