Blender  V3.3
BKE_vfont.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 #pragma once
4 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 struct CharInfo;
14 struct Curve;
15 struct Main;
16 struct Object;
17 struct VFont;
18 
19 struct CharTrans {
20  float xof, yof;
21  float rot;
22  short linenr, charnr;
23  char dobreak;
24 };
25 
26 typedef struct EditFontSelBox {
27  float x, y, w, h;
28  float rot;
30 
31 typedef struct EditFont {
32  char32_t *textbuf;
34 
35  /* array of rectangles & rotation */
36  float textcurs[4][2];
39 
40  /* positional vars relative to the textbuf, textbufinfo (not utf8 bytes)
41  * a copy of these is kept in Curve, but use these in editmode */
42  int len, pos;
44 
50 
52 
53 bool BKE_vfont_is_builtin(const struct VFont *vfont);
54 void BKE_vfont_builtin_register(const void *mem, int size);
55 
56 void BKE_vfont_free_data(struct VFont *vfont);
57 struct VFont *BKE_vfont_builtin_get(void);
58 struct VFont *BKE_vfont_load(struct Main *bmain, const char *filepath);
59 struct VFont *BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath, bool *r_exists);
60 struct VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath);
61 
62 bool BKE_vfont_to_curve_ex(struct Object *ob,
63  struct Curve *cu,
64  int mode,
65  struct ListBase *r_nubase,
66  const char32_t **r_text,
67  int *r_text_len,
68  bool *r_text_free,
69  struct CharTrans **r_chartransdata);
70 bool BKE_vfont_to_curve_nubase(struct Object *ob, int mode, struct ListBase *r_nubase);
74 bool BKE_vfont_to_curve(struct Object *ob, int mode);
75 void BKE_vfont_build_char(struct Curve *cu,
76  struct ListBase *nubase,
77  unsigned int character,
78  struct CharInfo *info,
79  float ofsx,
80  float ofsy,
81  float rot,
82  int charidx,
83  float fsize);
84 
85 int BKE_vfont_select_get(struct Object *ob, int *r_start, int *r_end);
86 void BKE_vfont_select_clamp(struct Object *ob);
87 
88 void BKE_vfont_clipboard_free(void);
89 void BKE_vfont_clipboard_set(const char32_t *text_buf,
90  const struct CharInfo *info_buf,
91  size_t len);
92 void BKE_vfont_clipboard_get(char32_t **r_text_buf,
93  struct CharInfo **r_info_buf,
94  size_t *r_len_utf8,
95  size_t *r_len_utf32);
96 
97 #ifdef __cplusplus
98 }
99 #endif
struct VFont * BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
Definition: vfont.c:394
void BKE_vfont_select_clamp(struct Object *ob)
Definition: vfont.c:658
bool BKE_vfont_to_curve(struct Object *ob, int mode)
Definition: vfont.c:1744
void BKE_vfont_clipboard_set(const char32_t *text_buf, const struct CharInfo *info_buf, size_t len)
int BKE_vfont_select_get(struct Object *ob, int *r_start, int *r_end)
Definition: vfont.c:618
struct VFont * BKE_vfont_load(struct Main *bmain, const char *filepath)
Definition: vfont.c:316
struct EditFont EditFont
void BKE_vfont_free_data(struct VFont *vfont)
Definition: vfont.c:188
struct VFont * BKE_vfont_builtin_get(void)
Definition: vfont.c:413
struct EditFontSelBox EditFontSelBox
bool BKE_vfont_to_curve_nubase(struct Object *ob, int mode, struct ListBase *r_nubase)
Definition: vfont.c:1737
bool BKE_vfont_is_builtin(const struct VFont *vfont)
Definition: vfont.c:223
struct VFont * BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath, bool *r_exists)
Definition: vfont.c:366
void BKE_vfont_builtin_register(const void *mem, int size)
Definition: vfont.c:228
void BKE_vfont_build_char(struct Curve *cu, struct ListBase *nubase, unsigned int character, struct CharInfo *info, float ofsx, float ofsy, float rot, int charidx, float fsize)
Definition: vfont.c:495
bool BKE_vfont_to_curve_ex(struct Object *ob, struct Curve *cu, int mode, struct ListBase *r_nubase, const char32_t **r_text, int *r_text_len, bool *r_text_free, struct CharTrans **r_chartransdata)
Definition: vfont.c:1709
void BKE_vfont_clipboard_free(void)
Definition: vfont.c:1762
void BKE_vfont_clipboard_get(char32_t **r_text_buf, struct CharInfo **r_info_buf, size_t *r_len_utf8, size_t *r_len_utf32)
Definition: vfont.c:1800
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
int len
Definition: draw_manager.c:108
#define rot(x, k)
short linenr
Definition: BKE_vfont.h:22
float yof
Definition: BKE_vfont.h:20
short charnr
Definition: BKE_vfont.h:22
float xof
Definition: BKE_vfont.h:20
float rot
Definition: BKE_vfont.h:21
char dobreak
Definition: BKE_vfont.h:23
float textcurs[4][2]
Definition: BKE_vfont.h:36
int selend
Definition: BKE_vfont.h:43
int pos
Definition: BKE_vfont.h:42
EditFontSelBox * selboxes
Definition: BKE_vfont.h:37
int len
Definition: BKE_vfont.h:42
int selboxes_len
Definition: BKE_vfont.h:38
char32_t * textbuf
Definition: BKE_vfont.h:32
int selstart
Definition: BKE_vfont.h:43
struct CharInfo * textbufinfo
Definition: BKE_vfont.h:33
char needs_flush_to_id
Definition: BKE_vfont.h:49
Definition: BKE_main.h:121
char filepath[1024]