EStatusCode FreeTypeFaceWrapper::GetGlyphsForUnicodeText(const ULongList& inUnicodeCharacters,UIntList& outGlyphs) { if(mFace) { FT_UInt glyphIndex; EStatusCode status = PDFHummus::eSuccess; outGlyphs.clear(); ULongList::const_iterator it = inUnicodeCharacters.begin(); for(; it != inUnicodeCharacters.end(); ++it) { if ( mFormatParticularWrapper && mFormatParticularWrapper->HasPrivateEncoding() ) { glyphIndex = mFormatParticularWrapper->GetGlyphForUnicodeChar(*it); // glyphIndex == 0 is allowed in some Type1 fonts with custom encoding } else { glyphIndex = FT_Get_Char_Index(mFace,*it); if(0 == glyphIndex) { TRACE_LOG1("FreeTypeFaceWrapper::GetGlyphsForUnicodeText, failed to find glyph for charachter 0x%04x",*it); status = PDFHummus::eFailure; } } outGlyphs.push_back(glyphIndex); } return status; } else return PDFHummus::eFailure; }
EStatusCode FreeTypeFaceWrapper::GetGlyphsForUnicodeText(const ULongList& inUnicodeCharacters,UIntList& outGlyphs) { if(mFace) { FT_UInt glyphIndex; EStatusCode status = PDFHummus::eSuccess; outGlyphs.clear(); ULongList::const_iterator it = inUnicodeCharacters.begin(); for(; it != inUnicodeCharacters.end() && PDFHummus::eSuccess == status; ++it) { glyphIndex = FT_Get_Char_Index(mFace,*it); outGlyphs.push_back(glyphIndex); if(0 == glyphIndex) { TRACE_LOG1("FreeTypeFaceWrapper::GetGlyphsForUnicodeText, failed to find glyph for charachter 0x%04x",*it); status = PDFHummus::eFailure; } } return status; } else return PDFHummus::eFailure; }
EStatusCode FreeTypeFaceWrapper::GetGlyphsForUnicodeText(const ULongList& inUnicodeCharacters,UIntList& outGlyphs) { if(mFace) { FT_UInt glyphIndex; EStatusCode status = PDFHummus::eSuccess; outGlyphs.clear(); ULongList::const_iterator it = inUnicodeCharacters.begin(); for(; it != inUnicodeCharacters.end(); ++it) { if ( mFormatParticularWrapper && mFormatParticularWrapper->HasPrivateEncoding() ) { glyphIndex = mFormatParticularWrapper->GetGlyphForUnicodeChar(*it); // glyphIndex == 0 is allowed in some Type1 fonts with custom encoding } else { FT_ULong charCode = *it; if (mUsePUACodes && charCode <= 0xff) // move charcode to pua are in case we should use pua and they are in plain ascii range charCode = 0xF000 | charCode; glyphIndex = FT_Get_Char_Index(mFace,charCode); if(0 == glyphIndex) { TRACE_LOG1("FreeTypeFaceWrapper::GetGlyphsForUnicodeText, failed to find glyph for charachter 0x%04x",*it); status = PDFHummus::eFailure; } } outGlyphs.push_back(glyphIndex); } return status; } else return PDFHummus::eFailure; }