Changeset d884672 in mainline for uspace/lib/gfxfont/src/font.c


Ignore:
Timestamp:
2020-09-30T20:26:24Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c9748a4
Parents:
38a4b6d
Message:

Need to set rectangle/origin for new glyph

Otherwise, having unsaved glyphs would lead to corruption once another
glyph is created, edited and saved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfxfont/src/font.c

    r38a4b6d rd884672  
    274274}
    275275
     276/** Get last glyph in font.
     277 *
     278 * @param font Font
     279 * @return Last glyph or @c NULL if there are none
     280 */
     281gfx_glyph_t *gfx_font_last_glyph(gfx_font_t *font)
     282{
     283        link_t *link;
     284
     285        link = list_last(&font->glyphs);
     286        if (link == NULL)
     287                return NULL;
     288
     289        return list_get_instance(link, gfx_glyph_t, lglyphs);
     290}
     291
     292/** Get previous glyph in font.
     293 *
     294 * @param cur Current glyph
     295 * @return Previous glyph in font or @c NULL if @a cur was the last one
     296 */
     297gfx_glyph_t *gfx_font_prev_glyph(gfx_glyph_t *cur)
     298{
     299        link_t *link;
     300
     301        link = list_prev(&cur->lglyphs, &cur->font->glyphs);
     302        if (link == NULL)
     303                return NULL;
     304
     305        return list_get_instance(link, gfx_glyph_t, lglyphs);
     306}
     307
    276308/** Search for glyph that should be set for the beginning of a string.
    277309 *
Note: See TracChangeset for help on using the changeset viewer.