OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
text.hpp File Reference

C++ veneer for the text-to-shape module. More...

#include <occtl/occtl_text.h>
#include <occtl-hpp/core.hpp>
#include <occtl-hpp/topo.hpp>
#include <string>
Include dependency graph for text.hpp:

Go to the source code of this file.

Classes

struct  occtl::text::TextFacesOptions
 Optional layout/font knobs for make_faces and make_wires. More...
 

Typedefs

using occtl::text::TextMetrics = ::occtl_text_metrics_t
 Formatted text metrics returned by measure.
 

Functions

inline ::occtl_axis2_placement_t occtl::text::detail::default_ax2 () noexcept
 Default axis2 placement: origin + Z (main) + X.
 
inline ::occtl_text_info_t occtl::text::detail::to_c_info (const std::string &theText, const TextFacesOptions &theOpts, ::occtl_text_layout_options_t &theLayout)
 
TextMetrics occtl::text::measure (const std::string &theText, const TextFacesOptions &theOpts)
 Measures formatted text without creating graph topology. Throws occtl::Error on failure.
 
NodeId occtl::text::make_faces (Graph &theGraph, const std::string &theText, const TextFacesOptions &theOpts)
 Builds a Compound of planar text faces and returns its NodeId. Throws occtl::Error on failure.
 
NodeId occtl::text::make_wires (Graph &theGraph, const std::string &theText, const TextFacesOptions &theOpts)
 Builds a Compound of glyph outline wires and returns its NodeId. Throws occtl::Error on failure.
 

Detailed Description

C++ veneer for the text-to-shape module.

Mirrors the C info struct as a PascalCase POD with defaults and returns the produced compound NodeId. Failures translate to occtl::Error.

Function Documentation

◆ make_faces()

NodeId occtl::text::make_faces ( Graph theGraph,
const std::string &  theText,
const TextFacesOptions theOpts 
)
inline

Builds a Compound of planar text faces and returns its NodeId. Throws occtl::Error on failure.

Parameters
[in,out]theGraphgraph receiving the text shape
[in]theTextUTF-8 string; must be non-empty
[in]theOptslayout and font options; height must be > 0 and exactly one font selector must be set

◆ make_wires()

NodeId occtl::text::make_wires ( Graph theGraph,
const std::string &  theText,
const TextFacesOptions theOpts 
)
inline

Builds a Compound of glyph outline wires and returns its NodeId. Throws occtl::Error on failure.

Parameters
[in,out]theGraphgraph receiving the text shape
[in]theTextUTF-8 string; must be non-empty
[in]theOptslayout and font options; height must be > 0 and exactly one font selector must be set

◆ measure()

TextMetrics occtl::text::measure ( const std::string &  theText,
const TextFacesOptions theOpts 
)
inline

Measures formatted text without creating graph topology. Throws occtl::Error on failure.

Parameters
[in]theTextUTF-8 string; must be non-empty
[in]theOptslayout and font options; height must be > 0 and exactly one font selector must be set