summaryrefslogtreecommitdiff
path: root/wrapper.cpp
diff options
context:
space:
mode:
authorJon Bergli Heier <jonheier@start.no>2007-10-01 00:04:47 +0200
committerJon Bergli Heier <jonheier@start.no>2007-10-01 00:04:47 +0200
commitc062ac07e6241cf32a4a5655775aa037bdb1e76e (patch)
treea3b41bfc3ea1b57af6b95e4072ce7fcbbdaa4afb /wrapper.cpp
parent2b47e8d3c263bdaff9d48f3a1a480631b22ee145 (diff)
Moved pykfx.py to pykfx/__init__.py
Added self.names in Styles along with int support in __getitem__. Added setup.py. Added fscalc, an extension that calculates text sizes for a given font. Using boost.python-wrapper for fscalc.
Diffstat (limited to 'wrapper.cpp')
-rw-r--r--wrapper.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/wrapper.cpp b/wrapper.cpp
new file mode 100644
index 0000000..9991b24
--- /dev/null
+++ b/wrapper.cpp
@@ -0,0 +1,12 @@
+#include <boost/python.hpp>
+#include "fscalc.h"
+
+using namespace boost::python;
+
+BOOST_PYTHON_MODULE(fscalc) {
+ class_<Font>("Font", init<std::string, int, int>())
+ .def("set_font_size", &Font::set_font_size)
+ .def("get_kerning", &Font::get_kerning)
+ .def("get_text_width", &Font::get_text_width)
+ .def("get_line_height", &Font::get_line_height);
+}