Lines Matching refs:font
451 static const u8 *get_char_bitmap(const struct font_desc *font, char c, size_t font_pitch) in get_char_bitmap() argument
453 return font->data + (c * font->height) * font_pitch; in get_char_bitmap()
470 const struct font_desc *font, in draw_txt_rectangle() argument
479 size_t font_pitch = DIV_ROUND_UP(font->width, 8); in draw_txt_rectangle()
482 msg_lines = min(msg_lines, drm_rect_height(clip) / font->height); in draw_txt_rectangle()
484 size_t line_len = min(msg[i].len, drm_rect_width(clip) / font->width); in draw_txt_rectangle()
486 rec.y1 = clip->y1 + i * font->height; in draw_txt_rectangle()
487 rec.y2 = rec.y1 + font->height; in draw_txt_rectangle()
491 rec.x1 += (drm_rect_width(clip) - (line_len * font->width)) / 2; in draw_txt_rectangle()
494 src = get_char_bitmap(font, msg[i].txt[j], font_pitch); in draw_txt_rectangle()
495 rec.x2 = rec.x1 + font->width; in draw_txt_rectangle()
497 rec.x1 += font->width; in draw_txt_rectangle()
502 static void drm_panic_logo_rect(struct drm_rect *rect, const struct font_desc *font) in drm_panic_logo_rect() argument
507 int logo_width = get_max_line_len(logo_ascii, logo_ascii_lines) * font->width; in drm_panic_logo_rect()
509 drm_rect_init(rect, 0, 0, logo_width, logo_ascii_lines * font->height); in drm_panic_logo_rect()
514 const struct font_desc *font, u32 fg_color) in drm_panic_logo_draw() argument
520 draw_txt_rectangle(sb, font, logo_ascii, logo_ascii_lines, false, rect, in drm_panic_logo_draw()
528 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); in draw_panic_static_user() local
532 if (!font) in draw_panic_static_user()
536 drm_panic_logo_rect(&r_logo, font); in draw_panic_static_user()
538 msg_width = min(get_max_line_len(panic_msg, panic_msg_lines) * font->width, sb->width); in draw_panic_static_user()
539 msg_height = min(panic_msg_lines * font->height, sb->height); in draw_panic_static_user()
549 drm_panic_logo_draw(sb, &r_logo, font, fg_color); in draw_panic_static_user()
551 draw_txt_rectangle(sb, font, panic_msg, panic_msg_lines, true, &r_msg, fg_color); in draw_panic_static_user()
558 static int draw_line_with_wrap(struct drm_scanout_buffer *sb, const struct font_desc *font, in draw_line_with_wrap() argument
561 int chars_per_row = sb->width / font->width; in draw_line_with_wrap()
568 draw_txt_rectangle(sb, font, &line_wrap, 1, false, &r_txt, fg_color); in draw_line_with_wrap()
569 r_txt.y1 -= font->height; in draw_line_with_wrap()
575 draw_txt_rectangle(sb, font, &line_wrap, 1, false, &r_txt, fg_color); in draw_line_with_wrap()
576 r_txt.y1 -= font->height; in draw_line_with_wrap()
581 draw_txt_rectangle(sb, font, line, 1, false, &r_txt, fg_color); in draw_line_with_wrap()
582 r_txt.y1 -= font->height; in draw_line_with_wrap()
595 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); in draw_panic_static_kmsg() local
603 if (!font) in draw_panic_static_kmsg()
606 yoffset = sb->height - font->height - (sb->height % font->height) / 2; in draw_panic_static_kmsg()
626 yoffset = draw_line_with_wrap(sb, font, &line, yoffset, fg_color); in draw_panic_static_kmsg()
786 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); in _draw_panic_static_qr_code() local
793 if (!font || !qrbuf1 || !qrbuf2 || !stream.workspace) in _draw_panic_static_qr_code()
798 drm_panic_logo_rect(&r_logo, font); in _draw_panic_static_qr_code()
800 msg_width = min(get_max_line_len(panic_msg, panic_msg_lines) * font->width, sb->width); in _draw_panic_static_qr_code()
801 msg_height = min(panic_msg_lines * font->height, sb->height); in _draw_panic_static_qr_code()
833 drm_panic_logo_draw(sb, &r_logo, font, fg_color); in _draw_panic_static_qr_code()
835 draw_txt_rectangle(sb, font, panic_msg, panic_msg_lines, true, &r_msg, fg_color); in _draw_panic_static_qr_code()