OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl_text.h
Go to the documentation of this file.
1// Copyright (c) 2026 Capgemini Engineering Research and Development.
2//
3// This file is part of OCCT-Light software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Affero General Public License version 3 as published
7// by the Free Software Foundation, with an option to use any later version.
8// Consult the file LICENSE_AGPL_30.txt included in OCCT-Light distribution
9// for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of a commercial
12// license or contractual agreement.
13//
14// SPDX-License-Identifier: AGPL-3.0-or-later
15
32#ifndef OCCTL_TEXT_H
33#define OCCTL_TEXT_H
34
35#include <stddef.h>
36#include <stdint.h>
37
38#include "occtl_core.h"
39#include "occtl_geom.h"
40#include "occtl_topo.h"
41
42#ifdef __cplusplus
43extern "C"
44{
45#endif
46
51{
53 OCCTL_TEXT_FONT_ASPECT_BOLD = 1,
54 OCCTL_TEXT_FONT_ASPECT_ITALIC = 2,
55 OCCTL_TEXT_FONT_ASPECT_BOLD_ITALIC = 3,
56 OCCTL_TEXT_FONT_ASPECT_RESERVED_FUTURE = 0x7fffffff
58
63{
65 OCCTL_TEXT_HALIGN_CENTER = 1,
66 OCCTL_TEXT_HALIGN_RIGHT = 2,
67 OCCTL_TEXT_HALIGN_RESERVED_FUTURE = 0x7fffffff
69
74{
75 OCCTL_TEXT_VALIGN_BOTTOM = 0,
77 OCCTL_TEXT_VALIGN_CENTER = 2,
78 OCCTL_TEXT_VALIGN_TOP = 3,
79 OCCTL_TEXT_VALIGN_RESERVED_FUTURE = 0x7fffffff
81
82#define OCCTL_TEXT_INFO_VERSION_1 1u
83#define OCCTL_TEXT_LAYOUT_OPTIONS_VERSION_1 1u
84#define OCCTL_TEXT_METRICS_VERSION_1 1u
85
111
125
134typedef struct occtl_text_metrics
135{
136 uint32_t struct_version;
137 const void* p_next;
138 double width;
139 double height;
140 double left;
141 double right;
142 double bottom;
143 double top;
144 double ascender;
145 double descender;
149
150#define OCCTL_TEXT_INFO_INIT \
151 {OCCTL_TEXT_INFO_VERSION_1, \
152 NULL, \
153 {{0.0, 0.0, 0.0}, {0.0, 0.0, 1.0}, {1.0, 0.0, 0.0}}, \
154 NULL, \
155 NULL, \
156 NULL, \
157 OCCTL_TEXT_FONT_ASPECT_REGULAR, \
158 0.0, \
159 OCCTL_TEXT_HALIGN_LEFT, \
160 OCCTL_TEXT_VALIGN_BASELINE}
161
162#define OCCTL_TEXT_LAYOUT_OPTIONS_INIT {OCCTL_TEXT_LAYOUT_OPTIONS_VERSION_1, NULL, 0.0, 1}
163
164#define OCCTL_TEXT_METRICS_INIT \
165 {OCCTL_TEXT_METRICS_VERSION_1, NULL, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
166
181
196
209
245 occtl_text_metrics_t* out_metrics);
246
288 const occtl_text_info_t* info,
289 occtl_node_id_t* out_compound);
290
326 const occtl_text_info_t* info,
327 occtl_node_id_t* out_compound);
328
329#ifdef __cplusplus
330} /* extern "C" */
331#endif
332
333#endif /* OCCTL_TEXT_H */
OCCT-Light: core public API.
#define OCCTL_API
Definition occtl_core.h:111
enum occtl_status occtl_status_t
OCCT-Light: geometry primitive types and math utilities.
struct occtl_text_metrics occtl_text_metrics_t
void occtl_text_layout_options_init(occtl_text_layout_options_t *options)
occtl_status_t occtl_text_make_wires(occtl_graph_t *graph, const occtl_text_info_t *info, occtl_node_id_t *out_compound)
enum occtl_text_font_aspect occtl_text_font_aspect_t
occtl_status_t occtl_text_make_faces(occtl_graph_t *graph, const occtl_text_info_t *info, occtl_node_id_t *out_compound)
void occtl_text_metrics_init(occtl_text_metrics_t *metrics)
occtl_text_halign
Definition occtl_text.h:63
@ OCCTL_TEXT_HALIGN_LEFT
Definition occtl_text.h:64
struct occtl_text_layout_options occtl_text_layout_options_t
void occtl_text_info_init(occtl_text_info_t *info)
occtl_text_valign
Definition occtl_text.h:74
@ OCCTL_TEXT_VALIGN_BASELINE
Definition occtl_text.h:76
occtl_status_t occtl_text_measure(const occtl_text_info_t *info, occtl_text_metrics_t *out_metrics)
enum occtl_text_valign occtl_text_valign_t
struct occtl_text_info occtl_text_info_t
enum occtl_text_halign occtl_text_halign_t
occtl_text_font_aspect
Definition occtl_text.h:51
@ OCCTL_TEXT_FONT_ASPECT_REGULAR
Definition occtl_text.h:52
OCCT-Light: topology module public API.
struct occtl_graph occtl_graph_t
Definition occtl_topo_types.h:152
Definition occtl_geom.h:128
Definition occtl_topo_types.h:50
Definition occtl_text.h:97
const void * p_next
Definition occtl_text.h:99
uint32_t struct_version
Definition occtl_text.h:98
const char * font_path
Definition occtl_text.h:105
occtl_text_font_aspect_t font_aspect
Definition occtl_text.h:106
occtl_text_valign_t vertical_align
Definition occtl_text.h:109
occtl_text_halign_t horizontal_align
Definition occtl_text.h:108
double height
Definition occtl_text.h:107
occtl_axis2_placement_t placement
Definition occtl_text.h:100
const char * utf8_text
Definition occtl_text.h:101
const char * font_family
Definition occtl_text.h:103
Definition occtl_text.h:119
uint32_t struct_version
Definition occtl_text.h:120
const void * p_next
Definition occtl_text.h:121
int32_t word_wrapping
Definition occtl_text.h:123
double wrapping_width
Definition occtl_text.h:122
Definition occtl_text.h:135
double bottom
Definition occtl_text.h:142
double line_spacing
Definition occtl_text.h:146
const void * p_next
Definition occtl_text.h:137
uint32_t struct_version
Definition occtl_text.h:136
double max_symbol_width
Definition occtl_text.h:147
double ascender
Definition occtl_text.h:144
double width
Definition occtl_text.h:138
double top
Definition occtl_text.h:143
double left
Definition occtl_text.h:140
double height
Definition occtl_text.h:139
double descender
Definition occtl_text.h:145
double right
Definition occtl_text.h:141