Commit ec496289 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Make --font set the global default font

parent ed23ca2e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ git HEAD
    * Don't make the --thumbnails window fullscreen. The images launched from
      thumbnail mode may be fullscreen, though. You can still use 'v' to
      toggle fullscreen, should you really need it.
    * --font now sets the global default font (for action/filename display etc.)

Thu Jun 10 12:12:04 CEST 2010

+0 −2
Original line number Diff line number Diff line
@@ -23,5 +23,3 @@ thumbnails are created, becoming quite slow for large filelists.
A workaround (--thumb-redraw) exists, but at some point a rewrite with a
GUI-toolkit or similar (or maybe writing a completely new tool for that and
removing the feature from feh) would be due.

Option to set font globally
+4 −5
Original line number Diff line number Diff line
@@ -185,6 +185,10 @@ when
.Nm
exits.  You can add files to filelists by specifying them on the commandline
when also specifying the list.
.It Cm -e , --font Ar font
Set global font.  Should be a truetype font, resident in the current directory
or the font directory, and should be defined in the form fontname/points, like
.Qq myfont/12 .
.It Cm -C , --fontpath Ar path
Specify
.Ar path
@@ -472,11 +476,6 @@ will only redraw once all thumbnails are loaded.
.
.Sh INDEX MODE OPTIONS
.Bl -tag -width indent
.It Cm -e , --font Ar font
Set font for printing the information under each thumbnail.  Should be a
truetype font, resident in the current directory or the font directory, and
should be defined in the form fontname/points, like
.Qq myfont/12 .
.It Cm -@ , --title-font Ar font
Set font to print a title on the index, if no font is specified, no title will
be printed.
+20 −4
Original line number Diff line number Diff line
@@ -552,9 +552,11 @@ void feh_draw_zoom(winwidget w)
	if (!w->im)
		return;

	if (opt.font)
		fn = gib_imlib_load_font(opt.font);

	if (!fn) {
		fn = gib_imlib_load_font(DEFAULT_FONT);
		memset(atab, 0, sizeof(atab));
	}

	if (!fn) {
@@ -562,6 +564,8 @@ void feh_draw_zoom(winwidget w)
		return;
	}

	memset(atab, 0, sizeof(atab));

	snprintf(buf, sizeof(buf), "%.0f%%, %dx%d", w->zoom * 100,
			(int) (w->im_w * w->zoom), (int) (w->im_h * w->zoom));

@@ -598,8 +602,10 @@ void feh_draw_filename(winwidget w)
			|| (!FEH_FILE(w->file->data)->filename))
		return;

	if (opt.font)
		fn = gib_imlib_load_font(opt.font);

	if (!fn) {
		memset(atab, 0, sizeof(atab));
		if (w->full_screen)
			fn = gib_imlib_load_font(DEFAULT_FONT_BIG);
		else
@@ -611,6 +617,8 @@ void feh_draw_filename(winwidget w)
		return;
	}

	memset(atab, 0, sizeof(atab));

	/* Work out how high the font is */
	gib_imlib_get_text_size(fn, FEH_FILE(w->file->data)->filename, NULL, &tw, &th, IMLIB_TEXT_TO_RIGHT);

@@ -730,8 +738,10 @@ void feh_draw_caption(winwidget w)
	caption_style->bits = gib_list_add_front(caption_style->bits,
		gib_style_bit_new(1, 1, 0, 0, 0, 255));

	if (opt.font)
		fn = gib_imlib_load_font(opt.font);

	if (!fn) {
		memset(atab, 0, sizeof(atab));
		if (w->full_screen)
			fn = gib_imlib_load_font(DEFAULT_FONT_BIG);
		else
@@ -743,6 +753,8 @@ void feh_draw_caption(winwidget w)
		return;
	}

	memset(atab, 0, sizeof(atab));

	if (*(file->caption) == '\0') {
		p = estrdup("Caption entry mode - Hit ESC to cancel");
		lines = feh_wrap_string(p, w->w, fn, NULL);
@@ -1035,8 +1047,10 @@ void feh_draw_actions(winwidget w)
			|| (!FEH_FILE(w->file->data)->filename))
		return;

	if (opt.font)
		fn = gib_imlib_load_font(opt.font);

	if (!fn) {
		memset(atab, 0, sizeof(atab));
		if (w->full_screen)
			fn = gib_imlib_load_font(DEFAULT_FONT_BIG);
		else
@@ -1048,6 +1062,8 @@ void feh_draw_actions(winwidget w)
		return;
	}

	memset(atab, 0, sizeof(atab));

	gib_imlib_get_text_size(fn, "defined actions:", NULL, &tw, &th, IMLIB_TEXT_TO_RIGHT);
/* Check for the widest line */
	max_tw = tw;
+5 −1
Original line number Diff line number Diff line
@@ -68,8 +68,12 @@ void init_index_mode(void)
		mode = "index";
	}

	if (opt.font)
		fn = gib_imlib_load_font(opt.font);

	if (!fn)
		fn = gib_imlib_load_font(DEFAULT_FONT);

	if (opt.title_font) {
		int fh, fw;

Loading