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-1.1.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-1.1.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-1.0.3 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-1.0.2 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-1.0.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-1.0.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.47.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.46.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.45.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.44.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.41.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.40.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.39.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.39.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.38.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.37.2 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.37.1 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.37.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.36.0 test/hexapdf/font/type1/test_font_metrics.rb
hexapdf-0.35.1 test/hexapdf/font/type1/test_font_metrics.rb