@@ -210,7 +210,12 @@ py::class_<BFont>(m, "BFont")
210
210
.def (" StringWidth" , py::overload_cast<const char *>(&BFont::StringWidth, py::const_), " " , py::arg (" string" ))
211
211
.def (" StringWidth" , py::overload_cast<const char *, int32>(&BFont::StringWidth, py::const_), " " , py::arg (" string" ), py::arg (" length" ))
212
212
// .def("GetStringWidths", &BFont::GetStringWidths, "", py::arg("stringArray"), py::arg("lengthArray"), py::arg("numStrings"), py::arg("widthArray"))
213
-
213
+ .def (" GetStringWidths" , [](BFont& self, std::vector<const char *> stringArray, std::vector<int32> lengthArray){
214
+ std::vector<float > widthArray;
215
+ widthArray.resize (stringArray.size ());
216
+ self.GetStringWidths (stringArray.data (),lengthArray.data (),stringArray.size (),widthArray.data ());
217
+ return widthArray;
218
+ }," " , py::arg (" stringArray" ), py::arg (" lengthArray" ))
214
219
// .def("GetEscapements", py::overload_cast<const char, int, float>(&BFont::GetEscapements,py::const_), "", py::arg("charArray"), py::arg("numChars"), py::arg("escapementArray"))
215
220
.def (" GetEscapements" , [](BFont& self, const std::string& charArray, std::vector<float >& escapementArray) {
216
221
// TODO: this function does not return the escapement array, or returns it empty, DON'T WORK
0 commit comments