Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

pdf::font::CSimple Class Reference

class for a simple font in a PDF file More...

#include <Simple.hh>

Inheritance diagram for pdf::font::CSimple:

Inheritance graph
[legend]
Collaboration diagram for pdf::font::CSimple:

Collaboration graph
[legend]
List of all members.

Protected Methods

Private Attributes


Detailed Description

class for a simple font in a PDF file

this class represents a simple font. a simple font in PDF includes type 1 fonts, truetype fonts and type 3 fonts, i.e. all except composite fonts. this class is the base class of these simple fonts.

this class is abstract. it does not define some pure virtual functions.


Constructor & Destructor Documentation

pdf::font::CSimple::CSimple const core::CName   sub_type,
const std::string &    base_name = std::string( )
[protected]
 

protected constructor. it initalizes everything it can: font sub type, and base name. sometimes the base name is not known yet. it can be specified later, by calling the BaseName() function.

00040     : CFont( sub_type ), m_base_name( base_name )
00041 {
00042 }

pdf::font::CSimple::~CSimple   [protected]
 

destructor do nothing

00046 {
00047 }


Member Function Documentation

void pdf::font::CSimple::BaseName const std::string &    base_name [protected]
 

sets the font base name.

Parameters:
base_name  the font base name. must not be empty.

00080 {
00081     assert( !base_name.empty( ) ) ;
00082     m_base_name = base_name ;
00083 }

const std::string& pdf::font::CSimple::BaseName   const [inline, protected]
 

gets the font base name

00068 { return m_base_name ; }

core::CDictionary * pdf::font::CSimple::MakeFontDict   const [protected]
 

this function will create a basic font dictionary. probably the derived classes have to add extra fields to the dictionary before writing it out. they will use the returned pointer to the dictionary to do so.

Returns:
the newly created font dictionary. should be deleted or stored in auto_ptrs
Exceptions:
util::CError  if the font base name or subtype is empty.

00058 {
00059     using namespace core ;
00060 
00061     if ( m_base_name.empty( ) )
00062         throw CBadBaseFontName( ) ;
00063 
00064     if ( SubType( ).empty( ) )
00065         throw CBadSubType( ) ;
00066 
00067     CDictionary *font = new CDictionary ;
00068     PrintType( *font ) ;
00069 
00070     font->AddPair( "BaseFont", m_base_name ) ;
00071     font->AddPair( "Encoding", "WinAnsiEncoding" ) ;
00072 
00073     return font ;
00074 }


Member Data Documentation

std::string pdf::font::CSimple::m_base_name [private]
 

font base name. e.g. for times new roman the base name is "Times New Roman"


The documentation for this class was generated from the following files:
Generated on Sun Feb 2 09:17:20 2003 for libpdf++ by doxygen1.2.16