Sha256: 42f530130d6a4d63349bd5fc906f89d130194798f4bb4dea7f9bc26e84ebd8ba

Contents?: true

Size: 622 Bytes

Versions: 5

Compression:

Stored size: 622 Bytes

Contents

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

require 'test_helper'
require 'hexapdf/font_loader'
require 'hexapdf/document'

describe HexaPDF::FontLoader::Standard14 do
  before do
    @doc = HexaPDF::Document.new
  end

  it "loads the font if it is a standard PDF built-in font" do
    wrapper = @doc.fonts.load("Times")
    assert_equal("Times-Roman", wrapper.wrapped_font.font_name)
    wrapper = @doc.fonts.load("Helvetica", variant: :bold)
    assert_equal("Helvetica-Bold", wrapper.wrapped_font.font_name)
  end

  it "returns nil for unknown fonts" do
    assert_nil(HexaPDF::FontLoader::Standard14.call(@doc, "Unknown"))
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hexapdf-0.5.0 test/hexapdf/font_loader/test_standard14.rb
hexapdf-0.4.0 test/hexapdf/font_loader/test_standard14.rb
hexapdf-0.3.0 test/hexapdf/font_loader/test_standard14.rb
hexapdf-0.2.0 test/hexapdf/font_loader/test_standard14.rb
hexapdf-0.1.0 test/hexapdf/font_loader/test_standard14.rb