Add bin and edit workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s

This commit is contained in:
2026-09-16 13:11:16 -06:00
parent c8ac4fcae5
commit 4cee170d66
17576 changed files with 895740 additions and 2 deletions
+67
View File
@@ -0,0 +1,67 @@
# frozen_string_literal: true
require_relative 'reader'
module TTFunk
# SFNT table
class Table
include Reader
# File this table is in.
# @return [TTFunk::File]
attr_reader :file
# This table's offset from the file beginning.
# @return [Integer]
attr_reader :offset
# This table's length in byes.
# @return [Integer, nil]
attr_reader :length
# @param file [TTFunk::File]
def initialize(file)
@file = file
@offset = nil
@length = nil
info = file.directory_info(tag)
if info
@offset = info[:offset]
@length = info[:length]
parse_from(@offset) { parse! }
end
end
# Does this table exist in the file?
#
# @return [Boolean]
def exists?
!@offset.nil?
end
# Raw bytes of this table in the file.
#
# @return [String, nil]
def raw
if exists?
parse_from(offset) { io.read(length) }
end
end
# Table tag.
#
# @return [String]
def tag
self.class.name.split('::').last.downcase
end
private
def parse!
# do nothing, by default
end
end
end