| 614 | }; |
| 615 | |
| 616 | GFont modFindPebbleFont(const char *family, int size, int32_t *ascent, int32_t *descent, int32_t *leading) |
| 617 | { |
| 618 | PebbleFont f = (PebbleFont)gFonts; |
| 619 | |
| 620 | for (; C_NULL != f->family; f++) { |
| 621 | if ((size == f->size) && !c_strcmp(family, f->family)) |
| 622 | break; |
| 623 | } |
| 624 | |
| 625 | GFont font = C_NULL; |
| 626 | if (f->family) { |
| 627 | font = fonts_get_system_font(f->res_key); |
| 628 | } |
| 629 | if (!font) { |
| 630 | // font = fonts_get_system_font(FONT_KEY_FONT_FALLBACK); |
| 631 | // if (!font) |
| 632 | return C_NULL; |
| 633 | } |
| 634 | |
| 635 | uint16_t height = fonts_get_font_height(font); |
| 636 | *descent = fonts_get_font_cap_offset(font); |
| 637 | *leading = 1; |
| 638 | *ascent = height - *descent - *leading; |
| 639 | return font; |
| 640 | } |
| 641 | |
| 642 | |
| 643 |
no outgoing calls
no test coverage detected