/* OCP.StdPrs — glyph outlines as BRep. Text emboss loads a bundled font and asks the builder for the text as a compound of face outlines, holes already subtracted, which it then extrudes into or out of the model. Both are real classes, and the aliasing runs the opposite way from what the 8.0 watchlist expected: Font_BRepFont/Font_BRepTextBuilder are the typedefs of these, not the reverse. What 8.0 did move is the package — StdPrs went from TKService to TKV3d, which is why CMakeLists links both. The builder image asserts neither pulls in libGL or libX11, so binding them costs the runtime image nothing. Rendering a glyph is FreeType work with no Python in it, so it releases the GIL. */ #include "../common/occt_module.h" #include "../common/occt_policies.h" #include "../common/occt_transient.h" #include #include #include #include #include void register_StdPrs(nb::module_ &root) { nb::module_ m = ocp_submodule(root, "StdPrs"); nb::class_(m, "StdPrs_BRepFont") .def(ocp_new()) .def( "Init", [](StdPrs_BRepFont &self, const NCollection_String &path, const Standard_Real size, const Standard_Integer faceId) { return self.Init(path, size, faceId); }, "theFontPath"_a, "theSize"_a, "theFaceId"_a, OCP_NOGIL) .def("Release", &StdPrs_BRepFont::Release) .def("Ascender", &StdPrs_BRepFont::Ascender) .def("Descender", &StdPrs_BRepFont::Descender); nb::class_(m, "StdPrs_BRepTextBuilder") .def(nb::init<>()) .def( "Perform", [](StdPrs_BRepTextBuilder &self, StdPrs_BRepFont &font, const NCollection_String &text, const gp_Ax3 &penLoc, const Graphic3d_HorizontalTextAlignment hAlign, const Graphic3d_VerticalTextAlignment vAlign) { return self.Perform(font, text, penLoc, hAlign, vAlign); }, "theFont"_a, "theString"_a, "thePenLoc"_a = gp_Ax3(), "theHAlign"_a = Graphic3d_HTA_LEFT, "theVAlign"_a = Graphic3d_VTA_BOTTOM, OCP_RETURN_COPY, OCP_NOGIL); }