File: 0010-fix_example_metrics.patch

package info (click to toggle)
ruby-ttfunk 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,016 kB
  • sloc: ruby: 2,319; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 766 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: fix metrics.rb shipped as an example
 * add a shebang
 * use the system library by loading it with require instead of require_relative
 * use system copy of dejavu font
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2017-09-29

--- a/examples/metrics.rb
+++ b/examples/metrics.rb
@@ -1,5 +1,6 @@
+#!/usr/bin/ruby
 # encoding: utf-8
-require_relative '../lib/ttfunk'
+require 'ttfunk'
 
 def character_lookup(file, character)
   puts "character     : #{character}"
@@ -23,6 +24,7 @@
 end
 
 file_name = ARGV.first || File.join(__dir__, '../data/fonts/DejaVuSans.ttf')
+file_name = ARGV.first || '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf'
 file = TTFunk::File.open(file_name)
 
 puts '-- FONT ------------------------------------'