Changeset a57c70c in mainline for uspace/lib


Ignore:
Timestamp:
2020-09-11T13:38:00Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
414020d9
Parents:
e2776ff
git-author:
Jiri Svoboda <jiri@…> (2020-09-10 17:37:41)
git-committer:
Jiri Svoboda <jiri@…> (2020-09-11 13:38:00)
Message:

Save glyph with S key and get a preview

Location:
uspace/lib/gfxfont
Files:
4 edited

Legend:

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

    re2776ff ra57c70c  
    5656extern gfx_glyph_t *gfx_font_first_glyph(gfx_font_t *);
    5757extern gfx_glyph_t *gfx_font_next_glyph(gfx_glyph_t *);
    58 extern int gfx_font_search_glyph(gfx_font_t *, const char *, gfx_glyph_t **,
     58extern errno_t gfx_font_search_glyph(gfx_font_t *, const char *, gfx_glyph_t **,
    5959    size_t *);
    6060
  • uspace/lib/gfxfont/include/gfx/glyph.h

    re2776ff ra57c70c  
    5555extern gfx_glyph_pattern_t *gfx_glyph_next_pattern(gfx_glyph_pattern_t *);
    5656extern const char *gfx_glyph_pattern_str(gfx_glyph_pattern_t *);
     57extern errno_t gfx_glyph_render(gfx_glyph_t *, gfx_coord2_t *);
    5758
    5859#endif
  • uspace/lib/gfxfont/src/font.c

    re2776ff ra57c70c  
    248248 * @return EOK on success, ENOENT if no matching glyph was found
    249249 */
    250 int gfx_font_search_glyph(gfx_font_t *font, const char *str,
     250errno_t gfx_font_search_glyph(gfx_font_t *font, const char *str,
    251251    gfx_glyph_t **rglyph, size_t *rsize)
    252252{
  • uspace/lib/gfxfont/src/glyph.c

    re2776ff ra57c70c  
    254254}
    255255
     256/** Render glyph to GC.
     257 *
     258 * @param glyph Glyph
     259 * @param pos Position to render to (where glyph origin is placed)
     260 */
     261errno_t gfx_glyph_render(gfx_glyph_t *glyph, gfx_coord2_t *pos)
     262{
     263        gfx_coord2_t offs;
     264
     265        gfx_coord2_subtract(pos, &glyph->origin, &offs);
     266
     267        return gfx_bitmap_render(glyph->font->bitmap, &glyph->rect, &offs);
     268}
     269
    256270/** Transfer glyph to new font bitmap.
    257271 *
Note: See TracChangeset for help on using the changeset viewer.