Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EPdfFontType PdfFontFactory::GetFontType( const char* pszFilename )
- {
- EPdfFontType eFontType = ePdfFontType_Unknown;
- // We check by file extension right now
- // which is not quite correct, but still better than before
- if( pszFilename && strlen( pszFilename ) > 3 )
- {
- const char* pszExtension = pszFilename + strlen( pszFilename ) - 3;
- if( PoDoFo::compat::strncasecmp( pszExtension, "ttf", 3 ) == 0 )
- eFontType = ePdfFontType_TrueType;
- else if( PoDoFo::compat::strncasecmp( pszExtension, "otf", 3 ) == 0 )
- eFontType = ePdfFontType_TrueType;
- else if( PoDoFo::compat::strncasecmp( pszExtension, "ttc", 3 ) == 0 )
- eFontType = ePdfFontType_TrueType;
- else if( PoDoFo::compat::strncasecmp( pszExtension, "pfa", 3 ) == 0 )
- eFontType = ePdfFontType_Type1Pfa;
- else if( PoDoFo::compat::strncasecmp( pszExtension, "pfb", 3 ) == 0 )
- eFontType = ePdfFontType_Type1Pfb;
- }
- return eFontType;
- }
Advertisement
Add Comment
Please, Sign In to add comment