Subversion Repositories Kolibri OS

Rev

Rev 5021 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5021 Rev 5372
Line 21... Line 21...
21
typedef unsigned int color_t;
21
typedef unsigned int color_t;
Line 22... Line 22...
22
 
22
 
Line 23... Line 23...
23
unsigned int ansi2utf32(unsigned char ch);
23
unsigned int ansi2utf32(unsigned char ch);
24
 
24
 
25
void my_draw_bitmap(bitmap_t *win, FT_Bitmap *bitmap, int dstx, int dsty, int col)
25
static void my_draw_bitmap(uint8_t *pixmap, uint32_t pitch, FT_Bitmap *bitmap, int dstx, int dsty, int col)
26
{
26
{
Line 27... Line 27...
27
    uint8_t *dst;
27
    uint8_t *dst;
28
    uint8_t *src, *tmpsrc;
28
    uint8_t *src, *tmpsrc;
Line 29... Line 29...
29
 
29
 
30
    uint32_t  *tmpdst;
30
    uint32_t  *tmpdst;
Line 31... Line 31...
31
    int i, j;
31
    int i, j;
32
 
32
 
33
    dst = win->data + dsty * win->pitch + dstx*4;
33
    dst = pixmap + dsty * pitch + dstx*4;
34
    src = bitmap->buffer;
34
    src = bitmap->buffer;
Line 35... Line 35...
35
 
35
 
36
    for( i = 0; i < bitmap->rows; i++ )
36
    for( i = 0; i < bitmap->rows; i++ )
Line 37... Line 37...
37
    {
37
    {
38
        tmpdst = (uint32_t*)dst;
38
        tmpdst = (uint32_t*)dst;
39
        tmpsrc = src;
39
        tmpsrc = src;
Line 66... Line 66...
66
    }
66
    }
67
};
67
};
68
 
68
 
Line 69... Line 69...
69
 
69
 
70
int draw_text_ext(bitmap_t *winbitmap, FT_Face face, char *text, rect_t *rc, int color)
70
int draw_text_ext(void *pixmap, uint32_t pitch, FT_Face face, char *text, rect_t *rc, int color)
71
{
71
{
72
    FT_UInt glyph_index;
72
    FT_UInt glyph_index;
73
    FT_Bool use_kerning = 0;
73
    FT_Bool use_kerning = 0;
74
    FT_UInt previous;
74
    FT_UInt previous;
Line 105... Line 105...
105
        err = FT_Render_Glyph( face->glyph, FT_RENDER_MODE_NORMAL );
105
        err = FT_Render_Glyph( face->glyph, FT_RENDER_MODE_NORMAL );
106
        if ( err )
106
        if ( err )
107
            continue;
107
            continue;
Line 108... Line 108...
108
 
108
 
109
        my_draw_bitmap(winbitmap, &face->glyph->bitmap, (x >> 6) + face->glyph->bitmap_left,
109
        my_draw_bitmap(pixmap, pitch, &face->glyph->bitmap, (x >> 6) + face->glyph->bitmap_left,
Line 110... Line 110...
110
                        y - face->glyph->bitmap_top, color);
110
                       y - face->glyph->bitmap_top, color);
111
 
111
 
112
        x += face->glyph->advance.x;
112
        x += face->glyph->advance.x;