pdfobjects::CPageFonts Class Reference

#include <cpagefonts.h>

Inheritance diagram for pdfobjects::CPageFonts:
pdfobjects::ICPageModule

List of all members.

Public Types

typedef std::list< std::string > SystemFontList
typedef std::vector< std::pair
< std::string, std::string > > 
FontList

Public Member Functions

 CPageFonts (CPage *page)
 ~CPageFonts ()
void getFontIdsAndNames (FontList &cont) const
std::string addSystemType1Font (const std::string &fontname, bool winansienc=true)

Static Public Member Functions

static SystemFontList getSystemFonts ()

Private Attributes

CPage_page

Static Private Attributes

static const char * PDFEDIT_FONTID = "PDFEDIT_F"

Detailed Description

Class representing page fonts.


Member Typedef Documentation

typedef std::vector<std::pair<std::string, std::string> > pdfobjects::CPageFonts::FontList

Type for list of fonts.

typedef std::list<std::string> pdfobjects::CPageFonts::SystemFontList

Constructor & Destructor Documentation

pdfobjects::CPageFonts::CPageFonts ( CPage page  )  [inline]
pdfobjects::CPageFonts::~CPageFonts (  )  [inline]

References _page.


Member Function Documentation

std::string pdfobjects::CPageFonts::addSystemType1Font ( const std::string &  fontname,
bool  winansienc = true 
)

Add new simple type 1 font item to the page resource dictionary.

The id of this font is arbitrary but it has to be unique. It will be generated as PDFEDIT_F#, where # is the lowest free number so that name is unique.

We supposed that the font name is a standard system font avaliable to all viewers.

Parameters:
fontname Name of the font to add.
winansienc Set encoding to standard WinAnsiEnconding.
Returns:
The font ID of the added font.

References _page, pdfobjects::CPageAttributes::InheritedAttributes::_resources, pdfobjects::Specification::Font::BASEFONT, pdfobjects::CPage::display(), pdfobjects::Specification::Font::ENCODING, pdfobjects::CPageAttributes::fillInherited(), pdfobjects::getCDictFromDict(), pdfobjects::CPage::getContentStreams(), pdfobjects::CPage::getDictionary(), getFontIdsAndNames(), PDFEDIT_FONTID, pdfobjects::Specification::Page::RESOURCES, pdfobjects::Specification::Font::SUBTYPE, pdfobjects::Specification::Dict::TYPE, pdfobjects::Specification::Font::TYPE, pdfobjects::Specification::Font::TYPE1, and pdfobjects::Specification::Font::WINANSIENCODING.

void pdfobjects::CPageFonts::getFontIdsAndNames ( FontList cont  )  const

Get all font ids and base names that are in the resource dictionary of a page.

The resource can be inherited from a parent in the page tree dictionary. Base names should be human readable or at least standard system fonts defined in the pdf specification. We must choose from these items to make a font change valid. Otherwise, we have to add standard system font or manually a font object.

Parameters:
cont Output container of font id and basename pairs (FontList container type should be prefered).

References _page, pdfobjects::CPageAttributes::InheritedAttributes::_resources, pdfobjects::Specification::Font::BASEFONT, debug::DBG_INFO, pdfobjects::CPageAttributes::fillInherited(), pdfobjects::getCDictFromDict(), pdfobjects::CPage::getDictionary(), pdfobjects::utils::getNameFromDict(), kernelPrintDbg, pdfobjects::Specification::Font::SUBTYPE, and pdfobjects::Specification::Font::TYPE.

Referenced by addSystemType1Font().

static SystemFontList pdfobjects::CPageFonts::getSystemFonts (  )  [inline, static]

Get all system fonts which should be supported by all pdf viewers.


Member Data Documentation

Pdf dictionary representing a page.

Referenced by addSystemType1Font(), getFontIdsAndNames(), and ~CPageFonts().

const char * pdfobjects::CPageFonts::PDFEDIT_FONTID = "PDFEDIT_F" [static, private]

Referenced by addSystemType1Font().


The documentation for this class was generated from the following files: