Changeset 2cc1ec0 in mainline for uspace/lib/gui/window.c


Ignore:
Timestamp:
2014-08-27T21:23:01Z (11 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9763c6
Parents:
613d644
Message:

Refactor drawing of fonts into multiple layers.

This will need further work to split glyph resolution
process to separate functions in order to support ligatures,
addition of kerning support, separate text layout functions,
etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gui/window.c

    r613d644 r2cc1ec0  
    5555#include <drawctx.h>
    5656#include <surface.h>
     57#include <font/embedded.h>
    5758
    5859#include "common.h"
     
    160161        /* Window caption */
    161162       
    162         font_t font;
    163         font_init(&font, FONT_DECODER_EMBEDDED, NULL, 16);
    164        
    165         drawctx_set_font(&drawctx, &font);
     163        font_t *font;
     164        int rc = embedded_font_create(&font, 16);
     165        if (rc != EOK) {
     166                window_yield(widget->window);
     167                return;
     168        }
     169       
     170        drawctx_set_font(&drawctx, font);
    166171        source_set_color(&source, widget->window->is_focused ?
    167172            color_caption_focus : color_caption_unfocus);
     
    169174        sysarg_t cpt_width;
    170175        sysarg_t cpt_height;
    171         font_get_box(&font, widget->window->caption, &cpt_width, &cpt_height);
     176        font_get_box(font, widget->window->caption, &cpt_width, &cpt_height);
    172177       
    173178        bool draw_title =
     
    183188        }
    184189       
    185         font_release(&font);
     190        font_release(font);
    186191        window_yield(widget->window);
    187192}
Note: See TracChangeset for help on using the changeset viewer.