File: 0010-fix_example_metrics.patch

package info (click to toggle)
ruby-ttfunk 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,472 kB
  • sloc: ruby: 7,954; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 819 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
26
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: 2020-09-01

--- a/examples/metrics.rb
+++ b/examples/metrics.rb
@@ -1,6 +1,7 @@
+#!/usr/bin/ruby
 # frozen_string_literal: true
 
-require_relative '../lib/ttfunk'
+require 'ttfunk'
 
 def character_lookup(file, character)
   puts("character     : #{character}")
@@ -22,6 +23,7 @@ def character_lookup(file, character)
 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 ------------------------------------'