Sha256: 236209f58416ce7f0381979e5e4ee1b3b2e464f29f330753dac08055c732ee18

Contents?: true

Size: 847 Bytes

Versions: 3

Compression:

Stored size: 847 Bytes

Contents

# coding: utf-8

module Thinreports
  module Generator

    # @deprecated This class will be removed in the next major version.
    class PDF::Configuration
      # @return [Array]
      attr_reader :eudc_fonts

      def initialize
        @eudc_fonts = []
      end

      # @param [String, Array<String>] fonts
      def eudc_fonts=(fonts)
        warn '[DEPRECATION] `eudc_fonts=` is deprecated and will be removed in ' +
             'the next major version of thinreports. ' +
             'Please use `Thinreports.config.fallback_fonts=` instead.'

        fonts = [fonts] unless fonts.is_a?(::Array)

        fonts.each do |f|
          unless File.extname(f.to_s) == '.ttf'
            raise ArgumentError, 'The EUDC Fonts can specify only the TTF file.'
          end
        end
        @eudc_fonts = fonts
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinreports-0.8.2 lib/thinreports/generator/pdf/configuration.rb
thinreports-0.8.1 lib/thinreports/generator/pdf/configuration.rb
thinreports-0.8.0 lib/thinreports/generator/pdf/configuration.rb