Pay attention to DPI when rendering terminal.
This commit is contained in:
parent
ee1731cf9b
commit
78202d25ba
@ -191,6 +191,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
|||||||
/* Create terminal */
|
/* Create terminal */
|
||||||
client_data->term = guac_terminal_create(client,
|
client_data->term = guac_terminal_create(client,
|
||||||
client_data->font_name, client_data->font_size,
|
client_data->font_name, client_data->font_size,
|
||||||
|
client->info.optimal_resolution,
|
||||||
client->info.optimal_width, client->info.optimal_height);
|
client->info.optimal_width, client->info.optimal_height);
|
||||||
|
|
||||||
/* Fail if terminal init failed */
|
/* Fail if terminal init failed */
|
||||||
|
@ -341,7 +341,7 @@ int __guac_terminal_set(guac_terminal_display* display, int row, int col, int co
|
|||||||
|
|
||||||
|
|
||||||
guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
|
guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
|
||||||
const char* font_name, int font_size,
|
const char* font_name, int font_size, int dpi,
|
||||||
int foreground, int background) {
|
int foreground, int background) {
|
||||||
|
|
||||||
PangoFontMap* font_map;
|
PangoFontMap* font_map;
|
||||||
@ -366,6 +366,7 @@ guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
|
|||||||
pango_font_description_set_size(display->font_desc, font_size*PANGO_SCALE);
|
pango_font_description_set_size(display->font_desc, font_size*PANGO_SCALE);
|
||||||
|
|
||||||
font_map = pango_cairo_font_map_get_default();
|
font_map = pango_cairo_font_map_get_default();
|
||||||
|
pango_cairo_font_map_set_resolution((PangoCairoFontMap*) font_map, dpi);
|
||||||
context = pango_font_map_create_context(font_map);
|
context = pango_font_map_create_context(font_map);
|
||||||
|
|
||||||
font = pango_font_map_load_font(font_map, context, display->font_desc);
|
font = pango_font_map_load_font(font_map, context, display->font_desc);
|
||||||
|
@ -238,7 +238,7 @@ typedef struct guac_terminal_display {
|
|||||||
* colors.
|
* colors.
|
||||||
*/
|
*/
|
||||||
guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
|
guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
|
||||||
const char* font_name, int font_size,
|
const char* font_name, int font_size, int dpi,
|
||||||
int foreground, int background);
|
int foreground, int background);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +94,7 @@ void guac_terminal_reset(guac_terminal* term) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
guac_terminal* guac_terminal_create(guac_client* client,
|
guac_terminal* guac_terminal_create(guac_client* client,
|
||||||
const char* font_name, int font_size,
|
const char* font_name, int font_size, int dpi,
|
||||||
int width, int height) {
|
int width, int height) {
|
||||||
|
|
||||||
guac_terminal_char default_char = {
|
guac_terminal_char default_char = {
|
||||||
@ -115,7 +115,7 @@ guac_terminal* guac_terminal_create(guac_client* client,
|
|||||||
|
|
||||||
/* Init display */
|
/* Init display */
|
||||||
term->display = guac_terminal_display_alloc(client,
|
term->display = guac_terminal_display_alloc(client,
|
||||||
font_name, font_size,
|
font_name, font_size, dpi,
|
||||||
default_char.attributes.foreground,
|
default_char.attributes.foreground,
|
||||||
default_char.attributes.background);
|
default_char.attributes.background);
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ struct guac_terminal {
|
|||||||
* rendering to the given client.
|
* rendering to the given client.
|
||||||
*/
|
*/
|
||||||
guac_terminal* guac_terminal_create(guac_client* client,
|
guac_terminal* guac_terminal_create(guac_client* client,
|
||||||
const char* font_name, int font_size,
|
const char* font_name, int font_size, int dpi,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user