libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
Art::Paperback::Graphics::Standard_font Class Reference

Represents a standard PDF font. More...

#include <art/paperback/graphics/standard-font.hxx>

Inheritance diagram for Art::Paperback::Graphics::Standard_font:

Classes

struct  Internal
 

Public Member Functions

 Standard_font (Document &, string const &)
 Constructor.
 
 ~Standard_font () noexcept override
 Destructor.
 
Documentdocument () override
 Access the parent document of this font.
 
Carousel::Object object () override
 Get the COS object for this font.
 
string name () const override
 Get the name of the font.
 
int16_t get_ascent () const override
 
int16_t get_descent () const override
 
uint16_t get_xheight () const override
 
uint16_t get_capheight () const override
 
Text_width get_text_width (string const &) override
 text is assumed to be encoded in UTF-8 and will be decoded as such during text width computation.
 

Private Member Functions

 Standard_font (Standard_font const &)=delete
 
 Standard_font (Standard_font &&)=delete
 
Standard_fontoperator= (Standard_font const &)=delete
 
Standard_fontoperator= (Standard_font &&)=delete
 

Private Attributes

unique_ptr< Internalinternal
 

Detailed Description

Represents a standard PDF font.

This class represents one of the 14 standard fonts supported by the PDF-specification.

Constructor & Destructor Documentation

◆ Standard_font()

Art::Paperback::Graphics::Standard_font::Standard_font ( Document & document,
string const & base_font )

Constructor.

Parameters
documentA reference to the parent document.
base_fontThe name of the base font.

◆ ~Standard_font()

Art::Paperback::Graphics::Standard_font::~Standard_font ( )
overridenoexcept

Destructor.

Member Function Documentation

◆ document()

Document & Art::Paperback::Graphics::Standard_font::document ( )
overridevirtual

Access the parent document of this font.

Implements Art::Paperback::Graphics::Font.

◆ object()

Carousel::Object Art::Paperback::Graphics::Standard_font::object ( )
overridevirtual

Get the COS object for this font.

Implements Art::Paperback::Graphics::Font.

◆ name()

string Art::Paperback::Graphics::Standard_font::name ( ) const
overridevirtual

Get the name of the font.

Returns
Returns the name of the font.

Implements Art::Paperback::Graphics::Font.

◆ get_ascent()

int16_t Art::Paperback::Graphics::Standard_font::get_ascent ( ) const
overridevirtual
Returns
Returns the font ascent.

Implements Art::Paperback::Graphics::Font.

◆ get_descent()

int16_t Art::Paperback::Graphics::Standard_font::get_descent ( ) const
overridevirtual
Returns
Returns the font descent.

Implements Art::Paperback::Graphics::Font.

◆ get_xheight()

uint16_t Art::Paperback::Graphics::Standard_font::get_xheight ( ) const
overridevirtual
Returns
Returns the font X-height.

Implements Art::Paperback::Graphics::Font.

◆ get_capheight()

uint16_t Art::Paperback::Graphics::Standard_font::get_capheight ( ) const
overridevirtual
Returns
Returns the font Cap-height.

Implements Art::Paperback::Graphics::Font.

◆ get_text_width()

Text_width Art::Paperback::Graphics::Standard_font::get_text_width ( string const & text)
overridevirtual

text is assumed to be encoded in UTF-8 and will be decoded as such during text width computation.

Parameters
textThe text for which to compute metrics.

Implements Art::Paperback::Graphics::Font.