Scribus
Open source desktop publishing at your fingertips
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:
Collaboration diagram for FtFace:

Public Member Functions

 FtFace (QString fam, QString sty, QString variant, QString scname, QString psname, QString path, int face)
 
FT_Face ftFace () const
 
qreal ascent (qreal sz=1.0) const
 
qreal descent (qreal sz=1.0) const
 
qreal xHeight (qreal sz=1.0) const
 
qreal capHeight (qreal sz=1.0) const
 
qreal height (qreal sz=1.0) const
 
qreal strikeoutPos (qreal sz=1.0) const
 
qreal underlinePos (qreal sz=1.0) const
 
qreal strokeWidth (qreal) const
 
qreal maxAdvanceWidth (qreal sz=1.0) const
 
QString pdfAscentAsString () const
 
QString pdfDescentAsString () const
 
QString pdfCapHeightAsString () const
 
QString pdfFontBBoxAsString () const
 
QString italicAngleAsString () const
 
ScFace::gid_type char2CMap (QChar ch) const
 
qreal glyphKerning (ScFace::gid_type gl1, ScFace::gid_type gl2, qreal sz) const
 
void RawData (QByteArray &bb) const
 
virtual bool glyphNames (ScFace::FaceEncoding &GList) const
 
void load () const
 
void unload () const
 
void loadGlyph (ScFace::gid_type gl) const
 

Static Public Member Functions

static bool hasMicrosoftUnicodeCmap (FT_Face face)
 
static QString adobeGlyphName (FT_ULong charcode)
 

Protected Attributes

FT_Face m_face
 
QString m_pdfAscent
 
QString m_pdfCapHeight
 
QString m_pdfDescender
 
QString m_italicAngle
 
QString m_pdfFontBBox
 
int m_encoding
 
qreal m_uniEM
 
qreal m_ascent
 
qreal m_descent
 
qreal m_height
 
qreal m_xHeight
 
qreal m_capHeight
 
qreal m_maxAdvanceWidth
 
qreal m_underlinePos
 
qreal m_strikeoutPos
 
qreal m_strokeWidth
 
- Protected Attributes inherited from ScFace::ScFaceData
Status cachedStatus
 
QHash< gid_type, qreal > m_glyphWidth
 
QHash< gid_type, GlyphDatam_glyphOutline
 

Static Protected Attributes

static FT_Library library = NULL
 

Additional Inherited Members

- Public Attributes inherited from ScFace::ScFaceData
int refs
 controls destruction
 
int usage
 controls load()
 
QString scName
 
QString fontFile
 
int faceIndex
 
QString psName
 
QString family
 
QString style
 
QString variant
 
QString forDocument
 
ScFace::Status status
 
ScFace::FontType typeCode
 
ScFace::FontFormat formatCode
 
bool usable
 
bool embedPs
 
bool subset
 
bool outline
 
bool isStroked
 
bool isFixedPitch
 
bool hasGlyphNames
 
gid_type maxGlyph
 
- Protected Member Functions inherited from ScFace::ScFaceData
virtual QMap< QString, QString > fontDictionary (qreal sz=1.0) const
 
virtual GlyphMetrics glyphBBox (gid_type gl, qreal sz) const
 
virtual bool EmbedFont (QByteArray &) const
 
virtual bool hasNames () const
 
virtual bool glyphNames (QMap< gid_type, std::pair< ucs4_type, QString > > &gList) const
 
virtual qreal glyphWidth (gid_type gl, qreal sz) const
 
virtual FPointArray glyphOutline (gid_type gl, qreal sz) const
 
virtual FPoint glyphOrigin (gid_type gl, qreal sz) const
 
virtual bool isSymbolic () const
 

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.


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