Hi,

for me character spacing with PdfIdentityEncoding works only on CID
fonts (method CreateFontSubset). Correct spacing on TTF fonts without
subsetting has only single byte encodings.

Best regards J. Rokos

On Wed, Nov 16, 2016 at 1:18 PM, liben...@zhongfu.net
<liben...@zhongfu.net> wrote:
> hi,all:
>     I have some sample code, but  it seems not  work properly.
>     The spacing between letters is larger than the normal word.
>     It seems that a English letter takes up two positions. But the chinese
> words displays correctly.
>     I have worked four days on this problem, but the problem is still not
> solved.
>
>     PdfStreamedDocument document( "hello-pdf.pdf" );
>     PdfPainter painter;
>     PdfPage* pPage;
>     PdfFont* pFont;
>     pPage = document.CreatePage( PdfPage::CreateStandardPageSize(
> ePdfPageSize_A4 ) );
>     painter.SetPage( pPage );
>
>     PdfIdentityEncoding *encoding = new PdfIdentityEncoding(0,0xffff,false);
>     pFont = document.CreateFont( "SimHei", false, (PdfEncoding*)encoding);
>     //pFont = document.CreateFont( "SimHei");
>     pFont->SetFontSize( 18.0 );
>     painter.SetFont( pFont );
>
>     painter.DrawText( 56.69, pPage->GetPageSize().GetHeight() - 56.69,
> "Hello World!" );
>
>     painter.DrawText( 56.69, pPage->GetPageSize().GetHeight() - 56.69-
> 26.69, PdfString( reinterpret_cast<const pdf_utf8*>("你好")) );
>
>     painter.FinishPage();
>     document.Close();
>
> could someone help me?
> sorry for my poor English.
> best wishes!
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users
>

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to