Blender  V2.93
BKE_font.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 #pragma once
20 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 struct CharInfo;
30 struct Curve;
31 struct Main;
32 struct Object;
33 struct VFont;
34 
35 struct CharTrans {
36  float xof, yof;
37  float rot;
38  short linenr, charnr;
39  char dobreak;
40 };
41 
42 typedef struct EditFontSelBox {
43  float x, y, w, h;
44  float rot;
46 
47 typedef struct EditFont {
48  char32_t *textbuf;
50 
51  /* array of rectangles & rotation */
52  float textcurs[4][2];
55 
56  /* positional vars relative to the textbuf, textbufinfo (not utf8 bytes)
57  * a copy of these is kept in Curve, but use these in editmode */
58  int len, pos;
60 
66 
68 
69 bool BKE_vfont_is_builtin(struct VFont *vfont);
70 void BKE_vfont_builtin_register(void *mem, int size);
71 
72 void BKE_vfont_free_data(struct VFont *vfont);
73 struct VFont *BKE_vfont_builtin_get(void);
74 struct VFont *BKE_vfont_load(struct Main *bmain, const char *filepath);
75 struct VFont *BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath, bool *r_exists);
76 struct VFont *BKE_vfont_load_exists(struct Main *bmain, const char *filepath);
77 
78 bool BKE_vfont_to_curve_ex(struct Object *ob,
79  struct Curve *cu,
80  int mode,
81  struct ListBase *r_nubase,
82  const char32_t **r_text,
83  int *r_text_len,
84  bool *r_text_free,
85  struct CharTrans **r_chartransdata);
86 bool BKE_vfont_to_curve_nubase(struct Object *ob, int mode, struct ListBase *r_nubase);
87 bool BKE_vfont_to_curve(struct Object *ob, int mode);
88 
89 int BKE_vfont_select_get(struct Object *ob, int *r_start, int *r_end);
90 void BKE_vfont_select_clamp(struct Object *ob);
91 
92 void BKE_vfont_clipboard_free(void);
93 void BKE_vfont_clipboard_set(const char32_t *text_buf,
94  const struct CharInfo *info_buf,
95  const size_t len);
96 void BKE_vfont_clipboard_get(char32_t **r_text_buf,
97  struct CharInfo **r_info_buf,
98  size_t *r_len_utf8,
99  size_t *r_len_utf32);
100 
101 #ifdef __cplusplus
102 }
103 #endif
bool BKE_vfont_is_builtin(struct VFont *vfont)
Definition: font.c:222
void BKE_vfont_builtin_register(void *mem, int size)
Definition: font.c:227
struct VFont * BKE_vfont_load_exists(struct Main *bmain, const char *filepath)
Definition: font.c:393
void BKE_vfont_select_clamp(struct Object *ob)
Definition: font.c:657
bool BKE_vfont_to_curve(struct Object *ob, int mode)
Definition: font.c:1743
int BKE_vfont_select_get(struct Object *ob, int *r_start, int *r_end)
Definition: font.c:617
struct VFont * BKE_vfont_load(struct Main *bmain, const char *filepath)
Definition: font.c:315
struct EditFont EditFont
void BKE_vfont_free_data(struct VFont *vfont)
Definition: font.c:187
struct VFont * BKE_vfont_builtin_get(void)
Definition: font.c:412
struct EditFontSelBox EditFontSelBox
void BKE_vfont_clipboard_set(const char32_t *text_buf, const struct CharInfo *info_buf, const size_t len)
bool BKE_vfont_to_curve_nubase(struct Object *ob, int mode, struct ListBase *r_nubase)
Definition: font.c:1732
struct VFont * BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath, bool *r_exists)
Definition: font.c:365
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: font.c:1704
void BKE_vfont_clipboard_free(void)
Definition: font.c:1761
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: font.c:1799
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
short linenr
Definition: BKE_font.h:38
float yof
Definition: BKE_font.h:36
short charnr
Definition: BKE_font.h:38
float xof
Definition: BKE_font.h:36
float rot
Definition: BKE_font.h:37
char dobreak
Definition: BKE_font.h:39
float textcurs[4][2]
Definition: BKE_font.h:52
int selend
Definition: BKE_font.h:59
int pos
Definition: BKE_font.h:58
EditFontSelBox * selboxes
Definition: BKE_font.h:53
int len
Definition: BKE_font.h:58
int selboxes_len
Definition: BKE_font.h:54
char32_t * textbuf
Definition: BKE_font.h:48
int selstart
Definition: BKE_font.h:59
struct CharInfo * textbufinfo
Definition: BKE_font.h:49
char needs_flush_to_id
Definition: BKE_font.h:65
Definition: BKE_main.h:116
char filepath[1024]
uint len