Ejemplo n.º 1
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *data - 
//			size - 
//-----------------------------------------------------------------------------
void CSentence::InitFromDataChunk( void *data, int size )
{
	CUtlBuffer buf( 0, 0, CUtlBuffer::TEXT_BUFFER );
	buf.EnsureCapacity( size );
	buf.Put( data, size );
	buf.SeekPut( CUtlBuffer::SEEK_HEAD, size );

	InitFromBuffer( buf );
}
PdfFontMetricsFreetype::PdfFontMetricsFreetype( FT_Library* pLibrary, 
                                                const PdfRefCountedBuffer & rBuffer,
                                                const char* pszSubsetPrefix ) 
    : PdfFontMetrics( ePdfFontType_Unknown, "", pszSubsetPrefix ),
      m_pLibrary( pLibrary ),
      m_pFace( NULL ),
      m_bSymbol( false ),
      m_bufFontData( rBuffer )
{
    InitFromBuffer();
}
PdfFontMetricsFreetype::PdfFontMetricsFreetype( FT_Library* pLibrary, 
                                                const char* pBuffer, unsigned int nBufLen,
                                                const char* pszSubsetPrefix )
    : PdfFontMetrics( ePdfFontType_Unknown, "", pszSubsetPrefix ),
      m_pLibrary( pLibrary ),
      m_pFace( NULL ),
      m_bSymbol( false )
{
    m_bufFontData = PdfRefCountedBuffer( nBufLen ); // const_cast is ok, because we SetTakePossension to false!
    memcpy( m_bufFontData.GetBuffer(), pBuffer, nBufLen );

    InitFromBuffer();
}