Blender  V3.3
blf.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2009 Blender Foundation. All rights reserved. */
3 
12 #include <math.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 
17 #include <ft2build.h>
18 
19 #include FT_FREETYPE_H
20 #include FT_GLYPH_H
21 
22 #include "MEM_guardedalloc.h"
23 
24 #include "BLI_math.h"
25 #include "BLI_threads.h"
26 
27 #include "BLF_api.h"
28 
29 #include "IMB_colormanagement.h"
30 
31 #include "GPU_matrix.h"
32 #include "GPU_shader.h"
33 
34 #include "blf_internal.h"
35 #include "blf_internal_types.h"
36 
37 #define BLF_RESULT_CHECK_INIT(r_info) \
38  if (r_info) { \
39  memset(r_info, 0, sizeof(*(r_info))); \
40  } \
41  ((void)0)
42 
43 /* Font array. */
45 
46 /* XXX: should these be made into global_font_'s too? */
47 
48 int blf_mono_font = -1;
50 
51 static FontBLF *blf_get(int fontid)
52 {
53  if (fontid >= 0 && fontid < BLF_MAX_FONT) {
54  return global_font[fontid];
55  }
56  return NULL;
57 }
58 
59 int BLF_init(void)
60 {
61  for (int i = 0; i < BLF_MAX_FONT; i++) {
62  global_font[i] = NULL;
63  }
64 
65  BLF_default_dpi(72);
66 
67  return blf_font_init();
68 }
69 
70 void BLF_exit(void)
71 {
72  for (int i = 0; i < BLF_MAX_FONT; i++) {
73  FontBLF *font = global_font[i];
74  if (font) {
75  blf_font_free(font);
76  global_font[i] = NULL;
77  }
78  }
79 
80  blf_font_exit();
81 }
82 
83 void BLF_cache_clear(void)
84 {
85  for (int i = 0; i < BLF_MAX_FONT; i++) {
86  FontBLF *font = global_font[i];
87  if (font) {
89  }
90  }
91 }
92 
93 bool blf_font_id_is_valid(int fontid)
94 {
95  return blf_get(fontid) != NULL;
96 }
97 
98 static int blf_search(const char *name)
99 {
100  for (int i = 0; i < BLF_MAX_FONT; i++) {
101  FontBLF *font = global_font[i];
102  if (font && (STREQ(font->name, name))) {
103  return i;
104  }
105  }
106 
107  return -1;
108 }
109 
110 static int blf_search_available(void)
111 {
112  for (int i = 0; i < BLF_MAX_FONT; i++) {
113  if (!global_font[i]) {
114  return i;
115  }
116  }
117 
118  return -1;
119 }
120 
121 bool BLF_has_glyph(int fontid, unsigned int unicode)
122 {
123  FontBLF *font = blf_get(fontid);
124  if (font) {
125  return FT_Get_Char_Index(font->face, unicode) != FT_Err_Ok;
126  }
127  return false;
128 }
129 
130 bool BLF_is_loaded(const char *name)
131 {
132  return blf_search(name) >= 0;
133 }
134 
135 int BLF_load(const char *name)
136 {
137  /* check if we already load this font. */
138  int i = blf_search(name);
139  if (i >= 0) {
140  FontBLF *font = global_font[i];
141  font->reference_count++;
142  return i;
143  }
144 
145  return BLF_load_unique(name);
146 }
147 
148 int BLF_load_unique(const char *name)
149 {
150  /* Don't search in the cache!! make a new
151  * object font, this is for keep fonts threads safe.
152  */
153  int i = blf_search_available();
154  if (i == -1) {
155  printf("Too many fonts!!!\n");
156  return -1;
157  }
158 
159  char *filepath = blf_dir_search(name);
160  if (!filepath) {
161  printf("Can't find font: %s\n", name);
162  return -1;
163  }
164 
165  FontBLF *font = blf_font_new(name, filepath);
166  MEM_freeN(filepath);
167 
168  if (!font) {
169  printf("Can't load font: %s\n", name);
170  return -1;
171  }
172 
173  font->reference_count = 1;
174  global_font[i] = font;
175  return i;
176 }
177 
178 void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size)
179 {
180  FontBLF *font = blf_get(fontid);
181 
182  if (font) {
183  blf_font_attach_from_mem(font, mem, mem_size);
184  }
185 }
186 
187 int BLF_load_mem(const char *name, const unsigned char *mem, int mem_size)
188 {
189  int i = blf_search(name);
190  if (i >= 0) {
191  // font = global_font[i]; /* UNUSED */
192  return i;
193  }
194  return BLF_load_mem_unique(name, mem, mem_size);
195 }
196 
197 int BLF_load_mem_unique(const char *name, const unsigned char *mem, int mem_size)
198 {
199  /*
200  * Don't search in the cache, make a new object font!
201  * this is to keep the font thread safe.
202  */
203  int i = blf_search_available();
204  if (i == -1) {
205  printf("Too many fonts!!!\n");
206  return -1;
207  }
208 
209  if (!mem_size) {
210  printf("Can't load font: %s from memory!!\n", name);
211  return -1;
212  }
213 
214  FontBLF *font = blf_font_new_from_mem(name, mem, mem_size);
215  if (!font) {
216  printf("Can't load font: %s from memory!!\n", name);
217  return -1;
218  }
219 
220  font->reference_count = 1;
221  global_font[i] = font;
222  return i;
223 }
224 
225 void BLF_unload(const char *name)
226 {
227  for (int i = 0; i < BLF_MAX_FONT; i++) {
228  FontBLF *font = global_font[i];
229 
230  if (font && (STREQ(font->name, name))) {
231  BLI_assert(font->reference_count > 0);
232  font->reference_count--;
233 
234  if (font->reference_count == 0) {
235  blf_font_free(font);
236  global_font[i] = NULL;
237  }
238  }
239  }
240 }
241 
242 void BLF_unload_id(int fontid)
243 {
244  FontBLF *font = blf_get(fontid);
245  if (font) {
246  BLI_assert(font->reference_count > 0);
247  font->reference_count--;
248 
249  if (font->reference_count == 0) {
250  blf_font_free(font);
251  global_font[fontid] = NULL;
252  }
253  }
254 }
255 
256 void BLF_unload_all(void)
257 {
258  for (int i = 0; i < BLF_MAX_FONT; i++) {
259  FontBLF *font = global_font[i];
260  if (font) {
261  blf_font_free(font);
262  global_font[i] = NULL;
263  }
264  }
265  blf_mono_font = -1;
267  BLF_default_set(-1);
268 }
269 
270 void BLF_enable(int fontid, int option)
271 {
272  FontBLF *font = blf_get(fontid);
273 
274  if (font) {
275  font->flags |= option;
276  }
277 }
278 
279 void BLF_disable(int fontid, int option)
280 {
281  FontBLF *font = blf_get(fontid);
282 
283  if (font) {
284  font->flags &= ~option;
285  }
286 }
287 
288 void BLF_aspect(int fontid, float x, float y, float z)
289 {
290  FontBLF *font = blf_get(fontid);
291 
292  if (font) {
293  font->aspect[0] = x;
294  font->aspect[1] = y;
295  font->aspect[2] = z;
296  }
297 }
298 
299 void BLF_matrix(int fontid, const float m[16])
300 {
301  FontBLF *font = blf_get(fontid);
302 
303  if (font) {
304  memcpy(font->m, m, sizeof(font->m));
305  }
306 }
307 
308 void BLF_position(int fontid, float x, float y, float z)
309 {
310  FontBLF *font = blf_get(fontid);
311 
312  if (font) {
313  float xa, ya, za;
314  float remainder;
315 
316  if (font->flags & BLF_ASPECT) {
317  xa = font->aspect[0];
318  ya = font->aspect[1];
319  za = font->aspect[2];
320  }
321  else {
322  xa = 1.0f;
323  ya = 1.0f;
324  za = 1.0f;
325  }
326 
327  remainder = x - floorf(x);
328  if (remainder > 0.4f && remainder < 0.6f) {
329  if (remainder < 0.5f) {
330  x -= 0.1f * xa;
331  }
332  else {
333  x += 0.1f * xa;
334  }
335  }
336 
337  remainder = y - floorf(y);
338  if (remainder > 0.4f && remainder < 0.6f) {
339  if (remainder < 0.5f) {
340  y -= 0.1f * ya;
341  }
342  else {
343  y += 0.1f * ya;
344  }
345  }
346 
347  remainder = z - floorf(z);
348  if (remainder > 0.4f && remainder < 0.6f) {
349  if (remainder < 0.5f) {
350  z -= 0.1f * za;
351  }
352  else {
353  z += 0.1f * za;
354  }
355  }
356 
357  font->pos[0] = round_fl_to_int(x);
358  font->pos[1] = round_fl_to_int(y);
359  font->pos[2] = round_fl_to_int(z);
360  }
361 }
362 
363 void BLF_size(int fontid, float size, int dpi)
364 {
365  FontBLF *font = blf_get(fontid);
366 
367  if (font) {
368  blf_font_size(font, size, dpi);
369  }
370 }
371 
372 #if BLF_BLUR_ENABLE
373 void BLF_blur(int fontid, int size)
374 {
375  FontBLF *font = blf_get(fontid);
376 
377  if (font) {
378  font->blur = size;
379  }
380 }
381 #endif
382 
383 void BLF_color4ubv(int fontid, const unsigned char rgba[4])
384 {
385  FontBLF *font = blf_get(fontid);
386 
387  if (font) {
388  font->color[0] = rgba[0];
389  font->color[1] = rgba[1];
390  font->color[2] = rgba[2];
391  font->color[3] = rgba[3];
392  }
393 }
394 
395 void BLF_color3ubv_alpha(int fontid, const unsigned char rgb[3], unsigned char alpha)
396 {
397  FontBLF *font = blf_get(fontid);
398 
399  if (font) {
400  font->color[0] = rgb[0];
401  font->color[1] = rgb[1];
402  font->color[2] = rgb[2];
403  font->color[3] = alpha;
404  }
405 }
406 
407 void BLF_color3ubv(int fontid, const unsigned char rgb[3])
408 {
409  BLF_color3ubv_alpha(fontid, rgb, 255);
410 }
411 
413  int fontid, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha)
414 {
415  FontBLF *font = blf_get(fontid);
416 
417  if (font) {
418  font->color[0] = r;
419  font->color[1] = g;
420  font->color[2] = b;
421  font->color[3] = alpha;
422  }
423 }
424 
425 void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
426 {
427  FontBLF *font = blf_get(fontid);
428 
429  if (font) {
430  font->color[0] = r;
431  font->color[1] = g;
432  font->color[2] = b;
433  font->color[3] = 255;
434  }
435 }
436 
437 void BLF_color4fv(int fontid, const float rgba[4])
438 {
439  FontBLF *font = blf_get(fontid);
440 
441  if (font) {
443  }
444 }
445 
446 void BLF_color4f(int fontid, float r, float g, float b, float a)
447 {
448  const float rgba[4] = {r, g, b, a};
449  BLF_color4fv(fontid, rgba);
450 }
451 
452 void BLF_color3fv_alpha(int fontid, const float rgb[3], float alpha)
453 {
454  float rgba[4];
455  copy_v3_v3(rgba, rgb);
456  rgba[3] = alpha;
457  BLF_color4fv(fontid, rgba);
458 }
459 
460 void BLF_color3f(int fontid, float r, float g, float b)
461 {
462  const float rgba[4] = {r, g, b, 1.0f};
463  BLF_color4fv(fontid, rgba);
464 }
465 
467 {
468  BLI_assert(g_batch.enabled == false);
469  g_batch.enabled = true;
470 }
471 
473 {
474  if (g_batch.enabled) {
475  blf_batch_draw();
476  }
477 }
478 
480 {
481  BLI_assert(g_batch.enabled == true);
482  blf_batch_draw(); /* Draw remaining glyphs */
483  g_batch.enabled = false;
484 }
485 
486 static void blf_draw_gl__start(FontBLF *font)
487 {
488  /*
489  * The pixmap alignment hack is handle
490  * in BLF_position (old ui_rasterpos_safe).
491  */
492 
493  if ((font->flags & (BLF_ROTATION | BLF_MATRIX | BLF_ASPECT)) == 0) {
494  return; /* glyphs will be translated individually and batched. */
495  }
496 
497  GPU_matrix_push();
498 
499  if (font->flags & BLF_MATRIX) {
500  GPU_matrix_mul(font->m);
501  }
502 
503  GPU_matrix_translate_3f(font->pos[0], font->pos[1], font->pos[2]);
504 
505  if (font->flags & BLF_ASPECT) {
507  }
508 
509  if (font->flags & BLF_ROTATION) {
511  }
512 }
513 
514 static void blf_draw_gl__end(FontBLF *font)
515 {
516  if ((font->flags & (BLF_ROTATION | BLF_MATRIX | BLF_ASPECT)) != 0) {
517  GPU_matrix_pop();
518  }
519 }
520 
521 void BLF_draw_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
522 {
523  FontBLF *font = blf_get(fontid);
524 
525  BLF_RESULT_CHECK_INIT(r_info);
526 
527  if (font) {
528  blf_draw_gl__start(font);
529  if (font->flags & BLF_WORD_WRAP) {
530  blf_font_draw__wrap(font, str, str_len, r_info);
531  }
532  else {
533  blf_font_draw(font, str, str_len, r_info);
534  }
535  blf_draw_gl__end(font);
536  }
537 }
538 void BLF_draw(int fontid, const char *str, const size_t str_len)
539 {
540  if (str_len == 0 || str[0] == '\0') {
541  return;
542  }
543 
544  /* Avoid bgl usage to corrupt BLF drawing. */
545  GPU_bgl_end();
546 
547  BLF_draw_ex(fontid, str, str_len, NULL);
548 }
549 
550 int BLF_draw_mono(int fontid, const char *str, const size_t str_len, int cwidth)
551 {
552  if (str_len == 0 || str[0] == '\0') {
553  return 0;
554  }
555 
556  FontBLF *font = blf_get(fontid);
557  int columns = 0;
558 
559  if (font) {
560  blf_draw_gl__start(font);
561  columns = blf_font_draw_mono(font, str, str_len, cwidth);
562  blf_draw_gl__end(font);
563  }
564 
565  return columns;
566 }
567 
569  const char *str,
570  size_t str_len,
571  BLF_GlyphBoundsFn user_fn,
572  void *user_data,
573  struct ResultBLF *r_info)
574 {
575  FontBLF *font = blf_get(fontid);
576 
577  BLF_RESULT_CHECK_INIT(r_info);
578 
579  if (font) {
580  if (font->flags & BLF_WORD_WRAP) {
581  /* TODO: word-wrap support. */
582  BLI_assert(0);
583  }
584  else {
585  blf_font_boundbox_foreach_glyph(font, str, str_len, user_fn, user_data, r_info);
586  }
587  }
588 }
589 
591  int fontid, const char *str, const size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data)
592 {
593  BLF_boundbox_foreach_glyph_ex(fontid, str, str_len, user_fn, user_data, NULL);
594 }
595 
597  int fontid, const char *str, const size_t str_len, float width, float *r_width)
598 {
599  FontBLF *font = blf_get(fontid);
600 
601  if (font) {
602  const float xa = (font->flags & BLF_ASPECT) ? font->aspect[0] : 1.0f;
603  size_t ret;
604  int width_result;
605  ret = blf_font_width_to_strlen(font, str, str_len, width / xa, &width_result);
606  if (r_width) {
607  *r_width = (float)width_result * xa;
608  }
609  return ret;
610  }
611 
612  if (r_width) {
613  *r_width = 0.0f;
614  }
615  return 0;
616 }
617 
619  int fontid, const char *str, const size_t str_len, float width, float *r_width)
620 {
621  FontBLF *font = blf_get(fontid);
622 
623  if (font) {
624  const float xa = (font->flags & BLF_ASPECT) ? font->aspect[0] : 1.0f;
625  size_t ret;
626  int width_result;
627  ret = blf_font_width_to_rstrlen(font, str, str_len, width / xa, &width_result);
628  if (r_width) {
629  *r_width = (float)width_result * xa;
630  }
631  return ret;
632  }
633 
634  if (r_width) {
635  *r_width = 0.0f;
636  }
637  return 0;
638 }
639 
641  int fontid, const char *str, const size_t str_len, rcti *r_box, struct ResultBLF *r_info)
642 {
643  FontBLF *font = blf_get(fontid);
644 
645  BLF_RESULT_CHECK_INIT(r_info);
646 
647  if (font) {
648  if (font->flags & BLF_WORD_WRAP) {
649  blf_font_boundbox__wrap(font, str, str_len, r_box, r_info);
650  }
651  else {
652  blf_font_boundbox(font, str, str_len, r_box, r_info);
653  }
654  }
655 }
656 
657 void BLF_boundbox(int fontid, const char *str, const size_t str_len, rcti *r_box)
658 {
659  BLF_boundbox_ex(fontid, str, str_len, r_box, NULL);
660 }
661 
663  int fontid, const char *str, const size_t str_len, float *r_width, float *r_height)
664 {
665  FontBLF *font = blf_get(fontid);
666 
667  if (font) {
668  blf_font_width_and_height(font, str, str_len, r_width, r_height, NULL);
669  }
670  else {
671  *r_width = *r_height = 0.0f;
672  }
673 }
674 
675 float BLF_width_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
676 {
677  FontBLF *font = blf_get(fontid);
678 
679  BLF_RESULT_CHECK_INIT(r_info);
680 
681  if (font) {
682  return blf_font_width(font, str, str_len, r_info);
683  }
684 
685  return 0.0f;
686 }
687 
688 float BLF_width(int fontid, const char *str, const size_t str_len)
689 {
690  return BLF_width_ex(fontid, str, str_len, NULL);
691 }
692 
693 float BLF_fixed_width(int fontid)
694 {
695  FontBLF *font = blf_get(fontid);
696 
697  if (font) {
698  return blf_font_fixed_width(font);
699  }
700 
701  return 0.0f;
702 }
703 
704 float BLF_height_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
705 {
706  FontBLF *font = blf_get(fontid);
707 
708  BLF_RESULT_CHECK_INIT(r_info);
709 
710  if (font) {
711  return blf_font_height(font, str, str_len, r_info);
712  }
713 
714  return 0.0f;
715 }
716 
717 float BLF_height(int fontid, const char *str, const size_t str_len)
718 {
719  return BLF_height_ex(fontid, str, str_len, NULL);
720 }
721 
722 int BLF_height_max(int fontid)
723 {
724  FontBLF *font = blf_get(fontid);
725 
726  if (font) {
727  return blf_font_height_max(font);
728  }
729 
730  return 0;
731 }
732 
733 int BLF_width_max(int fontid)
734 {
735  FontBLF *font = blf_get(fontid);
736 
737  if (font) {
738  return blf_font_width_max(font);
739  }
740 
741  return 0;
742 }
743 
744 int BLF_descender(int fontid)
745 {
746  FontBLF *font = blf_get(fontid);
747 
748  if (font) {
749  return blf_font_descender(font);
750  }
751 
752  return 0;
753 }
754 
755 int BLF_ascender(int fontid)
756 {
757  FontBLF *font = blf_get(fontid);
758 
759  if (font) {
760  return blf_font_ascender(font);
761  }
762 
763  return 0.0f;
764 }
765 
766 void BLF_rotation(int fontid, float angle)
767 {
768  FontBLF *font = blf_get(fontid);
769 
770  if (font) {
771  font->angle = angle;
772  }
773 }
774 
775 void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
776 {
777  FontBLF *font = blf_get(fontid);
778 
779  if (font) {
780  font->clip_rec.xmin = xmin;
781  font->clip_rec.ymin = ymin;
782  font->clip_rec.xmax = xmax;
783  font->clip_rec.ymax = ymax;
784  }
785 }
786 
787 void BLF_wordwrap(int fontid, int wrap_width)
788 {
789  FontBLF *font = blf_get(fontid);
790 
791  if (font) {
792  font->wrap_width = wrap_width;
793  }
794 }
795 
796 void BLF_shadow(int fontid, int level, const float rgba[4])
797 {
798  FontBLF *font = blf_get(fontid);
799 
800  if (font) {
801  font->shadow = level;
803  }
804 }
805 
806 void BLF_shadow_offset(int fontid, int x, int y)
807 {
808  FontBLF *font = blf_get(fontid);
809 
810  if (font) {
811  font->shadow_x = x;
812  font->shadow_y = y;
813  }
814 }
815 
816 void BLF_buffer(int fontid,
817  float *fbuf,
818  unsigned char *cbuf,
819  int w,
820  int h,
821  int nch,
822  struct ColorManagedDisplay *display)
823 {
824  FontBLF *font = blf_get(fontid);
825 
826  if (font) {
827  font->buf_info.fbuf = fbuf;
828  font->buf_info.cbuf = cbuf;
829  font->buf_info.dims[0] = w;
830  font->buf_info.dims[1] = h;
831  font->buf_info.ch = nch;
832  font->buf_info.display = display;
833  }
834 }
835 
836 void BLF_buffer_col(int fontid, const float rgba[4])
837 {
838  FontBLF *font = blf_get(fontid);
839 
840  if (font) {
842  }
843 }
844 
846 {
847  FontBufInfoBLF *buf_info = &font->buf_info;
848 
849  rgba_float_to_uchar(buf_info->col_char, buf_info->col_init);
850 
851  if (buf_info->display) {
852  copy_v4_v4(buf_info->col_float, buf_info->col_init);
854  }
855  else {
856  srgb_to_linearrgb_v4(buf_info->col_float, buf_info->col_init);
857  }
858 }
860 {
861 }
862 
863 void BLF_draw_buffer_ex(int fontid,
864  const char *str,
865  const size_t str_len,
866  struct ResultBLF *r_info)
867 {
868  FontBLF *font = blf_get(fontid);
869 
870  if (font && (font->buf_info.fbuf || font->buf_info.cbuf)) {
872  if (font->flags & BLF_WORD_WRAP) {
873  blf_font_draw_buffer__wrap(font, str, str_len, r_info);
874  }
875  else {
876  blf_font_draw_buffer(font, str, str_len, r_info);
877  }
879  }
880 }
881 void BLF_draw_buffer(int fontid, const char *str, const size_t str_len)
882 {
883  BLF_draw_buffer_ex(fontid, str, str_len, NULL);
884 }
885 
886 char *BLF_display_name_from_file(const char *filepath)
887 {
888  FontBLF *font = blf_font_new("font_name", filepath);
889  if (!font) {
890  return NULL;
891  }
892  char *name = blf_display_name(font);
893  blf_font_free(font);
894  return name;
895 }
896 
897 #ifdef DEBUG
898 void BLF_state_print(int fontid)
899 {
900  FontBLF *font = blf_get(fontid);
901  if (font) {
902  printf("fontid %d %p\n", fontid, (void *)font);
903  printf(" name: '%s'\n", font->name);
904  printf(" size: %f\n", font->size);
905  printf(" dpi: %u\n", font->dpi);
906  printf(" pos: %d %d %d\n", UNPACK3(font->pos));
907  printf(" aspect: (%d) %.6f %.6f %.6f\n",
908  (font->flags & BLF_ROTATION) != 0,
909  UNPACK3(font->aspect));
910  printf(" angle: (%d) %.6f\n", (font->flags & BLF_ASPECT) != 0, font->angle);
911  printf(" flag: %d\n", font->flags);
912  }
913  else {
914  printf("fontid %d (NULL)\n", fontid);
915  }
916  fflush(stdout);
917 }
918 #endif
typedef float(TangentPoint)[2]
@ BLF_ROTATION
Definition: BLF_api.h:334
@ BLF_MATRIX
Definition: BLF_api.h:338
@ BLF_WORD_WRAP
Definition: BLF_api.h:340
@ BLF_ASPECT
Definition: BLF_api.h:339
void BLF_default_set(int fontid)
Definition: blf_default.c:37
bool(* BLF_GlyphBoundsFn)(const char *str, size_t str_step_ofs, const struct rcti *glyph_step_bounds, int glyph_advance_x, const struct rcti *glyph_bounds, const int glyph_bearing[2], void *user_data)
Definition: BLF_api.h:119
void BLF_default_dpi(int dpi)
Definition: blf_default.c:27
#define BLI_assert(a)
Definition: BLI_assert.h:46
MINLINE int round_fl_to_int(float a)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
Definition: math_color.c:396
#define RAD2DEG(_rad)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define UNPACK3(a)
#define STREQ(a, b)
_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 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 GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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
_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 width
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:126
#define GPU_matrix_mul(x)
Definition: GPU_matrix.h:224
void GPU_matrix_scale_3fv(const float vec[3])
Definition: gpu_matrix.cc:241
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:119
void GPU_matrix_rotate_2d(float deg)
Definition: gpu_matrix.cc:253
void GPU_matrix_translate_3f(float x, float y, float z)
Definition: gpu_matrix.cc:188
void GPU_bgl_end(void)
Definition: gpu_state.cc:346
void IMB_colormanagement_display_to_scene_linear_v3(float pixel[3], struct ColorManagedDisplay *display)
Read Guarded memory(de)allocation.
static int blf_search_available(void)
Definition: blf.c:110
static int blf_search(const char *name)
Definition: blf.c:98
size_t BLF_width_to_rstrlen(int fontid, const char *str, const size_t str_len, float width, float *r_width)
Definition: blf.c:618
float BLF_width(int fontid, const char *str, const size_t str_len)
Definition: blf.c:688
int BLF_load_unique(const char *name)
Definition: blf.c:148
static void blf_draw_gl__start(FontBLF *font)
Definition: blf.c:486
float BLF_height(int fontid, const char *str, const size_t str_len)
Definition: blf.c:717
void BLF_aspect(int fontid, float x, float y, float z)
Definition: blf.c:288
void blf_draw_buffer__start(FontBLF *font)
Definition: blf.c:845
void BLF_boundbox_foreach_glyph_ex(int fontid, const char *str, size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data, struct ResultBLF *r_info)
Definition: blf.c:568
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
Definition: blf.c:407
int BLF_init(void)
Definition: blf.c:59
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
Definition: blf.c:775
void BLF_cache_clear(void)
Definition: blf.c:83
size_t BLF_width_to_strlen(int fontid, const char *str, const size_t str_len, float width, float *r_width)
Definition: blf.c:596
void BLF_boundbox_foreach_glyph(int fontid, const char *str, const size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data)
Definition: blf.c:590
void BLF_draw(int fontid, const char *str, const size_t str_len)
Definition: blf.c:538
void BLF_draw_buffer(int fontid, const char *str, const size_t str_len)
Definition: blf.c:881
void BLF_color3f(int fontid, float r, float g, float b)
Definition: blf.c:460
float BLF_fixed_width(int fontid)
Definition: blf.c:693
int BLF_load_mem_unique(const char *name, const unsigned char *mem, int mem_size)
Definition: blf.c:197
void BLF_draw_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf.c:521
void BLF_color3fv_alpha(int fontid, const float rgb[3], float alpha)
Definition: blf.c:452
void BLF_color4fv(int fontid, const float rgba[4])
Definition: blf.c:437
bool BLF_has_glyph(int fontid, unsigned int unicode)
Definition: blf.c:121
#define BLF_RESULT_CHECK_INIT(r_info)
Definition: blf.c:37
void BLF_draw_buffer_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf.c:863
bool blf_font_id_is_valid(int fontid)
Definition: blf.c:93
int BLF_load_mem(const char *name, const unsigned char *mem, int mem_size)
Definition: blf.c:187
void BLF_unload_all(void)
Definition: blf.c:256
static void blf_draw_gl__end(FontBLF *font)
Definition: blf.c:514
void BLF_shadow_offset(int fontid, int x, int y)
Definition: blf.c:806
int BLF_width_max(int fontid)
Definition: blf.c:733
int BLF_ascender(int fontid)
Definition: blf.c:755
int blf_mono_font_render
Definition: blf.c:49
void BLF_matrix(int fontid, const float m[16])
Definition: blf.c:299
float BLF_height_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf.c:704
void BLF_batch_draw_flush(void)
Definition: blf.c:472
static FontBLF * blf_get(int fontid)
Definition: blf.c:51
void BLF_disable(int fontid, int option)
Definition: blf.c:279
void BLF_rotation(int fontid, float angle)
Definition: blf.c:766
void BLF_buffer_col(int fontid, const float rgba[4])
Definition: blf.c:836
void BLF_shadow(int fontid, int level, const float rgba[4])
Definition: blf.c:796
void BLF_color3ubv_alpha(int fontid, const unsigned char rgb[3], unsigned char alpha)
Definition: blf.c:395
int BLF_descender(int fontid)
Definition: blf.c:744
void BLF_unload_id(int fontid)
Definition: blf.c:242
void BLF_boundbox_ex(int fontid, const char *str, const size_t str_len, rcti *r_box, struct ResultBLF *r_info)
Definition: blf.c:640
FontBLF * global_font[BLF_MAX_FONT]
Definition: blf.c:44
int blf_mono_font
Definition: blf.c:48
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch, struct ColorManagedDisplay *display)
Definition: blf.c:816
void BLF_unload(const char *name)
Definition: blf.c:225
void BLF_exit(void)
Definition: blf.c:70
void BLF_batch_draw_begin(void)
Definition: blf.c:466
bool BLF_is_loaded(const char *name)
Definition: blf.c:130
void BLF_enable(int fontid, int option)
Definition: blf.c:270
void BLF_width_and_height(int fontid, const char *str, const size_t str_len, float *r_width, float *r_height)
Definition: blf.c:662
void BLF_color3ub(int fontid, unsigned char r, unsigned char g, unsigned char b)
Definition: blf.c:425
float BLF_width_ex(int fontid, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf.c:675
int BLF_draw_mono(int fontid, const char *str, const size_t str_len, int cwidth)
Definition: blf.c:550
void BLF_batch_draw_end(void)
Definition: blf.c:479
void BLF_boundbox(int fontid, const char *str, const size_t str_len, rcti *r_box)
Definition: blf.c:657
void BLF_color4f(int fontid, float r, float g, float b, float a)
Definition: blf.c:446
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
Definition: blf.c:383
void BLF_size(int fontid, float size, int dpi)
Definition: blf.c:363
int BLF_load(const char *name)
Definition: blf.c:135
char * BLF_display_name_from_file(const char *filepath)
Definition: blf.c:886
void BLF_color4ub(int fontid, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha)
Definition: blf.c:412
int BLF_height_max(int fontid)
Definition: blf.c:722
void BLF_wordwrap(int fontid, int wrap_width)
Definition: blf.c:787
void blf_draw_buffer__end(void)
Definition: blf.c:859
void BLF_position(int fontid, float x, float y, float z)
Definition: blf.c:308
void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size)
Definition: blf.c:178
char * blf_dir_search(const char *file)
Definition: blf_dir.c:109
float blf_font_height(FontBLF *font, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf_font.c:793
BatchBLF g_batch
Definition: blf_font.c:52
size_t blf_font_width_to_rstrlen(FontBLF *font, const char *str, const size_t str_len, int width, int *r_width)
Definition: blf_font.c:618
void blf_batch_draw(void)
Definition: blf_font.c:229
int blf_font_ascender(FontBLF *font)
Definition: blf_font.c:1153
void blf_font_exit(void)
Definition: blf_font.c:1180
void blf_font_draw_buffer(FontBLF *font, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf_font.c:557
char * blf_display_name(FontBLF *font)
Definition: blf_font.c:1158
void blf_font_free(FontBLF *font)
Definition: blf_font.c:1380
void blf_font_boundbox_foreach_glyph(FontBLF *font, const char *str, const size_t str_len, BLF_GlyphBoundsFn user_fn, void *user_data, struct ResultBLF *r_info)
Definition: blf_font.c:880
int blf_font_draw_mono(FontBLF *font, const char *str, const size_t str_len, int cwidth)
Definition: blf_font.c:378
FontBLF * blf_font_new_from_mem(const char *name, const unsigned char *mem, int mem_size)
Definition: blf_font.c:1339
float blf_font_fixed_width(FontBLF *font)
Definition: blf_font.c:817
void blf_font_boundbox__wrap(FontBLF *font, const char *str, const size_t str_len, rcti *box, struct ResultBLF *r_info)
Definition: blf_font.c:1039
FontBLF * blf_font_new(const char *name, const char *filepath)
Definition: blf_font.c:1247
int blf_font_width_max(FontBLF *font)
Definition: blf_font.c:1143
void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size)
Definition: blf_font.c:1329
bool blf_font_size(FontBLF *font, float size, unsigned int dpi)
Definition: blf_font.c:1408
void blf_font_draw(FontBLF *font, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf_font.c:371
void blf_font_width_and_height(FontBLF *font, const char *str, const size_t str_len, float *r_width, float *r_height, struct ResultBLF *r_info)
Definition: blf_font.c:740
void blf_font_boundbox(FontBLF *font, const char *str, const size_t str_len, rcti *r_box, struct ResultBLF *r_info)
Definition: blf_font.c:732
void blf_font_draw_buffer__wrap(FontBLF *font, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf_font.c:1060
int blf_font_init(void)
Definition: blf_font.c:1172
float blf_font_width(FontBLF *font, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf_font.c:769
void blf_font_draw__wrap(FontBLF *font, const char *str, const size_t str_len, struct ResultBLF *r_info)
Definition: blf_font.c:1017
size_t blf_font_width_to_strlen(FontBLF *font, const char *str, const size_t str_len, int width, int *r_width)
Definition: blf_font.c:590
int blf_font_descender(FontBLF *font)
Definition: blf_font.c:1148
int blf_font_height_max(FontBLF *font)
Definition: blf_font.c:1122
void blf_glyph_cache_clear(FontBLF *font)
Definition: blf_glyph.c:151
#define BLF_MAX_FONT
Definition: blf_internal.h:19
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
void * user_data
#define str(s)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
#define floorf(x)
Definition: metal/compat.h:224
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static const pxr::TfToken rgb("rgb", pxr::TfToken::Immortal)
return ret
unsigned int dpi
unsigned char color[4]
float aspect[3]
unsigned int reference_count
FontBufInfoBLF buf_info
float m[16]
unsigned char shadow_color[4]
unsigned char col_char[4]
unsigned char * cbuf
struct ColorManagedDisplay * display
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
int wrap_width(const struct SpaceText *st, struct ARegion *region)