Upload
ryota-hayashi
View
2.647
Download
0
Embed Size (px)
Citation preview
5分で分かるTextKit
@hayashi311
文字列 Bitmap画像
文字のレンダリング
is
文字列 Bitmap画像?
1000001
A
A AA
文字 グリフ
UIFont(name: "AppleMyungjo", size: 112)
文字とグリフは1:1ではない
"fly"fly
文字列 != グリフの列
200px
250px
ABCDEF
16px
A B C3px
ABCDEFGHIJKL
文字列 レイアウト=グリフの座標
let text = "あのイーハトーヴォのすきとおった風"
あのイーハトーヴォのすきとおった風
あのイーハトーヴォのすきとおった風
あのイーハトーヴォのすきとおった風
枠のサイズ行の間隔
文字列 Bitmap画像
グリフ
フォントフォントサイズ
レイアウト(グリフの座標)
表示領域のサイズ文字の間隔改行のスタイル
String Bitmap画像
グリフ
フォントフォントサイズ
レイアウト(グリフの座標)
表示領域のサイズ文字の間隔改行のスタイル
String Bitmap画像
グリフ(NSTextStorage)NSAttributedString
レイアウト(グリフの座標)
表示領域のサイズ文字の間隔改行のスタイル
String Bitmap画像
UIFont+CGGlyph
(NSTextStorage)NSAttributedString
レイアウト(グリフの座標)
表示領域のサイズ文字の間隔改行のスタイル
String Bitmap画像
UIFont+CGGlyph
(NSTextStorage)NSAttributedString
レイアウト(グリフの座標)
NSTextContainer
String Bitmap画像
UIFont+CGGlyph
(NSTextStorage)NSAttributedString
NSLayoutManager
NSTextContainer
String Bitmap画像
Glyphの座標(NSTextStorage)
NSAttributedString
NSLayoutManager
NSTextContainer
.textStorage
.textContainers
監視
Bitmap画像Glyphの座標
NSLayoutManager
.textStorage
.textContainers
タッチイベント
.glyphIndexForPoint(point:)
.characterIndexForGlyphAtIndex()
CGPoint(100,45)
グリフのIndex
文字のIndex
UITextViewに感謝
次回:UITextViewの闇
We are hiring !