mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 14:00:32 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62634 954022d7-b5bf-4e40-9824-e11837661b57
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#include "stdafx.h"
|
|
|
|
#include "FT_FontEngine.h"
|
|
#include "FT_FontFile.h"
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------
|
|
// CFreeTypeFontEngine
|
|
//-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
CFreeTypeFontEngine::CFreeTypeFontEngine(BOOL bAntiAliasing, FT_Library pLibary, BOOL bUseKerning)
|
|
{
|
|
FT_Int nMajor, nMinor, nPatch;
|
|
|
|
m_bAntiAliasing = bAntiAliasing;
|
|
m_pLibrary = pLibary;
|
|
m_bUseKerning = bUseKerning;
|
|
|
|
// ó÷èòûâàåì ÷òî äî âåðñèè FT 2.1.8, CID øðèôòû áûëè íóìåðîâàíû ïî CID âìåñòî GID
|
|
FT_Library_Version( m_pLibrary, &nMajor, &nMinor, &nPatch );
|
|
|
|
m_bUseCIDs = nMajor > 2 || ( nMajor == 2 && ( nMinor > 1 || ( nMinor == 1 && nPatch > 7 ) ) );
|
|
}
|
|
|
|
CFreeTypeFontEngine *CFreeTypeFontEngine::Initialize(BOOL bAntiAliasing, BOOL bUseKerning)
|
|
{
|
|
FT_Library pLibrary = NULL;
|
|
|
|
if ( FT_Init_FreeType( &pLibrary ) )
|
|
{
|
|
return NULL;
|
|
}
|
|
return new CFreeTypeFontEngine( bAntiAliasing, pLibrary, bUseKerning );
|
|
}
|
|
|
|
CFreeTypeFontEngine::~CFreeTypeFontEngine()
|
|
{
|
|
FT_Done_FreeType( m_pLibrary );
|
|
}
|
|
|
|
CFontFile *CFreeTypeFontEngine::LoadFont(wchar_t *wsFilePath, long lIndex)
|
|
{
|
|
CFontFile *pFontFile = CFreeTypeFontFile::LoadFont( this, wsFilePath, lIndex );
|
|
|
|
return pFontFile;
|
|
}
|
|
|