~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/freetype/FreeTypeFont3D.h

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-07-29 04:34:38 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080729043438-no1h9h0dpsrlzp1y
* Non-maintainer upload.
* No longer try to detect (using /proc/cpuinfo when available) how many
  CPUs are available, fixing the FTBFS (due to -j0) on various platforms
  (Closes: #477353). The right way to do it is to support parallel=n in
  DEB_BUILD_OPTIONS (see Debian Policy §4.9.1), and adequate support has
  been implemented.
* Add patch to fix FTBFS due to the build system now refusing to handle
  whitespaces (Policy CMP0004 say the logs), thanks to Andreas Putzo who
  provided it (Closes: #482239):
   - debian/patches/fix-cmp0004-build-failure.dpatch
* Remove myself from Uploaders, as requested a while ago, done by Luk in
  his 2.2.0-2.1 NMU, which was never acknowledged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
 
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
 
 
14
#ifndef FREETYPE_FONT3D
 
15
#define FREETYPE_FONT3D 1
 
16
 
 
17
#include <osgText/Font3D>
 
18
 
 
19
#include <ft2build.h>
 
20
#include FT_FREETYPE_H
 
21
 
 
22
class FreeTypeFont3D : public osgText::Font3D::Font3DImplementation
 
23
{
 
24
// declare the interface to a font.
 
25
public:
 
26
 
 
27
    FreeTypeFont3D(const std::string& filename, FT_Face face, unsigned int flags);
 
28
    FreeTypeFont3D(FT_Byte* buffer, FT_Face face, unsigned int flags);
 
29
 
 
30
    virtual std::string getFileName() const { return _filename; }
 
31
 
 
32
//    virtual void setFontResolution(unsigned int width, unsigned int height, unsigned int depth);
 
33
 
 
34
    virtual osgText::Font3D::Glyph3D * getGlyph(unsigned int charcode);
 
35
        
 
36
    virtual osg::Vec2 getKerning(unsigned int leftcharcode,unsigned int rightcharcode, osgText::KerningType _kerningType);
 
37
    
 
38
    virtual bool hasVertical() const;
 
39
    
 
40
    virtual float getScale() const;
 
41
 
 
42
protected:
 
43
 
 
44
    void init();
 
45
    
 
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); }
 
49
    
 
50
    virtual ~FreeTypeFont3D();
 
51
    
 
52
    std::string     _filename;
 
53
    FT_Byte*        _buffer;
 
54
    FT_Face         _face;
 
55
    unsigned int    _flags;
 
56
    
 
57
    
 
58
    double  _scale;
 
59
    double  _shiftY;
 
60
    double  _shiftX;
 
61
    double  _charScale;
 
62
};
 
63
 
 
64
#endif