Back to index

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

#include <scface_ps.h>

Inheritance diagram for ScFace_pfa:
Inheritance graph
[legend]
Collaboration diagram for ScFace_pfa:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ScFace_pfa (QString fam, QString sty, QString alt, QString scname, QString psname, QString path, int face)
virtual bool EmbedFont (QString &str) const
virtual void load () const

Detailed Description

Definition at line 220 of file scface_ps.h.


Constructor & Destructor Documentation

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

Definition at line 223 of file scface_ps.h.

                                                                                                                        :
              ScFace_postscript(fam,sty,alt,scname,psname,path,face)
              {
                     formatCode = ScFace::PFA;
              }

Member Function Documentation

virtual bool ScFace_pfa::EmbedFont ( QString &  str) const [inline, virtual]

Definition at line 228 of file scface_ps.h.

              {
                     QByteArray bb;
                     RawData(bb);
                     if (bb.size() > 2 && bb[0] == '%' && bb[1] == '!') 
                     {
                            // this is ok since bb will not contain '\0'
                            str.append(bb);
                            return true; 
                     }
                     qDebug(QObject::tr("Font %1 cannot be read, no embedding").arg(fontFile));
                     return false;
              }

Here is the call graph for this function:

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

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: