mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	Use cairo_show_glyphs for rendering text
A small step for now.
This commit is contained in:
		
							parent
							
								
									4554c41bf8
								
							
						
					
					
						commit
						ed6aec30f1
					
				
					 1 changed files with 11 additions and 3 deletions
				
			
		| 
						 | 
					@ -656,12 +656,14 @@ terminal_draw_contents(struct terminal *terminal)
 | 
				
			||||||
	int top_margin, side_margin;
 | 
						int top_margin, side_margin;
 | 
				
			||||||
	int row, col;
 | 
						int row, col;
 | 
				
			||||||
	char attr;
 | 
						char attr;
 | 
				
			||||||
	char toShow[5] = {0, };
 | 
					 | 
				
			||||||
	int border, foreground, background, bold, underline, tmp;
 | 
						int border, foreground, background, bold, underline, tmp;
 | 
				
			||||||
	int text_x, text_y;
 | 
						int text_x, text_y;
 | 
				
			||||||
	cairo_surface_t *surface;
 | 
						cairo_surface_t *surface;
 | 
				
			||||||
	double d;
 | 
						double d;
 | 
				
			||||||
	struct terminal_color color;
 | 
						struct terminal_color color;
 | 
				
			||||||
 | 
						int num_glyphs;
 | 
				
			||||||
 | 
						cairo_scaled_font_t *font;
 | 
				
			||||||
 | 
						cairo_glyph_t glyphs[256], *g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	window_get_child_rectangle(terminal->window, &rectangle);
 | 
						window_get_child_rectangle(terminal->window, &rectangle);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -750,8 +752,14 @@ terminal_draw_contents(struct terminal *terminal)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		cairo_move_to(cr, text_x, text_y);
 | 
							cairo_move_to(cr, text_x, text_y);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		memcpy(toShow, &terminal_get_row(terminal, row)[col], 4);
 | 
							g = glyphs;
 | 
				
			||||||
		cairo_show_text(cr, toShow);
 | 
							num_glyphs = ARRAY_LENGTH(glyphs);
 | 
				
			||||||
 | 
							font = cairo_get_scaled_font (cr);
 | 
				
			||||||
 | 
							cairo_scaled_font_text_to_glyphs (font, text_x, text_y,
 | 
				
			||||||
 | 
											  (char *) &terminal_get_row(terminal, row)[col].byte, 4,
 | 
				
			||||||
 | 
											  &g, &num_glyphs,
 | 
				
			||||||
 | 
											  NULL, NULL, NULL);
 | 
				
			||||||
 | 
							cairo_show_glyphs (cr, g, num_glyphs);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (terminal->show_cursor && !terminal->focused) {
 | 
						if (terminal->show_cursor && !terminal->focused) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue