Blender V5.3
blf_default.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "DNA_userdef_types.h"
12
13#include "BLI_assert.hh"
14
15#include "BLF_api.hh"
16
17namespace blender {
18
19/* call BLF_default_set first! */
20#define ASSERT_DEFAULT_SET BLI_assert(global_font_default != -1)
21
22/* Default size and dpi, for BLF_draw_default. */
23static int global_font_default = -1;
24/* Keep in sync with `UI_DEFAULT_TEXT_POINTS` */
25static float global_font_size = 11.0f;
26
27void BLF_default_size(const float size)
28{
29 global_font_size = size;
30}
31
32void BLF_default_set(const int fontid)
33{
34 if ((fontid == -1) || BLF_is_loaded_id(fontid)) {
35 global_font_default = fontid;
36 }
37}
38
44
53
55 const float x, const float y, const float z, const char *str, const size_t str_len)
56{
61}
62
63} // namespace blender
#define UI_SCALE_FAC
#define ASSERT_DEFAULT_SET
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
Definition btQuadWord.h:117
#define str(s)
BMesh Iterators.
bool BLF_is_loaded_id(int fontid) ATTR_WARN_UNUSED_RESULT
Definition blf.cc:172
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:390
static int global_font_default
void BLF_default_set(int fontid)
int BLF_set_default()
void BLF_size(int fontid, float size)
Definition blf.cc:445
int BLF_default()
static float global_font_size
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:587
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
void BLF_default_size(float size)