Browse Source

微调排版参数

master
jiangming1399 1 year ago
parent
commit
9e8fe45675
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      calendar.c

+ 3
- 3
calendar.c View File

@@ -16,13 +16,13 @@ uint8_t get_init_day(uint8_t m_day, uint8_t w_day)
void calendar_generate_single(struct font_lib* cjk_font, struct font_lib* num_font, uint8_t mday, uint8_t wday, struct font_render_buffer* buffer)
{
struct font_render_buffer upper;
int upper_height = buffer->height / 7 * 3;
int lower_height = buffer->height - upper_height - buffer->height * 0.1;
int upper_height = buffer->height * 0.4;
int lower_height = buffer->height - upper_height - buffer->height * 0.06;
fonts_make_render_buffer(&upper, buffer->width, upper_height);
struct font_render_buffer lower;
fonts_make_render_buffer(&lower, buffer->width, lower_height);

fonts_render(cjk_font, weekChar[wday], upper_height - 2, FONT_ALIGN_CENTER, &upper);
fonts_render(cjk_font, weekChar[wday], upper_height * 0.9, FONT_ALIGN_CENTER, &upper);
wchar_t str[3];
swprintf(str, 3, L"%d", mday);
fonts_render(num_font, str, lower_height, FONT_ALIGN_CENTER, &lower);


Loading…
Cancel
Save