|
Revision 13041, 2.1 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #ifndef FREETYPE_LIBRARY |
|---|
| 15 | #define FREETYPE_LIBRARY |
|---|
| 16 | |
|---|
| 17 | #include "FreeTypeFont.h" |
|---|
| 18 | |
|---|
| 19 | #include <set> |
|---|
| 20 | #include <istream> |
|---|
| 21 | |
|---|
| 22 | #include <osgText/Font> |
|---|
| 23 | #include <osgText/Font3D> |
|---|
| 24 | |
|---|
| 25 | #include <ft2build.h> |
|---|
| 26 | |
|---|
| 27 | class FreeTypeLibrary : public osg::Referenced |
|---|
| 28 | { |
|---|
| 29 | public: |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | virtual ~FreeTypeLibrary(); |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | static FreeTypeLibrary* instance(); |
|---|
| 36 | |
|---|
| 37 | OpenThreads::Mutex& getMutex() { return _mutex; } |
|---|
| 38 | |
|---|
| 39 | osgText::Font* getFont(const std::string& fontfile,unsigned int index=0, unsigned int flags=0); |
|---|
| 40 | osgText::Font* getFont(std::istream& fontstream, unsigned int index=0, unsigned int flags=0); |
|---|
| 41 | |
|---|
| 42 | void removeFontImplmentation(FreeTypeFont* fontImpl) { _fontImplementationSet.erase(fontImpl); } |
|---|
| 43 | |
|---|
| 44 | protected: |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | bool getFace(const std::string& fontfile,unsigned int index, FT_Face & face); |
|---|
| 48 | |
|---|
| 49 | FT_Byte* getFace(std::istream& fontstream, unsigned int index, FT_Face & face); |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | void verifyCharacterMap(FT_Face face); |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | FreeTypeLibrary(); |
|---|
| 57 | |
|---|
| 58 | typedef std::set< FreeTypeFont* > FontImplementationSet; |
|---|
| 59 | |
|---|
| 60 | mutable OpenThreads::Mutex _mutex; |
|---|
| 61 | FT_Library _ftlibrary; |
|---|
| 62 | FontImplementationSet _fontImplementationSet; |
|---|
| 63 | |
|---|
| 64 | }; |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | #endif |
|---|