1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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.
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.
14
#ifndef FREETYPE_FONT3D
15
#define FREETYPE_FONT3D 1
17
#include <osgText/Font3D>
20
#include FT_FREETYPE_H
22
class FreeTypeFont3D : public osgText::Font3D::Font3DImplementation
24
// declare the interface to a font.
27
FreeTypeFont3D(const std::string& filename, FT_Face face, unsigned int flags);
28
FreeTypeFont3D(FT_Byte* buffer, FT_Face face, unsigned int flags);
30
virtual std::string getFileName() const { return _filename; }
32
// virtual void setFontResolution(unsigned int width, unsigned int height, unsigned int depth);
34
virtual osgText::Font3D::Glyph3D * getGlyph(unsigned int charcode);
36
virtual osg::Vec2 getKerning(unsigned int leftcharcode,unsigned int rightcharcode, osgText::KerningType _kerningType);
38
virtual bool hasVertical() const;
40
virtual float getScale() const;
46
long ft_round( long x ) { return (( x + 32 ) & -64); }
47
long ft_floor( long x ) { return (x & -64); }
48
long ft_ceiling( long x ){ return (( x + 63 ) & -64); }
50
virtual ~FreeTypeFont3D();
52
std::string _filename;