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 callsWindingsBoldItalic_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.
WindingsBoldItalic_Identity.pdf
Description: Adobe PDF document
WindingsBoldItalic_Identity_Embed.pdf
Description: Adobe PDF document
WindingsBoldItalic_WinAnsi.pdf
Description: Adobe PDF document
------------------------------------------------------------------------------ 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