Changeset 67ebf21 in mainline for uspace/srv/fb/fb.c


Ignore:
Timestamp:
2009-04-04T16:26:18Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4527fb5
Parents:
7d440e3
Message:

Use Unicode font in userspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fb/fb.c

    r7d440e3 r67ebf21  
    389389        unsigned int row, col;
    390390        unsigned int x, y;
    391         uint8_t glyph;
     391        uint32_t glyph;
    392392        uint32_t fg_color;
    393393        uint32_t bg_color;
     
    466466                        for (x = 0; x < FONT_WIDTH; x++) {
    467467                                screen.rgb_conv(&vport->glyphs[GLYPH_POS(glyph, y, false) + x * screen.pixelbytes],
    468                                     (fb_font[glyph * FONT_SCANLINES + y] & (1 << (7 - x)))
     468                                    (fb_font[glyph][y] & (1 << (7 - x)))
    469469                                    ? 0xffffff : 0x000000);
    470470                               
    471471                                screen.rgb_conv(&vport->glyphs[GLYPH_POS(glyph, y, true) + x * screen.pixelbytes],
    472                                     (fb_font[glyph * FONT_SCANLINES + y] & (1 << (7 - x)))
     472                                    (fb_font[glyph][y] & (1 << (7 - x)))
    473473                                    ? 0x000000 : 0xffffff);
    474474                        }
     
    670670        unsigned int ww, d_add;
    671671
    672         /* Check glyph range. */
    673         if (glyph >= FONT_GLYPHS)
    674                 glyph = GLYPH_UNAVAIL;
    675 
    676672        /*
    677673         * Prepare a pair of words, one filled with foreground-color
     
    734730        uint8_t b;
    735731
    736         /* Check glyph range. */
    737         if (glyph >= FONT_GLYPHS)
    738                 glyph = GLYPH_UNAVAIL;
    739 
    740732        /* Pre-render 1x the foreground and background color pixels. */
    741733        if (cursor) {
     
    755747        for (yd = 0; yd < FONT_SCANLINES; yd++) {
    756748                /* Byte containing bits of the glyph scanline. */
    757                 b = fb_font[glyph * FONT_SCANLINES + yd];
     749                b = fb_font[glyph][yd];
    758750
    759751                for (i = 0; i < FONT_WIDTH; i++) {
     
    856848
    857849        bbp = &vport->backbuf[BB_POS(vport, col, row)];
    858         bbp->glyph = (uint32_t) c;
     850        bbp->glyph = fb_font_glyph(c);
    859851        bbp->fg_color = vport->attr.fg_color;
    860852        bbp->bg_color = vport->attr.bg_color;
     
    899891
    900892                        bbp = &vport->backbuf[BB_POS(vport, col, row)];
    901                         uint32_t glyph = bbp->glyph;
    902893
    903894                        a = &data[j * w + i].attrs;
    904895                        rgb_from_attr(&rgb, a);
    905896
    906                         bbp->glyph = data[j * w + i].character;
     897                        bbp->glyph = fb_font_glyph(data[j * w + i].character);
    907898                        bbp->fg_color = rgb.fg_color;
    908899                        bbp->bg_color = rgb.bg_color;
     
    15201511                unsigned int i;
    15211512                int scroll;
    1522                 uint32_t glyph;
     1513                wchar_t ch;
    15231514                unsigned int row, col;
    15241515               
     
    15571548               
    15581549                case FB_PUTCHAR:
    1559                         glyph = IPC_GET_ARG1(call);
     1550                        ch = IPC_GET_ARG1(call);
    15601551                        row = IPC_GET_ARG2(call);
    15611552                        col = IPC_GET_ARG3(call);
     
    15671558                        ipc_answer_0(callid, EOK);
    15681559                       
    1569                         draw_char(vport, glyph, col, row);
     1560                        draw_char(vport, ch, col, row);
    15701561                       
    15711562                        /* Message already answered */
Note: See TracChangeset for help on using the changeset viewer.