Lines Matching refs:font
263 const struct font_desc *font, in draw_txt_rectangle() argument
272 size_t font_pitch = DIV_ROUND_UP(font->width, 8); in draw_txt_rectangle()
275 msg_lines = min(msg_lines, drm_rect_height(clip) / font->height); in draw_txt_rectangle()
277 size_t line_len = min(msg[i].len, drm_rect_width(clip) / font->width); in draw_txt_rectangle()
279 rec.y1 = clip->y1 + i * font->height; in draw_txt_rectangle()
280 rec.y2 = rec.y1 + font->height; in draw_txt_rectangle()
284 rec.x1 += (drm_rect_width(clip) - (line_len * font->width)) / 2; in draw_txt_rectangle()
287 src = drm_draw_get_char_bitmap(font, msg[i].txt[j], font_pitch); in draw_txt_rectangle()
288 rec.x2 = rec.x1 + font->width; in draw_txt_rectangle()
290 rec.x1 += font->width; in draw_txt_rectangle()
295 static void drm_panic_logo_rect(struct drm_rect *rect, const struct font_desc *font) in drm_panic_logo_rect() argument
300 int logo_width = get_max_line_len(logo_ascii, logo_ascii_lines) * font->width; in drm_panic_logo_rect()
302 drm_rect_init(rect, 0, 0, logo_width, logo_ascii_lines * font->height); in drm_panic_logo_rect()
307 const struct font_desc *font, u32 fg_color) in drm_panic_logo_draw() argument
313 draw_txt_rectangle(sb, font, logo_ascii, logo_ascii_lines, false, rect, in drm_panic_logo_draw()
323 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); in draw_panic_static_user() local
327 if (!font) in draw_panic_static_user()
331 drm_panic_logo_rect(&r_logo, font); in draw_panic_static_user()
333 msg_width = min(get_max_line_len(panic_msg, panic_msg_lines) * font->width, sb->width); in draw_panic_static_user()
334 msg_height = min(panic_msg_lines * font->height, sb->height); in draw_panic_static_user()
344 drm_panic_logo_draw(sb, &r_logo, font, fg_color); in draw_panic_static_user()
346 draw_txt_rectangle(sb, font, panic_msg, panic_msg_lines, true, &r_msg, fg_color); in draw_panic_static_user()
353 static int draw_line_with_wrap(struct drm_scanout_buffer *sb, const struct font_desc *font, in draw_line_with_wrap() argument
356 int chars_per_row = sb->width / font->width; in draw_line_with_wrap()
363 draw_txt_rectangle(sb, font, &line_wrap, 1, false, &r_txt, fg_color); in draw_line_with_wrap()
364 r_txt.y1 -= font->height; in draw_line_with_wrap()
370 draw_txt_rectangle(sb, font, &line_wrap, 1, false, &r_txt, fg_color); in draw_line_with_wrap()
371 r_txt.y1 -= font->height; in draw_line_with_wrap()
376 draw_txt_rectangle(sb, font, line, 1, false, &r_txt, fg_color); in draw_line_with_wrap()
377 r_txt.y1 -= font->height; in draw_line_with_wrap()
392 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); in draw_panic_static_kmsg() local
400 if (!font) in draw_panic_static_kmsg()
403 yoffset = sb->height - font->height - (sb->height % font->height) / 2; in draw_panic_static_kmsg()
423 yoffset = draw_line_with_wrap(sb, font, &line, yoffset, fg_color); in draw_panic_static_kmsg()
580 const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL); in _draw_panic_static_qr_code() local
587 if (!font || !qrbuf1 || !qrbuf2 || !stream.workspace) in _draw_panic_static_qr_code()
592 drm_panic_logo_rect(&r_logo, font); in _draw_panic_static_qr_code()
594 msg_width = min(get_max_line_len(panic_msg, panic_msg_lines) * font->width, sb->width); in _draw_panic_static_qr_code()
595 msg_height = min(panic_msg_lines * font->height, sb->height); in _draw_panic_static_qr_code()
627 drm_panic_logo_draw(sb, &r_logo, font, fg_color); in _draw_panic_static_qr_code()
629 draw_txt_rectangle(sb, font, panic_msg, panic_msg_lines, true, &r_msg, fg_color); in _draw_panic_static_qr_code()