# File lib/ttfunk/table/name.rb, line 48 def self.encode(names) tag = @@subset_tag.dup @@subset_tag.succ! postscript_name = Name::String.new("#{tag}+#{names.postscript_name}", 1, 0, 0) strings = names.strings.dup strings[6] = [postscript_name] str_count = strings.inject(0) { |sum, (id, list)| sum + list.length } table = [0, str_count, 6 + 12 * str_count].pack("n*") strtable = "" strings.each do |id, list| list.each do |string| table << [string.platform_id, string.encoding_id, string.language_id, id, string.length, strtable.length].pack("n*") strtable << string end end table << strtable end
# File lib/ttfunk/table/name.rb, line 71 def postscript_name return @postscript_name if @postscript_name font_family.first || "unnamed" end