Mercurial > public > ostc4
comparison BootLoader/Src/gfx_engine_mini.c @ 987:45a2bd04b156 BootloaderOstc5
Removed Font144 references because Font cause a linker problem and is not used by Bootloader
author | Ideenmodellierer |
---|---|
date | Sun, 30 Mar 2025 21:39:52 +0200 (3 weeks ago) |
parents | aeafa631147d |
children |
comparison
equal
deleted
inserted
replaced
986:5e7ad81e9ac2 | 987:45a2bd04b156 |
---|---|
1522 } | 1522 } |
1523 } | 1523 } |
1524 if(found) | 1524 if(found) |
1525 { | 1525 { |
1526 distance += (uint16_t)(Font->chars[i].image->width); | 1526 distance += (uint16_t)(Font->chars[i].image->width); |
1527 if(Font == &FontT144) | |
1528 distance += 3; | |
1529 else | |
1530 if(Font == &FontT105) | 1527 if(Font == &FontT105) |
1531 distance += 2; | 1528 distance += 2; |
1532 } | 1529 } |
1533 } | 1530 } |
1534 return distance; | 1531 return distance; |
1661 if((*pText) == TXT_MINIMAL) // for customtext and anything with Sonderzeichen | 1658 if((*pText) == TXT_MINIMAL) // for customtext and anything with Sonderzeichen |
1662 minimal = 1; | 1659 minimal = 1; |
1663 else | 1660 else |
1664 minimal = 0; | 1661 minimal = 0; |
1665 | 1662 |
1666 if(Font == &FontT144) | |
1667 { | |
1668 settings.TinyFont = (uint32_t)&FontT84; | |
1669 settings.Ydelta = 12; | |
1670 } | |
1671 else | |
1672 if(Font == &FontT105) | 1663 if(Font == &FontT105) |
1673 settings.TinyFont = (uint32_t)&FontT54; | 1664 settings.TinyFont = (uint32_t)&FontT54; |
1674 else | 1665 else |
1675 if(Font == &FontT54) | 1666 if(Font == &FontT54) |
1676 { | 1667 { |
1792 else | 1783 else |
1793 if((settings.spaceMode == 1) && (*pText == ' ')) | 1784 if((settings.spaceMode == 1) && (*pText == ' ')) |
1794 settings.Xdelta += ((tFont *)settings.font)->spacesize2Monospaced; | 1785 settings.Xdelta += ((tFont *)settings.font)->spacesize2Monospaced; |
1795 else | 1786 else |
1796 { | 1787 { |
1797 if(((tFont *)settings.font == &FontT144) && ((*pText == '.') || (*pText == ':'))) | |
1798 settings.actualFont = (tFont *)settings.TinyFont; | |
1799 else | |
1800 if(((tFont *)settings.font == &FontT105) && settings.dualFont && ((*pText == '.') || (*pText == ':'))) | 1788 if(((tFont *)settings.font == &FontT105) && settings.dualFont && ((*pText == '.') || (*pText == ':'))) |
1801 settings.actualFont = (tFont *)settings.TinyFont; | 1789 settings.actualFont = (tFont *)settings.TinyFont; |
1802 | 1790 |
1803 if(settings.actualFont == (tFont *)settings.TinyFont) | 1791 if(settings.actualFont == (tFont *)settings.TinyFont) |
1804 settings.Ydelta += settings.TinyFontExtraYdelta; | 1792 settings.Ydelta += settings.TinyFontExtraYdelta; |
2241 } | 2229 } |
2242 } | 2230 } |
2243 | 2231 |
2244 // ----------------------------- | 2232 // ----------------------------- |
2245 | 2233 |
2246 if(Font == &FontT144) | |
2247 width += 6; | |
2248 else | |
2249 if(Font == &FontT105) | 2234 if(Font == &FontT105) |
2250 width += 4; | 2235 width += 4; |
2251 | 2236 |
2252 // ----------------------------- | 2237 // ----------------------------- |
2253 | 2238 |
2535 } | 2520 } |
2536 } | 2521 } |
2537 } | 2522 } |
2538 | 2523 |
2539 // ----------------------------- | 2524 // ----------------------------- |
2540 | |
2541 if(Font == &FontT144) | |
2542 width += 3; | |
2543 else | |
2544 if(Font == &FontT105) | 2525 if(Font == &FontT105) |
2545 width += 2; | 2526 width += 2; |
2546 /* | 2527 /* |
2547 else | 2528 else |
2548 if(Font == &Font144) | 2529 if(Font == &Font144) |
2633 Xsum += GFX_Character_Width(decodeUTF8, ptargetFont); | 2614 Xsum += GFX_Character_Width(decodeUTF8, ptargetFont); |
2634 } | 2615 } |
2635 | 2616 |
2636 pText++; | 2617 pText++; |
2637 j++; | 2618 j++; |
2638 if((ptargetFont == &FontT144) && (*(char*)pText != 0)) | |
2639 Xsum += 3; | |
2640 else | |
2641 if((ptargetFont == &FontT105) && (*(char*)pText != 0)) | 2619 if((ptargetFont == &FontT105) && (*(char*)pText != 0)) |
2642 Xsum += 2; | 2620 Xsum += 2; |
2643 } | 2621 } |
2644 pText -= j; | 2622 pText -= j; |
2645 | 2623 |
2688 if(*(char*)pText == '\017') /* request font reset */ | 2666 if(*(char*)pText == '\017') /* request font reset */ |
2689 { | 2667 { |
2690 tinyState = 0; | 2668 tinyState = 0; |
2691 } | 2669 } |
2692 | 2670 |
2693 if((font == &FontT144) && (*(char*)pText == '.')) | |
2694 { | |
2695 tinyState++; | |
2696 } | |
2697 if((font == &FontT105) && ((*(char*)pText == '.') || (*(char*)pText == ':'))) | 2671 if((font == &FontT105) && ((*(char*)pText == '.') || (*(char*)pText == ':'))) |
2698 { | 2672 { |
2699 tinyState++; | 2673 tinyState++; |
2700 } | 2674 } |
2701 | 2675 |
2731 } | 2705 } |
2732 Xsum += GFX_Character_Width(decodeUTF8, font); /* lookup character and add width */ | 2706 Xsum += GFX_Character_Width(decodeUTF8, font); /* lookup character and add width */ |
2733 } | 2707 } |
2734 pText++; | 2708 pText++; |
2735 j++; | 2709 j++; |
2736 if((font == &FontT144) && (*(char*)pText != 0)) | 2710 |
2737 Xsum += 3; | |
2738 else | |
2739 if((font == &FontT105) && (*(char*)pText != 0)) | 2711 if((font == &FontT105) && (*(char*)pText != 0)) |
2740 Xsum += 2; | 2712 Xsum += 2; |
2741 } | 2713 } |
2742 pText -= j; | 2714 pText -= j; |
2743 | 2715 |