Pay attention to DPI when rendering terminal.

This commit is contained in:
Michael Jumper 2013-12-27 00:28:23 -08:00
parent ee1731cf9b
commit 78202d25ba
5 changed files with 7 additions and 5 deletions

View File

@ -191,6 +191,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
/* Create terminal */
client_data->term = guac_terminal_create(client,
client_data->font_name, client_data->font_size,
client->info.optimal_resolution,
client->info.optimal_width, client->info.optimal_height);
/* Fail if terminal init failed */

View File

@ -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,
const char* font_name, int font_size,
const char* font_name, int font_size, int dpi,
int foreground, int background) {
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);
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);
font = pango_font_map_load_font(font_map, context, display->font_desc);

View File

@ -238,7 +238,7 @@ typedef struct guac_terminal_display {
* colors.
*/
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);
/**

View File

@ -94,7 +94,7 @@ void guac_terminal_reset(guac_terminal* term) {
}
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) {
guac_terminal_char default_char = {
@ -115,7 +115,7 @@ guac_terminal* guac_terminal_create(guac_client* client,
/* Init display */
term->display = guac_terminal_display_alloc(client,
font_name, font_size,
font_name, font_size, dpi,
default_char.attributes.foreground,
default_char.attributes.background);

View File

@ -260,7 +260,7 @@ struct guac_terminal {
* rendering to the given 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);
/**