Skip to content

Commit

Permalink
adding externally-accessible functions for drawing individual charact…
Browse files Browse the repository at this point in the history
…ers from single-byte numeric codepoints to get around annoying encoding issues in dotnet

Signed-off-by: Addison Schuhardt <addison@schuhardt.net>
  • Loading branch information
aschuhardt committed Dec 9, 2020
1 parent 8c9b9f6 commit a879713
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/drawing.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ void procy_draw_string(struct procy_window_t *window, short x, short y,
procy_color_t forecolor, procy_color_t backcolor,
const char *contents);

void procy_draw_char(struct procy_window_t *window, short x, short y,
procy_color_t forecolor, procy_color_t backcolor, char c);

void procy_draw_char_bold(struct procy_window_t *window, short x, short y,
procy_color_t forecolor, procy_color_t backcolor,
char c);

void procy_draw_string_bold(struct procy_window_t *window, short x, short y,
procy_color_t forecolor, procy_color_t backcolor,
const char *contents);
Expand Down
15 changes: 15 additions & 0 deletions src/drawing.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ void procy_draw_string(window_t *window, short x, short y, color_t forecolor,
draw_string_chars(window, x, y, false, forecolor, backcolor, contents);
}

void procy_draw_char(struct procy_window_t *window, short x, short y,
procy_color_t forecolor, procy_color_t backcolor, char c) {
draw_op_t op =
procy_create_draw_op_char_colored(x, y, forecolor, backcolor, c, false);
procy_append_draw_op(window, &op);
}

void procy_draw_char_bold(struct procy_window_t *window, short x, short y,
procy_color_t forecolor, procy_color_t backcolor,
char c) {
draw_op_t op =
procy_create_draw_op_char_colored(x, y, forecolor, backcolor, c, true);
procy_append_draw_op(window, &op);
}

void procy_draw_string_bold(window_t *window, short x, short y,
color_t forecolor, color_t backcolor,
const char *contents) {
Expand Down

0 comments on commit a879713

Please sign in to comment.