Sha256: 7bccd70f67a34acd09805b4cc9c2ecd8f272278c52cff79974043c1df72bdec1

Contents?: true

Size: 497 Bytes

Versions: 98

Compression:

Stored size: 497 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'test_helper'
require 'hexapdf/font/type1'

describe HexaPDF::Font::Type1::FontMetrics do
  before do
    @metrics = HexaPDF::Font::Type1::FontMetrics.new
  end

  describe "weight_class" do
    it "converts known weight names" do
      @metrics.weight = 'Bold'
      assert_equal(700, @metrics.weight_class)
    end

    it "returns 0 for unknown weight names" do
      @metrics.weight = 'Unknown'
      assert_equal(0, @metrics.weight_class)
    end
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
hexapdf-0.22.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.21.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.21.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.20.4 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.20.3 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.20.2 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.20.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.20.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.19.3 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.19.2 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.19.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.19.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.18.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.17.3 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.17.2 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.16.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.15.9 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.15.8 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.15.7 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.15.6 test/hexapdf/font/type1/test_font_metrics.rb