vcs

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category General
  • Assigned To
    outlyer
  • Operating System
  • Severity Medium
  • Priority Very Low
  • Reported Version 1.11.1
  • Due in Version 1.11.2
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: vcs
Opened by outlyer - 13.03.2010
Last edited by outlyer - 18.03.2010

FS#136 - Ubuntu doesn't register fonts with ImageMagick

Symbolic font names don’t work since IM won’t know about TTF fonts.

Probably affects other systems too.

Closed by  outlyer
18.03.2010 23:39
Reason for closing:  Fixed
Additional comments about closing:  

Fixed in 1.11.2

Project Manager

Preliminary patch:

--- vcs	2010-03-13 21:28:33.000000000 +0100
+++ vcs.fixed	2010-03-13 21:28:53.000000000 +0100
@@ -2648,6 +2648,40 @@
 	fptest "$interval" -eq 0 && interval=$DEFAULT_INTERVAL 
 
 	sanitise_rename_pattern
+	sanitise_fonts
+}
+
+# If the OS hasn't registered TTF fonts with IM, try to use a saner value
+#+*only* for fonts not overridden
+sanitise_fonts() {
+	# Any default font in use? If all of them are overridden, return
+	if [ "$USR_font_heading" -a "$USR_font_title" -a "$USR_font_tstamps" -a "$USR_font_sign" ]; then
+		return
+	fi
+	# If the user edits any font in the script, stop messing with this
+	[ -z "$USR_font_heading" ] && [ "$font_heading" != 'DejaVu-Sans-Book' ] && return
+	[ -z "$USR_font_title" ] && [ "$font_title" != 'DejaVu-Sans-Book' ] && return
+	[ -z "$USR_font_tstamps" ] && [ "$font_tstamps" != 'DejaVu-Sans-Book' ] && return
+	[ -z "$USR_font_sign" ] && [ "$font_sign" != 'DejaVu-Sans-Book' ] && return
+	# Try to locate DejaVu Sans
+	[ ! -d /usr/share/fonts ] && return
+	local dvs=$(find /usr/share/fonts/ -type f -iname 'dejavusans.ttf')
+	if [ -z "$dvs" ]; then
+		warn "Unable to locate DejaVu Sans font. Falling back to helvetica."
+		dvs=helvetica
+	fi
+	[ -z "$USR_font_heading" ] && font_heading="$dvs"
+	[ -z "$USR_font_title" ] && font_title="$dvs"
+	[ -z "$USR_font_tstamps" ] && font_tstamps="$dvs"
+	[ -z "$USR_font_sign" ] && font_sign="$dvs"
+	[ $DEBUG -eq 1 ] || { return 0; }
+	cat >&2 <<-EOFF
+	Font Sanitization:
+	  font_heading: $font_heading
+	  font_title  : $font_title
+	  font_tstamps: $font_tstamps
+	  font_sign   : $font_sign
+EOFF
 }
 
 check_height() { # Acceptable height

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing