Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

FtFace Struct Reference

Base Class FtFace provides an ScFace private implementation for Freetype based fonts. Subclasses are ScFace_ps and ScFace_ttf. More...

#include <ftface.h>

Inheritance diagram for FtFace:

Inheritance graph
[legend]
Collaboration diagram for FtFace:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FtFace (QString fam, QString sty, QString variant, QString scname, QString psname, QString path, int face)
FT_Face ftFace () const
virtual ~FtFace ()
double ascent (double sz=1.0) const
double descent (double sz=1.0) const
double xHeight (double sz=1.0) const
double capHeight (double sz=1.0) const
double height (double sz=1.0) const
double strikeoutPos (double sz=1.0) const
double underlinePos (double sz=1.0) const
double strokeWidth (double) const
double maxAdvanceWidth (double sz=1.0) const
QString ascentAsString () const
QString descentAsString () const
QString capHeightAsString () const
QString FontBBoxAsString () const
QString ItalicAngleAsString () const
uint char2CMap (QChar ch) const
double glyphKerning (uint gl1, uint gl2, double sz) const
void RawData (QByteArray &bb) const
bool glyphNames (QMap< uint, std::pair< QChar, QString > > &GList) const
void load () const
void unload () const
void loadGlyph (uint ch) const

Protected Attributes

FT_Face m_face
QString Ascent
QString CapHeight
QString Descender
QString ItalicAngle
QString StdVW
QString FontEnc
QString FontBBox
int m_encoding
double m_uniEM
double m_ascent
double m_descent
double m_height
double m_xHeight
double m_capHeight
double m_maxAdvanceWidth
double m_underlinePos
double m_strikeoutPos
double m_strokeWidth

Static Protected Attributes

static FT_Library library = NULL


Detailed Description

Base Class FtFace provides an ScFace private implementation for Freetype based fonts. Subclasses are ScFace_ps and ScFace_ttf.

Below is the old docs for class Foi:

This is subclassed by a class to handle Type1 fonts, a class to handle TrueType fonts, and potentially any other type that becomes appropriate in the future. Note the virtual destructor, needed to ensure that the correct destructor is called for subclasses

The RealName field has been changed from a data member to a member function. This is because the only place the PostScript real name of a font is required is the printing code, so it's cheaper to extract this information only when it is required, for just the used fonts, than for every one of potentially hundreds at application startup! This also allows for the fact that truetype fonts will require a different method of extracting their names.

One implication of using a base class/subclass model for fonts: It is no longer possible to store the ScFace structures in a QMap. This is because QMap allocates its own structures, and copies the supplied data to them. A QMap<QString,ScFace> would demote all subclasses to ScFace classes, and hence break the polymorphism. QDict can be used instead, with very little change to the rest of the code, since it stores references to the data instead of copying the data. With AutoDelete set to true, it will automatically dispose of all data when its destructor is called, so there are no extra cleaning-up chores to take care of.

Definition at line 49 of file ftface.h.


Constructor & Destructor Documentation

FtFace::FtFace ( QString  fam,
QString  sty,
QString  variant,
QString  scname,
QString  psname,
QString  path,
int  face 
)

FtFace::~FtFace (  )  [virtual]

Definition at line 53 of file ftface.cpp.

References unload().


Member Function Documentation

FT_Face FtFace::ftFace (  )  const

double FtFace::ascent ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 60 of file ftface.h.

double FtFace::descent ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 61 of file ftface.h.

double FtFace::xHeight ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 62 of file ftface.h.

double FtFace::capHeight ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 63 of file ftface.h.

double FtFace::height ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 64 of file ftface.h.

Referenced by loadGlyph().

double FtFace::strikeoutPos ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 65 of file ftface.h.

double FtFace::underlinePos ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 66 of file ftface.h.

double FtFace::strokeWidth ( double   )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 67 of file ftface.h.

double FtFace::maxAdvanceWidth ( double  sz = 1.0  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 68 of file ftface.h.

QString FtFace::ascentAsString (  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 69 of file ftface.h.

QString FtFace::descentAsString (  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 70 of file ftface.h.

QString FtFace::capHeightAsString (  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 71 of file ftface.h.

QString FtFace::FontBBoxAsString (  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 72 of file ftface.h.

QString FtFace::ItalicAngleAsString (  )  const [inline, virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 73 of file ftface.h.

uint FtFace::char2CMap ( QChar  ch  )  const [virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 159 of file ftface.cpp.

References ftFace().

double FtFace::glyphKerning ( uint  gl1,
uint  gl2,
double  sz 
) const [virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 216 of file ftface.cpp.

References ftFace(), m_uniEM, ScFace::ScFaceData::scName, and sDebug().

void FtFace::RawData ( QByteArray &  bb  )  const [virtual]

bool FtFace::glyphNames ( QMap< uint, std::pair< QChar, QString > > &  GList  )  const [virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 302 of file ftface.cpp.

References ftFace(), and GlyNames().

void FtFace::load (  )  const [virtual]

void FtFace::unload (  )  const [virtual]

Reimplemented from ScFace::ScFaceData.

Definition at line 148 of file ftface.cpp.

References m_face.

Referenced by ~FtFace().

void FtFace::loadGlyph ( uint  ch  )  const [virtual]


Member Data Documentation

FT_Face FtFace::m_face [mutable, protected]

Definition at line 90 of file ftface.h.

Referenced by ftFace(), load(), and unload().

FT_Library FtFace::library = NULL [static, protected]

Definition at line 92 of file ftface.h.

Referenced by ftFace(), FtFace(), and load().

QString FtFace::Ascent [mutable, protected]

Definition at line 94 of file ftface.h.

Referenced by load().

QString FtFace::CapHeight [mutable, protected]

Definition at line 95 of file ftface.h.

Referenced by load().

QString FtFace::Descender [mutable, protected]

Definition at line 96 of file ftface.h.

Referenced by load().

QString FtFace::ItalicAngle [mutable, protected]

Definition at line 97 of file ftface.h.

Referenced by load().

QString FtFace::StdVW [mutable, protected]

Definition at line 98 of file ftface.h.

QString FtFace::FontEnc [protected]

Definition at line 99 of file ftface.h.

QString FtFace::FontBBox [mutable, protected]

Definition at line 100 of file ftface.h.

Referenced by ScFace_ttf::EmbedFont(), and load().

int FtFace::m_encoding [mutable, protected]

Definition at line 102 of file ftface.h.

Referenced by load().

double FtFace::m_uniEM [mutable, protected]

Definition at line 104 of file ftface.h.

Referenced by glyphKerning(), load(), and loadGlyph().

double FtFace::m_ascent [mutable, protected]

Definition at line 105 of file ftface.h.

Referenced by load().

double FtFace::m_descent [mutable, protected]

Definition at line 106 of file ftface.h.

Referenced by load().

double FtFace::m_height [mutable, protected]

Definition at line 107 of file ftface.h.

Referenced by load().

double FtFace::m_xHeight [mutable, protected]

Definition at line 108 of file ftface.h.

Referenced by load().

double FtFace::m_capHeight [mutable, protected]

Definition at line 109 of file ftface.h.

Referenced by load().

double FtFace::m_maxAdvanceWidth [mutable, protected]

Definition at line 110 of file ftface.h.

Referenced by load().

double FtFace::m_underlinePos [mutable, protected]

Definition at line 111 of file ftface.h.

Referenced by load().

double FtFace::m_strikeoutPos [mutable, protected]

Definition at line 112 of file ftface.h.

Referenced by load().

double FtFace::m_strokeWidth [mutable, protected]

Definition at line 113 of file ftface.h.

Referenced by load().


The documentation for this struct was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.