* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
*
*/
#include <assert.h>
#if PANGO_SUPPORT
/* Try to load a pango font if specified */
if (strlen(pattern) > strlen("pango:") && !strncmp(pattern, "pango:", strlen("pango:"))) {
- pattern += strlen("pango:");
- if (load_pango_font(&font, pattern))
+ const char *font_pattern = pattern + strlen("pango:");
+ if (load_pango_font(&font, font_pattern)) {
+ font.pattern = sstrdup(pattern);
return font;
+ }
} else if (strlen(pattern) > strlen("xft:") && !strncmp(pattern, "xft:", strlen("xft:"))) {
- pattern += strlen("xft:");
- if (load_pango_font(&font, pattern))
+ const char *font_pattern = pattern + strlen("xft:");
+ if (load_pango_font(&font, font_pattern)) {
+ font.pattern = sstrdup(pattern);
return font;
+ }
}
#endif
}
}
+ font.pattern = sstrdup(pattern);
LOG("Using X font %s\n", pattern);
/* Get information (height/name) for this font */
*
*/
void free_font(void) {
+ free(savedFont->pattern);
switch (savedFont->type) {
case FONT_TYPE_NONE:
/* Nothing to do */
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
*
* config_parser.c: hand-written parser to parse configuration directives.
*
sasprintf(&pageraction, "i3-sensible-pager \"%s\"\n", errorfilename);
char *argv[] = {
NULL, /* will be replaced by the executable path */
+ "-f",
+ config.font.pattern,
"-t",
(context->has_errors ? "error" : "warning"),
"-m",
* vim:ts=4:sw=4:expandtab
*
* i3 - an improved dynamic tiling window manager
- * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
*
* key_press.c: key press handler
*
sasprintf(&pageraction, "i3-sensible-pager \"%s\"\n", errorfilename);
char *argv[] = {
NULL, /* will be replaced by the executable path */
+ "-f",
+ config.font.pattern,
"-t",
"error",
"-m",