Changeset 06b8383 in mainline for uspace/lib/gfxfont/include


Ignore:
Timestamp:
2020-08-18T11:32:59Z (5 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.

Location:
uspace/lib/gfxfont/include
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfxfont/include/gfx/font.h

    rd2100e2 r06b8383  
    4242#include <types/gfx/font.h>
    4343#include <types/gfx/glyph.h>
     44#include <types/gfx/typeface.h>
    4445
    4546extern void gfx_font_metrics_init(gfx_font_metrics_t *);
    46 extern errno_t gfx_font_create(gfx_context_t *, gfx_font_metrics_t *,
    47     gfx_font_t **);
    48 extern void gfx_font_destroy(gfx_font_t *);
     47extern void gfx_font_props_init(gfx_font_props_t *);
     48extern void gfx_font_get_props(gfx_font_info_t *, gfx_font_props_t *);
     49extern errno_t gfx_font_create(gfx_typeface_t *, gfx_font_props_t *,
     50    gfx_font_metrics_t *, gfx_font_t **);
     51extern errno_t gfx_font_open(gfx_font_info_t *, gfx_font_t **);
     52extern void gfx_font_close(gfx_font_t *);
    4953extern void gfx_font_get_metrics(gfx_font_t *, gfx_font_metrics_t *);
    50 extern errno_t gfx_font_set_metrics(gfx_font_t *, gfx_font_metrics_t *);
     54extern errno_t gfx_font_set_metrics(gfx_font_t *,
     55    gfx_font_metrics_t *);
    5156extern gfx_glyph_t *gfx_font_first_glyph(gfx_font_t *);
    5257extern gfx_glyph_t *gfx_font_next_glyph(gfx_glyph_t *);
  • uspace/lib/gfxfont/include/types/gfx/font.h

    rd2100e2 r06b8383  
    4242typedef struct gfx_font gfx_font_t;
    4343
    44 /** Font metrics */
     44struct gfx_font_info;
     45typedef struct gfx_font_info gfx_font_info_t;
     46
     47/** Font flags */
     48typedef enum {
     49        /** Bold */
     50        gff_bold = 0x1,
     51        /** Italic */
     52        gff_italic = 0x2,
     53        /** Bold, italic */
     54        gff_bold_italic = gff_bold | gff_italic
     55} gfx_font_flags_t;
     56
     57/** Font properties */
    4558typedef struct {
    46         /** Ascent */
    47         gfx_coord_t ascent;
    48         /** Descent */
    49         gfx_coord_t descent;
    50         /** Leading */
    51         gfx_coord_t leading;
    52 } gfx_font_metrics_t;
    53 
    54 /** Text metrics */
    55 typedef struct {
    56         /** Bounding rectangle (not including oversize elements) */
    57         gfx_rect_t bounds;
    58 } gfx_text_metrics_t;
     59        /** Size */
     60        gfx_coord_t size;
     61        /** Flags */
     62        gfx_font_flags_t flags;
     63} gfx_font_props_t;
    5964
    6065#endif
Note: See TracChangeset for help on using the changeset viewer.