QFontImplementation 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 2009-2010 Mathias Froehlich
  2. *
  3. * This library is open source and may be redistributed and/or modified under
  4. * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  5. * (at your option) any later version. The full license is in LICENSE file
  6. * included with this distribution, and on the openscenegraph.org website.
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * OpenSceneGraph Public License for more details.
  12. */
  13. #ifndef QFontImplementation_H
  14. #define QFontImplementation_H
  15. #include <osgText/Font>
  16. #include <osgQt/Export>
  17. #include <QtGui/QFont>
  18. #include <string>
  19. namespace osgQt {
  20. class OSGQT_EXPORT QFontImplementation : public osgText::Font::FontImplementation
  21. {
  22. public:
  23. QFontImplementation(const QFont& font);
  24. virtual ~QFontImplementation();
  25. virtual std::string getFileName() const;
  26. virtual bool supportsMultipleFontResolutions() const { return true; }
  27. virtual osgText::Glyph* getGlyph(const osgText::FontResolution& fontRes, unsigned int charcode);
  28. virtual osgText::Glyph3D* getGlyph3D(const osgText::FontResolution& /*fontRes*/, unsigned int /*charcode*/) { return 0; }
  29. virtual osg::Vec2 getKerning(const osgText::FontResolution& fontRes, unsigned int leftcharcode, unsigned int rightcharcode, osgText::KerningType kerningType);
  30. virtual bool hasVertical() const;
  31. protected:
  32. std::string _filename;
  33. QFont _font;
  34. };
  35. }
  36. #endif