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>


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 | |||
| ) |
Definition at line 35 of file ftface.cpp.
References ScFace::ScFaceData::faceIndex, ScFace::ScFaceData::family, ScFace::ScFaceData::fontFile, library, ScFace::ScFaceData::psName, ScFace::ScFaceData::scName, sDebug(), ScFace::ScFaceData::style, tr(), and ScFace::ScFaceData::variant.
| FtFace::~FtFace | ( | ) | [virtual] |
Member Function Documentation
| FT_Face FtFace::ftFace | ( | ) | const |
Definition at line 58 of file ftface.cpp.
References ScFace::BROKEN, ScFace::ScFaceData::faceIndex, ScFace::ScFaceData::fontFile, library, load(), m_face, sDebug(), ScFace::ScFaceData::status, and tr().
Referenced by char2CMap(), ScFace_ttf::EmbedFont(), glyphKerning(), glyphNames(), ScFace_postscript::load(), loadGlyph(), and RawData().
| double FtFace::ascent | ( | double | sz = 1.0 |
) | const [inline, virtual] |
| double FtFace::descent | ( | double | sz = 1.0 |
) | const [inline, virtual] |
| double FtFace::xHeight | ( | double | sz = 1.0 |
) | const [inline, virtual] |
| double FtFace::capHeight | ( | double | sz = 1.0 |
) | const [inline, virtual] |
| 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] |
| double FtFace::underlinePos | ( | double | sz = 1.0 |
) | const [inline, virtual] |
| double FtFace::strokeWidth | ( | double | ) | const [inline, virtual] |
| double FtFace::maxAdvanceWidth | ( | double | sz = 1.0 |
) | const [inline, virtual] |
| QString FtFace::ascentAsString | ( | ) | const [inline, virtual] |
| QString FtFace::descentAsString | ( | ) | const [inline, virtual] |
| QString FtFace::capHeightAsString | ( | ) | const [inline, virtual] |
| QString FtFace::FontBBoxAsString | ( | ) | const [inline, virtual] |
| QString FtFace::ItalicAngleAsString | ( | ) | const [inline, virtual] |
| 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] |
Reimplemented from ScFace::ScFaceData.
Reimplemented in ScFace_ttf.
Definition at line 308 of file ftface.cpp.
References ScFace::BROKENGLYPHS, ScFace::ScFaceData::fontFile, ftFace(), ftIOFunc(), sDebug(), ScFace::ScFaceData::status, and tr().
Referenced by ScFace_ttf::EmbedFont(), ScFace_pfa::EmbedFont(), ScFace_pfb::EmbedFont(), and ScFace_ttf::RawData().
| 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] |
Reimplemented from ScFace::ScFaceData.
Reimplemented in ScFace_postscript.
Definition at line 72 of file ftface.cpp.
References Ascent, ScFace::BROKEN, ScFace::BROKENGLYPHS, CapHeight, Descender, ScFace::ScFaceData::faceIndex, FontBBox, ScFace::ScFaceData::fontFile, ScFace::ScFaceData::isFixedPitch, ScFace::ScFaceData::isStroked, ItalicAngle, library, m_ascent, m_capHeight, m_descent, m_encoding, m_face, m_height, m_maxAdvanceWidth, m_strikeoutPos, m_strokeWidth, m_underlinePos, m_uniEM, m_xHeight, ScFace::ScFaceData::maxGlyph, sDebug(), setBestEncoding(), ScFace::ScFaceData::status, and tr().
Referenced by ftFace(), and ScFace_postscript::load().
| 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] |
Reimplemented from ScFace::ScFaceData.
Definition at line 168 of file ftface.cpp.
References ScFace::GlyphData::bbox_ascent, ScFace::GlyphData::bbox_descent, ScFace::GlyphData::bbox_width, ScFace::GlyphData::broken, ScFace::BROKENGLYPHS, ScFace::ScFaceData::fontFile, ftFace(), height(), ScFace::ScFaceData::m_glyphOutline, ScFace::ScFaceData::m_glyphWidth, m_uniEM, ScFace::GlyphData::Outlines, sDebug(), ScFace::ScFaceData::status, tr(), traceGlyph(), ScFace::GlyphData::x, and ScFace::GlyphData::y.
Member Data Documentation
FT_Face FtFace::m_face [mutable, protected] |
FT_Library FtFace::library = NULL [static, protected] |
QString FtFace::Ascent [mutable, protected] |
QString FtFace::CapHeight [mutable, protected] |
QString FtFace::Descender [mutable, protected] |
QString FtFace::ItalicAngle [mutable, protected] |
QString FtFace::StdVW [mutable, protected] |
QString FtFace::FontEnc [protected] |
QString FtFace::FontBBox [mutable, protected] |
int FtFace::m_encoding [mutable, protected] |
double FtFace::m_uniEM [mutable, protected] |
double FtFace::m_ascent [mutable, protected] |
double FtFace::m_descent [mutable, protected] |
double FtFace::m_height [mutable, protected] |
double FtFace::m_xHeight [mutable, protected] |
double FtFace::m_capHeight [mutable, protected] |
double FtFace::m_maxAdvanceWidth [mutable, protected] |
double FtFace::m_underlinePos [mutable, protected] |
double FtFace::m_strikeoutPos [mutable, protected] |
double FtFace::m_strokeWidth [mutable, protected] |
The documentation for this struct was generated from the following files:
