summaryrefslogtreecommitdiff
path: root/csrc/font.c
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-09-06 11:49:39 +0800
committerIru Cai <mytbk920423@gmail.com>2018-09-06 11:49:39 +0800
commit7c6eda569a9f3ae8814fd01267f655155e06ed8e (patch)
tree51ff913101057060d3655cfed54b69a389beb813 /csrc/font.c
parent0a472c35f411355c672d9b119cc6ef79598e8b76 (diff)
downloadrich4-7c6eda569a9f3ae8814fd01267f655155e06ed8e.tar.xz
drawStringY
Diffstat (limited to 'csrc/font.c')
-rw-r--r--csrc/font.c18
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;
+ }
+}