The PDF 1.7 specification was superseded in 2008(!!) by ISO 32000-1 as the 
official PDF standard.   ISO 32000-1 does not contain that section and 
therefore it should be ignored as it no longer has any bearing.

Leonard
PDF Architect ยท Senior Principal Scientist  |  Adobe Systems Incorporated  |  
p. 408.536.2433  |  c. 215.808.4978  |  leona...@adobe.com
 


On 2/20/17, 12:16 AM, "Nikita Shlyapnikov" <nik...@gkmsoft.ru> wrote:

    On 2/16/2017 9:03 PM, zyx wrote:
    > this statement is not correct, at least not for TrueType fonts.
    >
    > Section 5.5.2 of PDF 1.7 reference says:
    >   | If the font in a source document uses a bold or italic style but
    >   | there is no font data for that style, the host operating system
    >   | synthesizes the style. In this case, a comma and the style name
    >   | (one of Bold , Italic , or BoldItalic ) are appended to the font
    >   | name. For example, for a TrueType font that is a bold variant of
    >   | the New York font, the BaseFont value is written as
    >   | /NewYork,Bold (as illustrated in Example 5.8).
      Hi ,
      You are right about the specification.
    However there seems to be some issues.
    First, in the PoDoFo library only the PdfFontCID class adds ",Bold" 
    ",Italic" and other postfixes. This leads to differences in font objects 
    created with different encodings.
    Second, the fonts created with 'embed' parameter set to true do not 
    exhibit such a behaviour.
    
    A simple test:
    
         PdfStreamedDocument document( pszFilename );
         PdfPainter painter;
         PdfPage* pPage = document.CreatePage( 
    PdfPage::CreateStandardPageSize( ePdfPageSize_A4 ) );
         painter.SetPage( pPage );
         PdfFont* pFont = document.CreateFont( "Wingdings", true, true, 
    false, PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), 
    PdfFontCache::eFontCreationFlags_AutoSelectBase14, false);
         pFont->SetFontSize( 18.0 );
         painter.SetFont( pFont );
         painter.DrawText( 56.69, pPage->GetPageSize().GetHeight() - 56.69, 
    "Hello World!" );
         painter.FinishPage();
         document.Close();
    
    The attachments show the results of the following font creation calls
         WindingsBoldItalic_Identity - CreateFont( "Wingdings", true, true, 
    false, PdfEncodingFactory::GlobalIdentityEncodingInstance(), 
    PdfFontCache::eFontCreationFlags_AutoSelectBase14, false);
         WindingsBoldItalic_Identity_Embed - CreateFont( "Wingdings", true, 
    true, false, PdfEncodingFactory::GlobalIdentityEncodingInstance(), 
    PdfFontCache::eFontCreationFlags_AutoSelectBase14, true );
         WindingsBoldItalic_WinAnsi - CreateFont( "Wingdings", true, true, 
    false, PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), 
    PdfFontCache::eFontCreationFlags_AutoSelectBase14, false);
    
    Regards Nikita Shlyapnikov.
    
    

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to