Description: New option --title: string for page header (instead of filename/"stdin") Author: Christian Ziemski Last-Update: <2014-06-01> --- paps-0.6.8.orig/src/paps.1 +++ paps-0.6.8/src/paps.1 @@ -69,6 +69,9 @@ Show summary of options. .B \-\-header Draw page header for each page. .TP +.B \-\-title +Title string for page header (instead of filename/"stdin"). +.TP .B \-\-markup Interpret the text as pango markup. .TP --- paps-0.6.8.orig/src/paps.c +++ paps-0.6.8/src/paps.c @@ -284,6 +284,7 @@ int main(int argc, char *argv[]) int top_margin = 36, bottom_margin = 36, right_margin = 36, left_margin = 36; int gutter_width = 40; gchar *font = MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE), *encoding = NULL; + gchar *htitle = NULL; page_layout_t page_layout; GOptionContext *ctxt = g_option_context_new("[text file]"); GOptionEntry entries[] = { @@ -302,6 +303,7 @@ int main(int argc, char *argv[]) {"left-margin", 0, 0, G_OPTION_ARG_INT, &left_margin, "Set left margin. (Default: 36)", "NUM"}, {"gutter-width", 0, 0, G_OPTION_ARG_INT, &gutter_width, "Set gutter width. (Default: 40)", "NUM"}, {"header", 0, 0, G_OPTION_ARG_NONE, &do_draw_header, "Draw page header for each page.", NULL}, + {"title", 0, 0, G_OPTION_ARG_STRING, &htitle, "Title string for page header (instead of filename/stdin).", "TITLE"}, {"encoding", 0, 0, G_OPTION_ARG_STRING, &encoding, "Assume the documentation encoding.", "ENCODING"}, {"lpi", 0, 0, G_OPTION_ARG_CALLBACK, _paps_arg_lpi_cb, "Set the amount of lines per inch.", "REAL"}, {"cpi", 0, 0, G_OPTION_ARG_CALLBACK, _paps_arg_cpi_cb, "Set the amount of characters per inch.", "REAL"}, @@ -371,6 +373,11 @@ int main(int argc, char *argv[]) IN = stdin; } title = filename_in; + + if (htitle) + { + title = htitle; + } paps = paps_new(); pango_context = paps_get_pango_context (paps); @@ -451,7 +458,7 @@ int main(int argc, char *argv[]) page_layout.do_tumble = do_tumble; page_layout.do_duplex = do_duplex; page_layout.pango_dir = pango_dir; - page_layout.filename = filename_in; + page_layout.filename = title; page_layout.header_font_desc = header_font_desc; /* calculate x-coordinate scale */