Commit 996f888ebcd1356d08650e6b8368d061b53682f3
1 parent
0965d449
Exists in
master
and in
5 other branches
Diferenciando configuração de fonte quando o ajuste automático de tamanho está ativo
Showing
1 changed file
with
12 additions
and
3 deletions
Show diff stats
src/pw3270/print.c
| ... | ... | @@ -35,6 +35,14 @@ |
| 35 | 35 | |
| 36 | 36 | #define AUTO_FONT_SIZE 1 |
| 37 | 37 | |
| 38 | +#ifdef AUTO_FONT_SIZE | |
| 39 | + #define FONT_CONFIG "font-family" | |
| 40 | + #define DEFAULT_FONT "Courier New" | |
| 41 | +#else | |
| 42 | + #define FONT_CONFIG "font" | |
| 43 | + #define DEFAULT_FONT "Courier New 10" | |
| 44 | +#endif // AUTO_FONT_SIZE | |
| 45 | + | |
| 38 | 46 | /*--[ Structs ]--------------------------------------------------------------------------------------*/ |
| 39 | 47 | |
| 40 | 48 | typedef struct _print_info |
| ... | ... | @@ -61,12 +69,13 @@ |
| 61 | 69 | |
| 62 | 70 | } PRINT_INFO; |
| 63 | 71 | |
| 72 | + | |
| 64 | 73 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 65 | 74 | |
| 66 | 75 | static void begin_print(GtkPrintOperation *prt, GtkPrintContext *context, PRINT_INFO *info) |
| 67 | 76 | { |
| 68 | 77 | cairo_t * cr = gtk_print_context_get_cairo_context(context); |
| 69 | - gchar * font = get_string_from_config("print","font","Courier New 10"); | |
| 78 | + gchar * font = get_string_from_config("print",FONT_CONFIG,DEFAULT_FONT); | |
| 70 | 79 | |
| 71 | 80 | trace("%s: operation=%p context=%p font=\"%s\"",__FUNCTION__,prt,context,font); |
| 72 | 81 | |
| ... | ... | @@ -372,7 +381,7 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 372 | 381 | if(info->font) |
| 373 | 382 | g_free(info->font); |
| 374 | 383 | |
| 375 | - info->font = get_string_from_config("print","font","Courier New"); | |
| 384 | + info->font = get_string_from_config("print",FONT_CONFIG,DEFAULT_FONT); | |
| 376 | 385 | |
| 377 | 386 | // Font selection button |
| 378 | 387 | #ifdef AUTO_FONT_SIZE |
| ... | ... | @@ -463,7 +472,7 @@ static gchar * enum_to_string(GType type, guint enum_value) |
| 463 | 472 | GdkColor * clr = g_object_get_data(G_OBJECT(combo),"selected"); |
| 464 | 473 | |
| 465 | 474 | if(info->font) |
| 466 | - set_string_to_config("print","font",info->font); | |
| 475 | + set_string_to_config("print",FONT_CONFIG,info->font); | |
| 467 | 476 | |
| 468 | 477 | if(clr) |
| 469 | 478 | { | ... | ... |