#if !defined(CDP_ADFREETYPE_H_INC) //DOM-IGNORE-BEGIN #define CDP_ADFREETYPE_H_INC //DOM-IGNORE-END //# adfreetype.h //# //* Provides a thin C++ wrapper around the FreeType2 library //# //# Copyright © 2013 CDP Communications Inc. All Rights Reserved //# //# Warning: This computer program is protected by copyright law and //# international treaties. Unauthorized reproduction or distribution //# of this program, or any portion of it, may result in severe civil and //# criminal penalties, and will be prosecuted to the maximum extent //# possible under the law. //////////////////////////////////////////////////////////////////////////////// typedef struct FT_LibraryRec_* FT_Library; class AdFreeTypeLibrary { private: AdFreeTypeLibrary ( const AdFreeTypeLibrary& ); const AdFreeTypeLibrary& operator= ( const AdFreeTypeLibrary& ); public: AdFreeTypeLibrary ( ); ~AdFreeTypeLibrary ( ); FT_Library Library ( ) const; void VersionReleaseInformation ( int &version, int &release, int &patch); private: FT_Library ftLibrary_; }; typedef struct FT_FaceRec_* FT_Face; typedef void (*ReleaseTypefaceMemoryCallBackSite_t)(const unsigned char* typefaceMemory, size_t cTypefaceMemory); class AdFontFace { private: AdFontFace ( ); AdFontFace (const AdFontFace&); const AdFontFace& operator= (const AdFontFace&); public: AdFontFace (FT_Library ftLibrary, const unsigned char* typefaceMemory, size_t cTypefaceMemory, ReleaseTypefaceMemoryCallBackSite_t releaseMemoryFunction ); virtual ~AdFontFace ( ); FT_Face Face ( ) const; FT_Library Library ( ) const; private: FT_Face ftFace_; FT_Library ftLibrary_; const unsigned char* typefaceMemory_; ReleaseTypefaceMemoryCallBackSite_t releaseMemoryFunction_; size_t cTypefaceMemory_; }; class FontTableLoader { private: FontTableLoader (const FontTableLoader&); const FontTableLoader& operator= (const FontTableLoader&); public: FontTableLoader ( ); ~FontTableLoader ( ); int Load (unsigned long tag, AdFontFace& face); const unsigned char* Table ( ) const; size_t Size ( ) const; const unsigned char* HexDumpBytes (size_t offset, size_t cBytes); private: struct Impl; Impl* impl_; }; class OS2Table { private: OS2Table ( ); OS2Table (const OS2Table&); const OS2Table& operator= (const OS2Table&); public: OS2Table ( FontTableLoader& fontTable ); ~OS2Table ( ); int Load (AdFontFace& face); unsigned short Version ( ) const; const unsigned char* Panose ( ); unsigned long ulUnicodeRange1 ( ) const; unsigned long ulUnicodeRange2 ( ) const; unsigned long ulUnicodeRange3 ( ) const; unsigned long ulUnicodeRange4 ( ) const; unsigned long ulCodePageRange1 ( ) const; unsigned long ulCodePageRange2 ( ) const; private: FontTableLoader& fontTable_; }; #endif // !defined(CDP_ADFREETYPE_H_INC)