Logo Search packages:      
Sourcecode: fbdesk version File versions  Download package

void FbTk::Font::drawText ( Drawable  w,
int  screen,
GC  gc,
const char *  text,
size_t  len,
int  x,
int  y,
bool  rotate = true 
) const

Draws text to drawable

w the drawable
screen screen number
gc Graphic Context
text the text buffer
len size of text buffer
x position
y position
rotate if the text should be drawn rotated (if it's rotated before)

Definition at line 160 of file Font.cc.

References isRotated(), and m_fontimp.

    if (text == 0 || len == 0)
    if (!rotate && isRotated()) {
        // if this was called with request to not rotated the text
        // we just forward it to the implementation that handles rotation
        // currently just XFontImp
        // Using dynamic_cast just temporarly until there's a better solution 
        // to put in FontImp
        try {
            XFontImp *font = dynamic_cast<XFontImp *>(m_fontimp.get());
            font->setRotate(false); // disable rotation temporarly
            font->drawText(w, screen, gc, text, len, x, y);
            font->setRotate(true); // enable rotation
        } catch (std::bad_cast &bc) {
            // draw normal...
            m_fontimp->drawText(w, screen, gc, text, len, x, y);

    } else
        m_fontimp->drawText(w, screen, gc, text, len, x, y);            

Generated by  Doxygen 1.6.0   Back to index