Sha256: 48dc4fd731459cb6bd986d2c3fd7fd878f91881b0fc7f702ba9765cc67232982

Contents?: true

Size: 597 Bytes

Versions: 4

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

require_relative 'subset/unicode'
require_relative 'subset/unicode_8bit'
require_relative 'subset/mac_roman'
require_relative 'subset/windows_1252'

module TTFunk
  module Subset
    def self.for(original, encoding)
      case encoding.to_sym
      when :unicode      then Unicode.new(original)
      when :unicode_8bit then Unicode8Bit.new(original)
      when :mac_roman    then MacRoman.new(original)
      when :windows_1252 then Windows1252.new(original)
      else raise NotImplementedError, "encoding #{encoding} is not supported"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ttfunk-1.6.2.1 lib/ttfunk/subset.rb
ttfunk-1.6.2 lib/ttfunk/subset.rb
ttfunk-1.6.1 lib/ttfunk/subset.rb
ttfunk-1.6.0 lib/ttfunk/subset.rb