Example #1
0
void Fl_Device::rtl_draw(const char *str, int n, float x, float y) {
    if (font_gc != fl_gc) {
        font_gc = fl_gc;
        XSetFont(fl_display, fl_gc, ((XFontStruct*)fl_xfont())->fid);
    }
    ///
    ///
}
Example #2
0
void gl_font(Fl_Font font, float size)
{
    fl_font(font, size);         // necessary so fl_measure() works
    size = fl_size();            // get the rounded value
    if (!current || current->font != font || current->size != size)
    {
        FontSize** p = &root;
        while (*p)
        {
            if (font < (*p)->font) p = &((*p)->left);
            else if (font > (*p)->font) p = &((*p)->right);
            else if (size < (*p)->size) p = &((*p)->left);
            else if (size > (*p)->size) p = &((*p)->right);
            else {current = *p; goto GOTIT;}
        }
        *p = current = new FontSize;
        current->font = font;
        current->size = size;
        current->left = current->right = 0;
        current->listbase = glGenLists(256);
#ifdef _WIN32
        int base = fl_textmetric()->tmFirstChar;
        int size = fl_textmetric()->tmLastChar - base + 1;
        HDC hdc = GetDC(0);
        HFONT oldFid = (HFONT)SelectObject(hdc, fl_xfont());
        wglUseFontBitmaps(hdc, base, size, current->listbase+base);
        SelectObject(hdc, oldFid);
#else
        XFontStruct* xfont = fl_xfont();
#if USE_XFT
        current->xfont = xfont;
#endif
        int base = xfont->min_char_or_byte2;
        int size = xfont->max_char_or_byte2-base+1;
        glXUseXFont(xfont->fid, base, size, current->listbase+base);
#endif
    }
GOTIT:
    glListBase(current->listbase);
}