Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

Printer Class Reference
[Painter and Devices]

#include <Printer.h>

Inheritance diagram for Printer:

Painter List of all members.

Public Member Functions

 Printer (int nbpages)
void print ()
void setBrush (Qt::BrushStyle)
void setFontFamily (int)
void setFont (QFont)
void setFontSize (double f)
void setTextAlign (int)
void setFTFont (int)
void setFTSize (int)
void drawFTSymbol (int, float, float)
void drawFTSymbolEnc (long unsigned int, float, float, int enc)
void drawNoteLine (float, float, int)
void drawLine (double, double, double, double)
void drawRect (double, double, double, double)
void drawEllipse (float, float, float, float)
void setBrush (const QColor &)
void begin ()
void end ()
bool isPrinter ()
QCoordsRect getBoundingBox (int nglyph)
void setPenColor (const QColor &)
void setPen (const QColor &)
void setPen (Qt::PenStyle)
void drawStemBar (double, double, double, double)
void drawSlur (double, double, double, double, int)
void drawBrace (double, double, double)
void drawText (double, double, QString)
float width ()
void newPage ()
void addFont (QString filename)
void addResource (QString filename)
void drawFontGlyph (float bx, float by, int glyph, QString font)
float height ()
void send (char *destname)

Detailed Description

This is the painter for a printer. Be very carefull with the use of the begin and end method. You can only call begin() and end() this is different from screen painter for example. And after you should send the print to the spooler. This class generate big files and some instruction given era not necessary, there could be a little optimisation if only the necessary instruction were given for exemple it is not necessary to call find font when the font does not change


Constructor & Destructor Documentation

Printer::Printer int  pages  ) 
 

This is the default constructor of a printer


Member Function Documentation

void Printer::addFont QString  filename  ) 
 

Cette méthode ajoute la fonte elle est a appeler juste après l'entête. L'ajout se fait immédiatement après l'écriture de l'entête

void Printer::addResource QString  filename  ) 
 

This method add encoding resource. I did not understtand really what it does, I just did a copyPaste

void Printer::begin  )  [virtual]
 

This method writes the header of the file ps genrated by the ps file

Parameters:
pages The number of pages to be printed (So it has to be computed before the printing

Implements Painter.

void Printer::drawBrace double  x,
double  y1,
double  y2
[virtual]
 

This draws a brace on the printer

Parameters:
x 
y1 
y2 

Implements Painter.

void Printer::drawEllipse float  ,
float  ,
float  ,
float 
[virtual]
 

The draw ellipse is not yet implemented on the printer

Implements Painter.

void Printer::drawFontGlyph float  bx,
float  by,
int  glyph,
QString  font
 

Warning : Postscript uses an octal representation of characters

void Printer::drawFTSymbol int  glyph,
float  bx,
float  by
[virtual]
 

Draws a freetype symbol

Implements Painter.

void Printer::drawLine double  ,
double  ,
double  ,
double 
[virtual]
 

draws the line {(x1,y1),(x2,y2)}

Implements Painter.

void Printer::drawNoteLine float  ,
float  ,
int 
[virtual]
 

Deprecated:
use draw line instead

Implements Painter.

void Printer::drawRect double  ,
double  ,
double  ,
double 
[virtual]
 

draws a rect {(x1,y1),(x2,y2)}

Implements Painter.

void Printer::drawSlur double  ,
double  ,
double  ,
double  ,
int 
[virtual]
 

draws the brace tying {(x1,y1),(x2,y2)} of direction d

Implements Painter.

void Printer::drawStemBar double  ,
double  ,
double  ,
double 
[virtual]
 

draws the stem bar {(x1,y1),(x2,y2)}

Implements Painter.

void Printer::drawText double  bx,
double  by,
QString  text
[virtual]
 

This draws some text. Warning : There is still some concern with the encoding, for instance :

  • ’ cannot be drawn, you should use ' instead. Idont understand why the scale is not corresponding to the real fontSize. So I divide by 2, but it should be fixed in the long run.

Implements Painter.

void Printer::end  )  [virtual]
 

End the printing, various settings like the page size remains to be implemented. This is only at this stage that the printing is done

Implements Painter.

QCoordsRect Printer::getBoundingBox int  nglyph  )  [virtual]
 

Not implemented

Implements Painter.

bool Printer::isPrinter  )  [virtual]
 

Returns:
true (Of course !)

Reimplemented from Painter.

void Printer::newPage  )  [virtual]
 

Draws a new page

Reimplemented from Painter.

void Printer::print  ) 
 

Cette méthode imprime dans le fichier

void Printer::setBrush const QColor &  col  )  [virtual]
 

The color is not yet implemented on the printer

Implements Painter.

void Printer::setBrush Qt::BrushStyle   )  [virtual]
 

set PenColor has the same role that setPen we should remove it

Implements Painter.

void Printer::setFont QFont   )  [virtual]
 

This set the font

Implements Painter.

void Printer::setFontFamily int   )  [virtual]
 

Function relative to text

Implements Painter.

void Printer::setFontSize double  f  )  [virtual]
 

Donne sa taille à la fonte couramment utilisée

Implements Painter.

void Printer::setFTFont int   )  [virtual]
 

Function related to the musicaldont

Implements Painter.

void Printer::setFTSize int   )  [virtual]
 

Methods related to the Freetype Font

Implements Painter.

void Printer::setPen Qt::PenStyle   )  [virtual]
 

The setPen is not yet implemented on the printer

Implements Painter.

void Printer::setPen const QColor &   )  [virtual]
 

sets the pen color

Implements Painter.

void Printer::setPenColor const QColor &   )  [virtual]
 

Deprecated:
set PenColor has the same role that setPen we should remove it

Implements Painter.

void Printer::setTextAlign int  i  )  [virtual]
 

Set the text alignement. This is maybe unecessary to duplicate this function in all the chlidren of Painter.

Implements Painter.


The documentation for this class was generated from the following files:
Generated on Tue Jun 1 21:13:35 2004 for Alternate Take by doxygen 1.3.6