diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-09-06 11:49:39 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-09-06 11:49:39 +0800 |
commit | 7c6eda569a9f3ae8814fd01267f655155e06ed8e (patch) | |
tree | 51ff913101057060d3655cfed54b69a389beb813 /csrc/font.c | |
parent | 0a472c35f411355c672d9b119cc6ef79598e8b76 (diff) | |
download | rich4-7c6eda569a9f3ae8814fd01267f655155e06ed8e.tar.xz |
drawStringY
Diffstat (limited to 'csrc/font.c')
-rw-r--r-- | csrc/font.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/csrc/font.c b/csrc/font.c index e576f56..e623884 100644 --- a/csrc/font.c +++ b/csrc/font.c @@ -26,3 +26,21 @@ HFONT create_some_font(int a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a gFont = CreateFontA(-a0, 0, 0, 0, weight, 0, 0, 0, 0x88 /* charset */, 0, 0, 0, 0, tfname); return gFont; } + +void drawStringY(HDC hdc, int nXStart, int nYStart, LPCSTR str) +{ + int h = gFontHeight + gfa[1]; + if (((uint8_t)gfa[0] & 6) != 0) + h++; + + while (*str) { + if ((str[0] & 0x80) != 0) { + TextOutA(hdc, nXStart, nYStart, str, 2); + str += 2; + } else { + TextOutA(hdc, nXStart, nYStart, str, 1); + str += 1; + } + nYStart += h; + } +} |