Sha256: 11cf3d886897a3d3786aff593aeafd192ca3ba8a45e3e0af89ce31f8d165e072

Contents?: true

Size: 888 Bytes

Versions: 14

Compression:

Stored size: 888 Bytes

Contents

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

require 'test_helper'
require 'hexapdf/document'
require 'hexapdf/type/font_true_type'

describe HexaPDF::Type::FontTrueType do
  before do
    @doc = HexaPDF::Document.new
    font_descriptor = @doc.add({Type: :FontDescriptor, FontName: :Something, Flags: 0b100,
                                FontBBox: [0, 1, 2, 3], ItalicAngle: 0, Ascent: 900,
                                Descent: -100, CapHeight: 800, StemV: 20})
    @font = @doc.add({Type: :Font, Subtype: :TrueType, Encoding: :WinAnsiEncoding,
                      FirstChar: 32, LastChar: 34, Widths: [600, 0, 700],
                      BaseFont: :Something, FontDescriptor: font_descriptor})
  end

  describe "validation" do
    it "requires that the FontDescriptor key is set" do
      assert(@font.validate)
      @font.delete(:FontDescriptor)
      refute(@font.validate)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hexapdf-0.12.3 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.12.2 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.12.1 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.12.0 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.9 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.8 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.7 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.6 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.5 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.4 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.3 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.2 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.1 test/hexapdf/type/test_font_true_type.rb
hexapdf-0.11.0 test/hexapdf/type/test_font_true_type.rb