Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions
ScFace_postscript Class Reference

#include <scface_ps.h>

Inheritance diagram for ScFace_postscript:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ScFace_postscript (QString fam, QString sty, QString alt, QString scname, QString psname, QString path, int face)
virtual void load () const

Detailed Description

Definition at line 33 of file scface_ps.h.


Constructor & Destructor Documentation

ScFace_postscript::ScFace_postscript ( QString  fam,
QString  sty,
QString  alt,
QString  scname,
QString  psname,
QString  path,
int  face 
) [inline]

Definition at line 36 of file scface_ps.h.

                                                                                                                               :
              FtFace(fam,sty,alt,scname,psname,path,face)
              {
                     isFixedPitch = false;
                     typeCode = ScFace::TYPE1;
              }

Member Function Documentation

virtual void ScFace_postscript::load ( ) const [inline, virtual]

Definition at line 43 of file scface_ps.h.

              {
                     FtFace::load();
//                   bool error;
                     FT_Face face = ftFace();
                     if (!face)
                     {
                            const_cast<ScFace_postscript*>(this)->usable = false;
                            qDebug(QObject::tr("Font %1 is broken (no Face), discarding it").arg(fontFile));
                            return;
                     }
                     QString afnm = fontFile.left(fontFile.length()-3);
                     QFile afm(afnm+"afm");
                     if(!(afm.exists()))
                     {
                            afm.setName(afnm+"Afm");
                     }
                     if(!(afm.exists()))
                     {
                            afm.setName(afnm+"AFM");
                     }
                     if(!(afm.exists()))
                     {
                            afm.setName(afnm+"pfm");
                     }
                     if(!(afm.exists()))
                     {
                            afm.setName(afnm+"Pfm");
                     }
                     if(!(afm.exists())) {
                            afm.setName(afnm+"PFM");
                     }
                     if (afm.exists())
                     {
                            if(FT_Attach_File(face, afm.name()))
                                   qDebug(QObject::tr("Font %1 has broken metrics in file %2, ignoring metrics").arg(fontFile).arg(afm.name()));
                            else
                                   // re-initialize: ScFaceData::load() just clears caches,
                                   // FtFace::load() skips FT_New_Face if m_face is already defined.
                                   // dont mind checking glyphs again for now (PS files have only 255 glyphs max, anyway)
                                   FtFace::load();
                     }
//                   Ascent = tmp.setNum(face->ascender);
//                   Descender = tmp.setNum(face->descender);
//                   CapHeight = Ascent;
//                   ItalicAngle = "0";
//                   StdVW = "1";
//                   FontBBox = tmp.setNum(face->bbox.xMin)+" "+tmp2.setNum(face->bbox.yMin)+" "+tmp3.setNum(face->bbox.xMax)+" "+tmp4.setNum(face->bbox.yMax);
/*
 setBestEncoding(face);
                     gindex = 0;
                     charcode = FT_Get_First_Char( face, &gindex );
                     int goodGlyph = 0;
                     int invalidGlyph = 0;
                     while ( gindex != 0 )
                     {
                            error = FT_Load_Glyph( face, gindex, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
                            if (error)
                            {
                                   ++invalidGlyph;
                                   sDebug(QObject::tr("Font %1 has broken glyph %2 (charcode %3)").arg(fontPath()).arg(gindex).arg(charcode));
                                   charcode = FT_Get_Next_Char( face, charcode, &gindex );
                                   continue;
                            }
                            ++goodGlyph;
                            double ww = face->glyph->metrics.horiAdvance / uniEM;
                            if (face->glyph->format == FT_GLYPH_FORMAT_PLOTTER)
                                   isStroked = true;
                            error = false;
                            outlines = traceChar(face, charcode, 10, &x, &y, &error);
                            if (!error)
                            {
                                   CharWidth.insert(charcode, ww);
                                   GRec.Outlines = outlines.copy();
                                   GRec.x = x;
                                   GRec.y = y;
                                   GlyphArray.insert(charcode, GRec);
                            }
                            charcode = FT_Get_Next_Char( face, charcode, &gindex );
                     }
 */
              }

Here is the call graph for this function:


The documentation for this class was generated from the following file: