Changeset 06b8383 in mainline for uspace/app/fontedit/fontedit.c


Ignore:
Timestamp:
2020-08-18T11:32:59Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
20d0098
Parents:
d2100e2
git-author:
Jiri Svoboda <jiri@…> (2020-08-17 18:32:40)
git-committer:
Jiri Svoboda <jiri@…> (2020-08-18 11:32:59)
Message:

Introduce typeface

In other words a font family.

File:
1 edited

Legend:

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

    rd2100e2 r06b8383  
    3838#include <guigfx/canvas.h>
    3939#include <gfx/color.h>
     40#include <gfx/font.h>
    4041#include <gfx/render.h>
     42#include <gfx/typeface.h>
    4143#include <stdbool.h>
    4244#include <stdio.h>
     
    117119        canvas_t *canvas = NULL;
    118120        font_edit_t *fedit = NULL;
     121        gfx_typeface_t *tface = NULL;
    119122        gfx_font_t *font = NULL;
     123        gfx_font_props_t props;
    120124        gfx_font_metrics_t metrics;
    121125        gfx_coord_t vw, vh;
     
    178182
    179183        gc = canvas_gc_get_ctx(cgc);
     184
     185        rc = gfx_typeface_create(gc, &tface);
     186        if (rc != EOK) {
     187                printf("Error creating typeface.\n");
     188                goto error;
     189        }
     190
     191        gfx_font_props_init(&props);
    180192        gfx_font_metrics_init(&metrics);
    181193
    182         rc = gfx_font_create(gc, &metrics, &font);
     194        rc = gfx_font_create(tface, &props, &metrics, &font);
    183195        if (rc != EOK) {
    184196                printf("Error creating font.\n");
     
    190202        fedit->width = vw;
    191203        fedit->height = vh;
    192         fedit->font = font;
     204        fedit->typeface = tface;
    193205
    194206        *rfedit = fedit;
Note: See TracChangeset for help on using the changeset viewer.