Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

scfontmetrics.cpp File Reference

#include <QColor>
#include <QMap>
#include <QMatrix>
#include <QPainter>
#include <QPixmap>
#include <QRegExp>
#include <QStringList>
#include "fpoint.h"
#include "fpointarray.h"
#include "page.h"
#include "scfontmetrics.h"
#include "scfonts.h"
#include "scpainter.h"
#include "scribusdoc.h"
#include "style.h"
#include "util_math.h"

Include dependency graph for scfontmetrics.cpp:

Go to the source code of this file.

Functions

static void readAdobeGlyphNames ()
 init the Adobe Glyph List
static QString adobeGlyphName (FT_ULong charcode)
 if in AGL, use that name, else use "uni1234" or "u12345"
static int traceMoveto (FT_Vector *to, FPointArray *composite)
static int traceLineto (FT_Vector *to, FPointArray *composite)
static int traceQuadraticBezier (FT_Vector *control, FT_Vector *to, FPointArray *composite)
static int traceCubicBezier (FT_Vector *p, FT_Vector *q, FT_Vector *to, FPointArray *composite)
int setBestEncoding (FT_Face face)
FPointArray traceGlyph (FT_Face face, FT_UInt glyphIndex, int chs, double *x, double *y, bool *err)
FPointArray traceChar (FT_Face face, uint chr, int chs, double *x, double *y, bool *err)
QPixmap FontSample (const ScFace &fnt, int s, QString ts, QColor back, bool force)
bool GlyNames (FT_Face face, QMap< uint, std::pair< QChar, QString > > &GList)

Variables

static FPoint firstP
static bool FirstM
static QMap< FT_ULong, QString > adobeGlyphNames
static const char * table []
FT_Outline_Funcs OutlineMethods
const double FTSCALE = 64.0


Function Documentation

QString adobeGlyphName ( FT_ULong  charcode  )  [static]

if in AGL, use that name, else use "uni1234" or "u12345"

Definition at line 439 of file scfontmetrics.cpp.

References adobeGlyphNames.

Referenced by GlyNames().

QPixmap FontSample ( const ScFace fnt,
int  s,
QString  ts,
QColor  back,
bool  force 
)

bool GlyNames ( FT_Face  face,
QMap< uint, std::pair< QChar, QString > > &  GList 
)

Same as FontSample() with
strings support added. 09/26/2004 petr vanek

QPixmap fontSamples(ScFace * fnt, int s, QString ts, QColor back) { QStringList lines = QStringList::split("\n", ts); QPixmap ret(640, 480); QPixmap sample; QPainter *painter = new QPainter(&ret); int y = 0; int x = 0; ret.fill(back); for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) { sample = FontSample(fnt, s, *it, back); if (!sample.isNull()) painter->drawPixmap(0, y, sample, 0, 0); y = y + sample.height(); if (x < sample.width()) x = sample.width(); } // for delete(painter); QPixmap final(x, y); if ((x != 0) && (y != 0)) { QPainter *fpainter = new QPainter(&final); fpainter->drawPixmap(0, 0, ret, 0, 0, x, y); delete(fpainter); } return final; }

Definition at line 339 of file scfontmetrics.cpp.

References adobeGlyphName(), adobeGlyphNames, readAdobeGlyphNames(), and setBestEncoding().

Referenced by FtFace::glyphNames().

void readAdobeGlyphNames (  )  [static]

init the Adobe Glyph List

Definition at line 424 of file scfontmetrics.cpp.

References adobeGlyphNames, and table.

Referenced by GlyNames().

int setBestEncoding ( FT_Face  face  ) 

Definition at line 58 of file scfontmetrics.cpp.

Referenced by FontSample(), GlyNames(), and FtFace::load().

FPointArray traceChar ( FT_Face  face,
uint  chr,
int  chs,
double *  x,
double *  y,
bool *  err 
)

Definition at line 196 of file scfontmetrics.cpp.

References traceGlyph().

Referenced by FontSample().

static int traceCubicBezier ( FT_Vector *  p,
FT_Vector *  q,
FT_Vector *  to,
FPointArray composite 
) [static]

FPointArray traceGlyph ( FT_Face  face,
FT_UInt  glyphIndex,
int  chs,
double *  x,
double *  y,
bool *  err 
)

static int traceLineto ( FT_Vector *  to,
FPointArray composite 
) [static]

static int traceMoveto ( FT_Vector *  to,
FPointArray composite 
) [static]

static int traceQuadraticBezier ( FT_Vector *  control,
FT_Vector *  to,
FPointArray composite 
) [static]


Variable Documentation

QMap<FT_ULong, QString> adobeGlyphNames [static]

Definition at line 31 of file scfontmetrics.cpp.

Referenced by adobeGlyphName(), GlyNames(), and readAdobeGlyphNames().

bool FirstM [static]

Definition at line 30 of file scfontmetrics.cpp.

Referenced by SVGState::needsMarker(), traceGlyph(), and traceMoveto().

FPoint firstP [static]

Definition at line 29 of file scfontmetrics.cpp.

Referenced by OODPlug::appendPoints().

const double FTSCALE = 64.0

Definition at line 55 of file scfontmetrics.cpp.

Referenced by traceCubicBezier(), traceLineto(), traceMoveto(), and traceQuadraticBezier().

FT_Outline_Funcs OutlineMethods

Initial value:

    {
        (FT_Outline_MoveTo_Func) traceMoveto,
        (FT_Outline_LineTo_Func) traceLineto,
        (FT_Outline_ConicTo_Func) traceQuadraticBezier,
        (FT_Outline_CubicTo_Func) traceCubicBezier,
        0,
        0
    }

Definition at line 44 of file scfontmetrics.cpp.

Referenced by traceGlyph().

const char* table[] [static]

Initial value:

 {

                    NULL}

Definition at line 32 of file scfontmetrics.cpp.

Referenced by readAdobeGlyphNames().

Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.