// Copyright (C) 2002-2003 Gideon May (gideon@computer.org) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. // Permission to modify the code and to distribute modified code is granted // provided this copyright notice appears in all copies, and a notice // that the code was modified is included with the copyright notice. // // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. // #include #include #include #include #include #include #include "held_ptr.hpp" using namespace boost::python; namespace PyOSGText { void init_Font() { def("readFontFile", &osgText::readFontFile, return_internal_reference<>()); /** read a font from specified file.*/ class_, bases, boost::noncopyable > font("Font", no_init); font.def(init<>()); font.def(init()); font.def("getFileName", &osgText::Font::getFileName); /** Set the pixel width and height hint.*/ font.def("setFontResolution", &osgText::Font::setFontResolution); font.def("getFontWidth", &osgText::Font::getFontWidth); font.def("getFontHeight", &osgText::Font::getFontHeight); /** Get a Glyph for specified charcode, and the font size nearest to the current font size hint.*/ font.def("getGlyph", &osgText::Font::getGlyph, return_internal_reference<>()); /** Get a kerning (adjustment of spacing of two adjacent character) for specified charcodes, w.r.t the current font size hint.*/ font.def("getKerning", &osgText::Font::getKerning); /** Return true if this font provides vertical alignments and spacing or glyphs.*/ font.def("hasVertical", &osgText::Font::hasVertical); /** Set the margin around each glyph, * to ensure that texture filtering doesn't bleed adjacent glyph's into each other. * Default margin is 2 texels.*/ font.def("setGlyphImageMargin", &osgText::Font::setGlyphImageMargin); font.def("getGlyphImageMargin", &osgText::Font::getGlyphImageMargin); /** Set the size of texture to create to store the glyph images when rendering. * Note, this doesn't affect already created Texture Glhph's.*/ //void setTextureSizeHint(unsigned int width,unsigned int height); font.def("setTextureSizeHint", &osgText::Font::setTextureSizeHint); font.def("getTextureWidthHint", &osgText::Font::getTextureWidthHint); font.def("getTextureHeightHint", &osgText::Font::getTextureHeightHint); /** Set the minification texture filter to use when creating the texture to store the glyph images when rendering. * Note, this doesn't affect already created Texture Glhph's.*/ font.def("setMinFilterHint", &osgText::Font::setMinFilterHint); font.def("getMinFilterHint", &osgText::Font::getMinFilterHint); /** Set the magnification texture filter to use when creating the texture to store the glyph images when rendering. * Note, this doesn't affect already created Texture Glhph's.*/ font.def("setMagFilterHint", &osgText::Font::setMagFilterHint); font.def("getMagFilterHint", &osgText::Font::getMagFilterHint); font.def("setImplementation", &osgText::Font::setImplementation); #if 0 font.def("getImplementation", (osgText::Font::FontImplementation*(osgText::Font::*)) &osgText::Font::getImplementation, return_internal_reference<>()); #endif } }