Changeset 8fa65af0 in mainline for uspace/app/fontedit/fontedit.c
- Timestamp:
- 2020-10-06T08:59:57Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 74f59b7
- Parents:
- 25f2983b
- git-author:
- Jiri Svoboda <jiri@…> (2020-10-05 18:59:36)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-10-06 08:59:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fontedit/fontedit.c
r25f2983b r8fa65af0 41 41 #include <gfx/glyph.h> 42 42 #include <gfx/render.h> 43 #include <gfx/text.h> 43 44 #include <gfx/typeface.h> 44 45 #include <stdbool.h> … … 422 423 gfx_coord_t x, gfx_coord_t y, const char *str) 423 424 { 424 gfx_glyph_metrics_t gmetrics; 425 size_t stradv; 426 const char *cp; 425 gfx_text_fmt_t fmt; 427 426 gfx_coord2_t pos; 428 gfx_glyph_t *glyph; 429 errno_t rc;427 428 gfx_text_fmt_init(&fmt); 430 429 431 430 pos.x = x; 432 431 pos.y = y; 433 cp = str; 434 435 while (*cp != '\0') { 436 rc = gfx_font_search_glyph(fedit->font, cp, &glyph, &stradv); 437 if (rc != EOK) { 438 ++cp; 439 continue; 440 } 441 442 gfx_glyph_get_metrics(glyph, &gmetrics); 443 444 rc = gfx_glyph_render(glyph, &pos); 445 if (rc != EOK) 446 return rc; 447 448 cp += stradv; 449 pos.x += gmetrics.advance; 450 } 451 452 return EOK; 432 433 return gfx_puttext(fedit->font, &pos, &fmt, str); 453 434 } 454 435
Note:
See TracChangeset
for help on using the changeset viewer.