CTFrame
class CTFrame
class Progression
TopToBottom, RightToLeft= 0, 1
end
def initialize
@string# 直接もっているかどうかは分からない。他のオブジェクトが持っているかも
@attr_string#
@truncate_line, @justified_line
@glyph_runs = []
end
def type_id
end
def string_range
end
def visible_string_range
end
def draw(context); end
def lines
end
def line_origins range
origins = [line[0].origin, line[1].origin, line[2].origin]
end
def path
end
def attributes
{1=>2, 3=>4}
end
end
origins = frame.line_origins range
puts origins[0].x, origins[0].y
# 枠組の行にアクセス
lines = frame.lines
line = lines[0]
line.
# パス(外形を表すパス)どんなかたちをしてるかがわかる
path = frame.path
# 文字の範囲(何文字目から何文字分の長さで)
range = frame.string_range
# 可視文字列範囲(このフレームって何文字目から何文字分が見えてるの?)
range = frame.visible_string_range
puts "このフレームでは、#{range.location}文字から、#{range.length}文字分を表示可能。"
#
frame.draw(context)
CFIndex
class CFIndex
def initialize(index)
@index = index
end
def =(value)
# integerかどうかチェック
@index = value
end
end
CFRange
class CFRange
def initialize(location=0, range=0)
@location, @length = location, range
end
attr_accessor :location, :range
def CFRange::Make(loc, len)
CFRange.new(loc, len)
end
end
最終更新:2010年06月25日 17:22