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 ------------------------------------'
|