Sha256: 034db6b64d5b6540da767c9318713f86dea961b986a2791a90386153f811f9ab

Contents?: true

Size: 959 Bytes

Versions: 30

Compression:

Stored size: 959 Bytes

Contents

module Fontist
  module Import
    class OtfStyle
      def initialize(info, path)
        @info = info
        @path = path
      end

      def call
        style = { family_name: @info["Family"],
                  style: @info["Subfamily"],
                  full_name: @info["Full name"],
                  post_script_name: @info["PostScript name"],
                  version: version(@info["Version"]),
                  description: @info["Description"],
                  filename: File.basename(@path),
                  copyright: @info["Copyright"] }

        if @info["Preferred family"]
          style[:preferred_family_name] = @info["Preferred family"]
        end

        if @info["Preferred subfamily"]
          style[:preferred_style] = @info["Preferred subfamily"]
        end

        OpenStruct.new(style)
      end

      private

      def version(text)
        Fontist::Import::Google.style_version(text)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
fontist-1.21.2 lib/fontist/import/otf_style.rb
fontist-1.21.1 lib/fontist/import/otf_style.rb
fontist-1.20.0 lib/fontist/import/otf_style.rb
fontist-1.19.0 lib/fontist/import/otf_style.rb
fontist-1.18.2 lib/fontist/import/otf_style.rb
fontist-1.17.1 lib/fontist/import/otf_style.rb
fontist-1.17.0 lib/fontist/import/otf_style.rb
fontist-1.16.0 lib/fontist/import/otf_style.rb
fontist-1.15.2 lib/fontist/import/otf_style.rb
fontist-1.15.1 lib/fontist/import/otf_style.rb
fontist-1.15.0 lib/fontist/import/otf_style.rb
fontist-1.14.6 lib/fontist/import/otf_style.rb
fontist-1.14.5 lib/fontist/import/otf_style.rb
fontist-1.14.4 lib/fontist/import/otf_style.rb
fontist-1.14.3 lib/fontist/import/otf_style.rb
fontist-1.14.2 lib/fontist/import/otf_style.rb
fontist-1.14.1 lib/fontist/import/otf_style.rb
fontist-1.14.0 lib/fontist/import/otf_style.rb
fontist-1.13.2 lib/fontist/import/otf_style.rb
fontist-1.13.1 lib/fontist/import/otf_style.rb