Changeset b433f68 in mainline for uspace/app/fontedit/fontedit.c


Ignore:
Timestamp:
2021-02-26T16:23:36Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77ffa01
Parents:
fe40b67
Message:

Puttext needs to know the color of the text being printed

So far we were using the GC's current drawing color. But unless there
was a way to read it, we could not render text-mode text in the correct
color.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/fontedit/fontedit.c

    rfe40b67 rb433f68  
    446446 * @param fedit Font editor
    447447 * @param x Starting X coordinate
    448  * @Param y Starting Y coordinate
     448 * @param y Starting Y coordinate
     449 * @param color Color
    449450 * @param str String
    450451 */
    451452static errno_t font_edit_paint_preview_str(font_edit_t *fedit,
    452     gfx_coord_t x, gfx_coord_t y, const char *str)
     453    gfx_coord_t x, gfx_coord_t y, gfx_color_t *color, const char *str)
    453454{
    454455        gfx_text_fmt_t fmt;
     
    456457
    457458        gfx_text_fmt_init(&fmt);
     459        fmt.color = color;
    458460
    459461        pos.x = x;
     
    480482                goto error;
    481483
    482         rc = font_edit_paint_preview_str(fedit, 20, 20,
     484        rc = font_edit_paint_preview_str(fedit, 20, 20, color,
    483485            "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    484486        if (rc != EOK)
    485487                goto error;
    486488
    487         rc = font_edit_paint_preview_str(fedit, 20, 40,
     489        rc = font_edit_paint_preview_str(fedit, 20, 40, color,
    488490            "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG");
    489491        if (rc != EOK)
    490492                goto error;
    491493
    492         rc = font_edit_paint_preview_str(fedit, 20, 60,
     494        rc = font_edit_paint_preview_str(fedit, 20, 60, color,
    493495            "abcdefghijklmnopqrstuvwxyz");
    494496        if (rc != EOK)
    495497                goto error;
    496498
    497         rc = font_edit_paint_preview_str(fedit, 20, 80,
     499        rc = font_edit_paint_preview_str(fedit, 20, 80, color,
    498500            "the quick brown fox jumps over the lazy dog");
    499501        if (rc != EOK)
    500502                goto error;
    501503
    502         rc = font_edit_paint_preview_str(fedit, 20, 100,
     504        rc = font_edit_paint_preview_str(fedit, 20, 100, color,
    503505            "0123456789,./<>?;'\\:\"|[]{}`~!@#$%^&*()-_=+");
    504506        if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.