File: format25.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 (23 lines) | stat: -rw-r--r-- 443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'ttfunk/table/post/format10'
require 'stringio'

module TTFunk
  class Table
    class Post
      module Format25
        include Format10

        def glyph_for(code)
          POSTSCRIPT_GLYPHS[code + @offsets[code]] || ".notdef"
        end

        private

          def parse_format!
            number_of_glyphs = read(2, 'n').first
            @offsets = read(@number_of_glyphs, "c*")
          end
      end
    end
  end
end