Blender  V3.3
blf_py_api.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 /* Future-proof, See https://docs.python.org/3/c-api/arg.html#strings-and-buffers */
10 #define PY_SSIZE_T_CLEAN
11 
12 #include "blf_py_api.h"
13 #include <Python.h>
14 
15 #include "../../blenfont/BLF_api.h"
16 
17 #include "BLI_utildefines.h"
18 
19 #include "python_utildefines.h"
20 
21 PyDoc_STRVAR(py_blf_position_doc,
22  ".. function:: position(fontid, x, y, z)\n"
23  "\n"
24  " Set the position for drawing text.\n"
25  "\n"
26  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
27  "font use 0.\n"
28  " :type fontid: int\n"
29  " :arg x: X axis position to draw the text.\n"
30  " :type x: float\n"
31  " :arg y: Y axis position to draw the text.\n"
32  " :type y: float\n"
33  " :arg z: Z axis position to draw the text.\n"
34  " :type z: float\n");
35 
36 static PyObject *py_blf_position(PyObject *UNUSED(self), PyObject *args)
37 {
38  int fontid;
39  float x, y, z;
40 
41  if (!PyArg_ParseTuple(args, "ifff:blf.position", &fontid, &x, &y, &z)) {
42  return NULL;
43  }
44 
45  BLF_position(fontid, x, y, z);
46 
47  Py_RETURN_NONE;
48 }
49 
50 PyDoc_STRVAR(py_blf_size_doc,
51  ".. function:: size(fontid, size, dpi)\n"
52  "\n"
53  " Set the size and DPI for drawing text.\n"
54  "\n"
55  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
56  "font use 0.\n"
57  " :type fontid: int\n"
58  " :arg size: Point size of the font.\n"
59  " :type size: float\n"
60  " :arg dpi: dots per inch value to use for drawing.\n"
61  " :type dpi: int\n");
62 static PyObject *py_blf_size(PyObject *UNUSED(self), PyObject *args)
63 {
64  int fontid, dpi;
65  float size;
66 
67  if (!PyArg_ParseTuple(args, "ifi:blf.size", &fontid, &size, &dpi)) {
68  return NULL;
69  }
70 
71  BLF_size(fontid, size, dpi);
72 
73  Py_RETURN_NONE;
74 }
75 
76 PyDoc_STRVAR(py_blf_aspect_doc,
77  ".. function:: aspect(fontid, aspect)\n"
78  "\n"
79  " Set the aspect for drawing text.\n"
80  "\n"
81  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
82  "font use 0.\n"
83  " :type fontid: int\n"
84  " :arg aspect: The aspect ratio for text drawing to use.\n"
85  " :type aspect: float\n");
86 static PyObject *py_blf_aspect(PyObject *UNUSED(self), PyObject *args)
87 {
88  float aspect;
89  int fontid;
90 
91  if (!PyArg_ParseTuple(args, "if:blf.aspect", &fontid, &aspect)) {
92  return NULL;
93  }
94 
95  BLF_aspect(fontid, aspect, aspect, 1.0);
96 
97  Py_RETURN_NONE;
98 }
99 
100 PyDoc_STRVAR(py_blf_color_doc,
101  ".. function:: color(fontid, r, g, b, a)\n"
102  "\n"
103  " Set the color for drawing text.\n"
104  "\n"
105  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
106  "font use 0.\n"
107  " :type fontid: int\n"
108  " :arg r: red channel 0.0 - 1.0.\n"
109  " :type r: float\n"
110  " :arg g: green channel 0.0 - 1.0.\n"
111  " :type g: float\n"
112  " :arg b: blue channel 0.0 - 1.0.\n"
113  " :type b: float\n"
114  " :arg a: alpha channel 0.0 - 1.0.\n"
115  " :type a: float\n");
116 static PyObject *py_blf_color(PyObject *UNUSED(self), PyObject *args)
117 {
118  int fontid;
119  float rgba[4];
120 
121  if (!PyArg_ParseTuple(
122  args, "iffff:blf.color", &fontid, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) {
123  return NULL;
124  }
125 
126  BLF_color4fv(fontid, rgba);
127 
128  Py_RETURN_NONE;
129 }
130 
131 #if BLF_BLUR_ENABLE
132 PyDoc_STRVAR(py_blf_blur_doc,
133  ".. function:: blur(fontid, radius)\n"
134  "\n"
135  " Set the blur radius for drawing text.\n"
136  "\n"
137  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
138  "font use 0.\n"
139  " :type fontid: int\n"
140  " :arg radius: The radius for blurring text (in pixels).\n"
141  " :type radius: int\n");
142 static PyObject *py_blf_blur(PyObject *UNUSED(self), PyObject *args)
143 {
144  int blur, fontid;
145 
146  if (!PyArg_ParseTuple(args, "ii:blf.blur", &fontid, &blur)) {
147  return NULL;
148  }
149 
150  BLF_blur(fontid, blur);
151 
152  Py_RETURN_NONE;
153 }
154 #endif
155 
156 PyDoc_STRVAR(py_blf_draw_doc,
157  ".. function:: draw(fontid, text)\n"
158  "\n"
159  " Draw text in the current context.\n"
160  "\n"
161  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
162  "font use 0.\n"
163  " :type fontid: int\n"
164  " :arg text: the text to draw.\n"
165  " :type text: string\n");
166 static PyObject *py_blf_draw(PyObject *UNUSED(self), PyObject *args)
167 {
168  const char *text;
169  Py_ssize_t text_length;
170  int fontid;
171 
172  if (!PyArg_ParseTuple(args, "is#:blf.draw", &fontid, &text, &text_length)) {
173  return NULL;
174  }
175 
176  BLF_draw(fontid, text, (uint)text_length);
177 
178  Py_RETURN_NONE;
179 }
180 
181 PyDoc_STRVAR(py_blf_dimensions_doc,
182  ".. function:: dimensions(fontid, text)\n"
183  "\n"
184  " Return the width and height of the text.\n"
185  "\n"
186  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
187  "font use 0.\n"
188  " :type fontid: int\n"
189  " :arg text: the text to draw.\n"
190  " :type text: string\n"
191  " :return: the width and height of the text.\n"
192  " :rtype: tuple of 2 floats\n");
193 static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
194 {
195  const char *text;
196  float r_width, r_height;
197  PyObject *ret;
198  int fontid;
199 
200  if (!PyArg_ParseTuple(args, "is:blf.dimensions", &fontid, &text)) {
201  return NULL;
202  }
203 
204  BLF_width_and_height(fontid, text, INT_MAX, &r_width, &r_height);
205 
206  ret = PyTuple_New(2);
207  PyTuple_SET_ITEMS(ret, PyFloat_FromDouble(r_width), PyFloat_FromDouble(r_height));
208  return ret;
209 }
210 
211 PyDoc_STRVAR(py_blf_clipping_doc,
212  ".. function:: clipping(fontid, xmin, ymin, xmax, ymax)\n"
213  "\n"
214  " Set the clipping, enable/disable using CLIPPING.\n"
215  "\n"
216  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
217  "font use 0.\n"
218  " :type fontid: int\n"
219  " :arg xmin: Clip the drawing area by these bounds.\n"
220  " :type xmin: float\n"
221  " :arg ymin: Clip the drawing area by these bounds.\n"
222  " :type ymin: float\n"
223  " :arg xmax: Clip the drawing area by these bounds.\n"
224  " :type xmax: float\n"
225  " :arg ymax: Clip the drawing area by these bounds.\n"
226  " :type ymax: float\n");
227 static PyObject *py_blf_clipping(PyObject *UNUSED(self), PyObject *args)
228 {
229  float xmin, ymin, xmax, ymax;
230  int fontid;
231 
232  if (!PyArg_ParseTuple(args, "iffff:blf.clipping", &fontid, &xmin, &ymin, &xmax, &ymax)) {
233  return NULL;
234  }
235 
236  BLF_clipping(fontid, xmin, ymin, xmax, ymax);
237 
238  Py_RETURN_NONE;
239 }
240 
241 PyDoc_STRVAR(py_blf_word_wrap_doc,
242  ".. function:: word_wrap(fontid, wrap_width)\n"
243  "\n"
244  " Set the wrap width, enable/disable using WORD_WRAP.\n"
245  "\n"
246  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
247  "font use 0.\n"
248  " :type fontid: int\n"
249  " :arg wrap_width: The width (in pixels) to wrap words at.\n"
250  " :type wrap_width: int\n");
251 static PyObject *py_blf_word_wrap(PyObject *UNUSED(self), PyObject *args)
252 {
253  int wrap_width;
254  int fontid;
255 
256  if (!PyArg_ParseTuple(args, "ii:blf.word_wrap", &fontid, &wrap_width)) {
257  return NULL;
258  }
259 
260  BLF_wordwrap(fontid, wrap_width);
261 
262  Py_RETURN_NONE;
263 }
264 
265 PyDoc_STRVAR(py_blf_disable_doc,
266  ".. function:: disable(fontid, option)\n"
267  "\n"
268  " Disable option.\n"
269  "\n"
270  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
271  "font use 0.\n"
272  " :type fontid: int\n"
273  " :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n"
274  " :type option: int\n");
275 static PyObject *py_blf_disable(PyObject *UNUSED(self), PyObject *args)
276 {
277  int option, fontid;
278 
279  if (!PyArg_ParseTuple(args, "ii:blf.disable", &fontid, &option)) {
280  return NULL;
281  }
282 
283  BLF_disable(fontid, option);
284 
285  Py_RETURN_NONE;
286 }
287 
288 PyDoc_STRVAR(py_blf_enable_doc,
289  ".. function:: enable(fontid, option)\n"
290  "\n"
291  " Enable option.\n"
292  "\n"
293  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
294  "font use 0.\n"
295  " :type fontid: int\n"
296  " :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n"
297  " :type option: int\n");
298 static PyObject *py_blf_enable(PyObject *UNUSED(self), PyObject *args)
299 {
300  int option, fontid;
301 
302  if (!PyArg_ParseTuple(args, "ii:blf.enable", &fontid, &option)) {
303  return NULL;
304  }
305 
306  BLF_enable(fontid, option);
307 
308  Py_RETURN_NONE;
309 }
310 
311 PyDoc_STRVAR(py_blf_rotation_doc,
312  ".. function:: rotation(fontid, angle)\n"
313  "\n"
314  " Set the text rotation angle, enable/disable using ROTATION.\n"
315  "\n"
316  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
317  "font use 0.\n"
318  " :type fontid: int\n"
319  " :arg angle: The angle for text drawing to use.\n"
320  " :type angle: float\n");
321 static PyObject *py_blf_rotation(PyObject *UNUSED(self), PyObject *args)
322 {
323  float angle;
324  int fontid;
325 
326  if (!PyArg_ParseTuple(args, "if:blf.rotation", &fontid, &angle)) {
327  return NULL;
328  }
329 
330  BLF_rotation(fontid, angle);
331 
332  Py_RETURN_NONE;
333 }
334 
335 PyDoc_STRVAR(py_blf_shadow_doc,
336  ".. function:: shadow(fontid, level, r, g, b, a)\n"
337  "\n"
338  " Shadow options, enable/disable using SHADOW .\n"
339  "\n"
340  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
341  "font use 0.\n"
342  " :type fontid: int\n"
343  " :arg level: The blur level, can be 3, 5 or 0.\n"
344  " :type level: int\n"
345  " :arg r: Shadow color (red channel 0.0 - 1.0).\n"
346  " :type r: float\n"
347  " :arg g: Shadow color (green channel 0.0 - 1.0).\n"
348  " :type g: float\n"
349  " :arg b: Shadow color (blue channel 0.0 - 1.0).\n"
350  " :type b: float\n"
351  " :arg a: Shadow color (alpha channel 0.0 - 1.0).\n"
352  " :type a: float\n");
353 static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
354 {
355  int level, fontid;
356  float rgba[4];
357 
358  if (!PyArg_ParseTuple(
359  args, "iiffff:blf.shadow", &fontid, &level, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) {
360  return NULL;
361  }
362 
363  if (!ELEM(level, 0, 3, 5)) {
364  PyErr_SetString(PyExc_TypeError, "blf.shadow expected arg to be in (0, 3, 5)");
365  return NULL;
366  }
367 
368  BLF_shadow(fontid, level, rgba);
369 
370  Py_RETURN_NONE;
371 }
372 
373 PyDoc_STRVAR(py_blf_shadow_offset_doc,
374  ".. function:: shadow_offset(fontid, x, y)\n"
375  "\n"
376  " Set the offset for shadow text.\n"
377  "\n"
378  " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default "
379  "font use 0.\n"
380  " :type fontid: int\n"
381  " :arg x: Vertical shadow offset value in pixels.\n"
382  " :type x: float\n"
383  " :arg y: Horizontal shadow offset value in pixels.\n"
384  " :type y: float\n");
385 static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
386 {
387  int x, y, fontid;
388 
389  if (!PyArg_ParseTuple(args, "iii:blf.shadow_offset", &fontid, &x, &y)) {
390  return NULL;
391  }
392 
393  BLF_shadow_offset(fontid, x, y);
394 
395  Py_RETURN_NONE;
396 }
397 
398 PyDoc_STRVAR(py_blf_load_doc,
399  ".. function:: load(filepath)\n"
400  "\n"
401  " Load a new font.\n"
402  "\n"
403  " :arg filepath: the filepath of the font.\n"
404  " :type filepath: string\n"
405  " :return: the new font's fontid or -1 if there was an error.\n"
406  " :rtype: integer\n");
407 static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
408 {
409  const char *filepath;
410 
411  if (!PyArg_ParseTuple(args, "s:blf.load", &filepath)) {
412  return NULL;
413  }
414 
415  return PyLong_FromLong(BLF_load(filepath));
416 }
417 
418 PyDoc_STRVAR(py_blf_unload_doc,
419  ".. function:: unload(filepath)\n"
420  "\n"
421  " Unload an existing font.\n"
422  "\n"
423  " :arg filepath: the filepath of the font.\n"
424  " :type filepath: string\n");
425 static PyObject *py_blf_unload(PyObject *UNUSED(self), PyObject *args)
426 {
427  const char *filepath;
428 
429  if (!PyArg_ParseTuple(args, "s:blf.unload", &filepath)) {
430  return NULL;
431  }
432 
433  BLF_unload(filepath);
434 
435  Py_RETURN_NONE;
436 }
437 
438 /*----------------------------MODULE INIT-------------------------*/
439 static PyMethodDef BLF_methods[] = {
440  {"aspect", (PyCFunction)py_blf_aspect, METH_VARARGS, py_blf_aspect_doc},
441 #if BLF_BLUR_ENABLE
442  {"blur", (PyCFunction)py_blf_blur, METH_VARARGS, py_blf_blur_doc},
443 #endif
444  {"clipping", (PyCFunction)py_blf_clipping, METH_VARARGS, py_blf_clipping_doc},
445  {"word_wrap", (PyCFunction)py_blf_word_wrap, METH_VARARGS, py_blf_word_wrap_doc},
446  {"disable", (PyCFunction)py_blf_disable, METH_VARARGS, py_blf_disable_doc},
447  {"dimensions", (PyCFunction)py_blf_dimensions, METH_VARARGS, py_blf_dimensions_doc},
448  {"draw", (PyCFunction)py_blf_draw, METH_VARARGS, py_blf_draw_doc},
449  {"enable", (PyCFunction)py_blf_enable, METH_VARARGS, py_blf_enable_doc},
450  {"position", (PyCFunction)py_blf_position, METH_VARARGS, py_blf_position_doc},
451  {"rotation", (PyCFunction)py_blf_rotation, METH_VARARGS, py_blf_rotation_doc},
452  {"shadow", (PyCFunction)py_blf_shadow, METH_VARARGS, py_blf_shadow_doc},
453  {"shadow_offset", (PyCFunction)py_blf_shadow_offset, METH_VARARGS, py_blf_shadow_offset_doc},
454  {"size", (PyCFunction)py_blf_size, METH_VARARGS, py_blf_size_doc},
455  {"color", (PyCFunction)py_blf_color, METH_VARARGS, py_blf_color_doc},
456  {"load", (PyCFunction)py_blf_load, METH_VARARGS, py_blf_load_doc},
457  {"unload", (PyCFunction)py_blf_unload, METH_VARARGS, py_blf_unload_doc},
458  {NULL, NULL, 0, NULL},
459 };
460 
461 PyDoc_STRVAR(BLF_doc, "This module provides access to Blender's text drawing functions.");
462 static struct PyModuleDef BLF_module_def = {
463  PyModuleDef_HEAD_INIT,
464  "blf", /* m_name */
465  BLF_doc, /* m_doc */
466  0, /* m_size */
467  BLF_methods, /* m_methods */
468  NULL, /* m_reload */
469  NULL, /* m_traverse */
470  NULL, /* m_clear */
471  NULL, /* m_free */
472 };
473 
474 PyObject *BPyInit_blf(void)
475 {
476  PyObject *submodule;
477 
478  submodule = PyModule_Create(&BLF_module_def);
479 
480  PyModule_AddIntConstant(submodule, "ROTATION", BLF_ROTATION);
481  PyModule_AddIntConstant(submodule, "CLIPPING", BLF_CLIPPING);
482  PyModule_AddIntConstant(submodule, "SHADOW", BLF_SHADOW);
483  PyModule_AddIntConstant(submodule, "WORD_WRAP", BLF_WORD_WRAP);
484  PyModule_AddIntConstant(submodule, "MONOCHROME", BLF_MONOCHROME);
485 
486  return submodule;
487 }
@ BLF_ROTATION
Definition: BLF_api.h:334
@ BLF_WORD_WRAP
Definition: BLF_api.h:340
@ BLF_MONOCHROME
Definition: BLF_api.h:342
@ BLF_SHADOW
Definition: BLF_api.h:336
@ BLF_CLIPPING
Definition: BLF_api.h:335
void BLF_aspect(int fontid, float x, float y, float z)
Definition: blf.c:288
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
Definition: blf.c:775
void BLF_width_and_height(int fontid, const char *str, size_t str_len, float *r_width, float *r_height) ATTR_NONNULL()
Definition: blf.c:662
void BLF_color4fv(int fontid, const float rgba[4])
Definition: blf.c:437
void BLF_shadow_offset(int fontid, int x, int y)
Definition: blf.c:806
void BLF_shadow(int fontid, int level, const float rgba[4]) ATTR_NONNULL(3)
Definition: blf.c:796
void BLF_disable(int fontid, int option)
Definition: blf.c:279
void BLF_rotation(int fontid, float angle)
Definition: blf.c:766
void BLF_draw(int fontid, const char *str, size_t str_len) ATTR_NONNULL(2)
Definition: blf.c:538
void BLF_unload(const char *name) ATTR_NONNULL()
Definition: blf.c:225
void BLF_enable(int fontid, int option)
Definition: blf.c:270
int BLF_load(const char *name) ATTR_NONNULL()
Definition: blf.c:135
void BLF_size(int fontid, float size, int dpi)
Definition: blf.c:363
void BLF_wordwrap(int fontid, int wrap_width)
Definition: blf.c:787
void BLF_position(int fontid, float x, float y, float z)
Definition: blf.c:308
unsigned int uint
Definition: BLI_sys_types.h:67
#define UNUSED(x)
#define ELEM(...)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
static PyObject * py_blf_word_wrap(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:251
static PyObject * py_blf_load(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:407
static PyObject * py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:193
static struct PyModuleDef BLF_module_def
Definition: blf_py_api.c:462
static PyObject * py_blf_draw(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:166
static PyObject * py_blf_clipping(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:227
static PyObject * py_blf_aspect(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:86
static PyObject * py_blf_position(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:36
static PyObject * py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:385
static PyMethodDef BLF_methods[]
Definition: blf_py_api.c:439
static PyObject * py_blf_enable(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:298
static PyObject * py_blf_rotation(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:321
static PyObject * py_blf_unload(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:425
static PyObject * py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:353
static PyObject * py_blf_disable(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:275
PyDoc_STRVAR(py_blf_position_doc, ".. function:: position(fontid, x, y, z)\n" "\n" " Set the position for drawing text.\n" "\n" " :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default " "font use 0.\n" " :type fontid: int\n" " :arg x: X axis position to draw the text.\n" " :type x: float\n" " :arg y: Y axis position to draw the text.\n" " :type y: float\n" " :arg z: Z axis position to draw the text.\n" " :type z: float\n")
PyObject * BPyInit_blf(void)
Definition: blf_py_api.c:474
static PyObject * py_blf_size(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:62
static PyObject * py_blf_color(PyObject *UNUSED(self), PyObject *args)
Definition: blf_py_api.c:116
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
header-only utilities
#define PyTuple_SET_ITEMS(op_arg,...)
return ret
int wrap_width(const struct SpaceText *st, struct ARegion *region)