File: subset.rb

package info (click to toggle)
ruby-ttfunk 1.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 916 kB
  • sloc: ruby: 1,719; makefile: 16
file content (18 lines) | stat: -rw-r--r-- 568 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'ttfunk/subset/unicode'
require 'ttfunk/subset/unicode_8bit'
require 'ttfunk/subset/mac_roman'
require 'ttfunk/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