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.13.0 lib/fontist/import/otf_style.rb
fontist-1.12.0 lib/fontist/import/otf_style.rb
fontist-1.11.7 lib/fontist/import/otf_style.rb
fontist-1.11.6 lib/fontist/import/otf_style.rb
fontist-1.11.5 lib/fontist/import/otf_style.rb
fontist-1.11.3 lib/fontist/import/otf_style.rb
fontist-1.11.2 lib/fontist/import/otf_style.rb
fontist-1.11.1 lib/fontist/import/otf_style.rb
fontist-1.10.1 lib/fontist/import/otf_style.rb
fontist-1.10.0 lib/fontist/import/otf_style.rb