美文网首页
YYKit Prequel

YYKit Prequel

作者: 钱嘘嘘 | 来源:发表于2017-09-01 15:30 被阅读46次

一、Text Programming Guide for iOS

metrics

1. UIKit Framework

<1> Displaying Text Content in iOS

<2> Typographical Concepts

kerning, ligatures, line breaking, justification.

<3> Managing Text Fields and Text Views

用`enum`设置`UIView`的`tag`,来区分同类控件

2. Edit Text

<1> Managing the Keyboard 

-- contentInsets + scrollRectToVisible

-- superview+=kbSize.height + setContentOffset

3. Draw and Manage Text Directly

<1> Using Text Kit to Draw and Manage Text  --  Text Kit

Text Kit is a set of classes and protocols that provide high-quality typographical services which enable apps to store, lay out, and display text with all the characteristics of fine typesetting, such as kerning, ligatures, line breaking, and justification.

Text Kit handles three kinds of text attributes: character attributes, paragraph attributes, and document attributes.

i. NSTextStorage: NSAttributedString

ii. NSParagraphStyle

iii. UIFont + UIFontDescriptor + Font Features  --  should not cache font objects __ you can cache a font descriptor + the feature type identifiers and feature selector identifiers.

iv. Font Metrics

v. NSLayoutManager  --  glyph generation and glyph layout

vi. Line Fragment Rectangles

vii. Specifying Exclusion Paths

viii. Specifying Multipage and Multicolumn Layouts

<2> Lower Level Text-Handling Technologies

i. Core Text

Core Text Layout Opaque Types

Core Text Font Opaque Types  --  CTFont,CTFontDescriptor,CTFontCollection

ii. Core Graphics Text Drawing  --  so low-level

iii. Foundation-Level Regular Expressions  --  NSString + (http://userguide.icu-project.org/strings/regexp

iv. Simple Text Input  --  UIKeyInput (insert and delete characters) + UITextInputTraits + UIStringDrawing

v. Communicating with the Text Input System  --  UITextInput

vi. A Guided Tour of a UITextInput Implementation

Subclasses of UITextPosition and UITextRange + Inserting and Deleting Text

Returning and Replacing Text by Range + Maintaining Selected and Marked Text Ranges

Frequently Called UITextInput Methods + Returning Rectangles + Hit Testing

Informing the Text Input Delegate of Changes  --  (the text input system automatically assigns a delegate object to this property at runtime)

4. Input and Editing of Data

<1> Copy, Cut, and Paste Operations

UIPasteboard + UIMenuController + (UIResponder - canPerformAction:withSender:) + UIResponderStandardEditActions

you may use pasteboards to transfer data between apps using custom URL schemes instead of copy, cut, and paste commands; see Updating Your Info.plist Settings for information about this technique.

i. Named Pasteboards + Pasteboard Persistence,Owner,Items,Representations and UTIs

system pasteboards + app pasteboards

UIPasteboardNameGeneral + UIPasteboardNameFind

ii. Copying and Cutting the Selection

UIResponderStandardEditActions

binary data + more other representations + pasteboard object + UTI + setData:forPasteboardType: + if cut data model

iii. Pasting the Selection

pasteboard object + containsPasteboardTypes: + dataForPasteboardType: + data model + Display

<2> Displaying and Managing the Edit Menu

i. Managing the Selection and the Edit Menu

global + setTargetRect:inView: + setMenuVisible:animated:

canPerformAction:withSender:  --  Conditionally enabling menu

ii. Adding Custom Items to the Edit Menu

UIMenuItem

<3> Custom Views for Data Input  --  keyboard

i. Input Views and Input Accessory Views

UIResponder - inputView + inputAccessoryView

ii. Playing Input Clicks

UIInputViewAudioFeedback + playInputClick



二、Core Text Programming Guide

1. Core Text Lays Out Text

<1> Core Text Overview

you must have a Quartz graphic context to render Core Text–generated glyphs

i. Core Text Opaque Types

ii. Font Objects  --  CTFontRef

iii. Font Descriptors  --  CTFontDescriptor

iv. Font Collections  --  CTFontCollection

<2> Common Text Layout Operations

i. Laying Out a Paragraph  --  create and initialize the context, path, and string - CTFramesetterRef + CTFrameRef

ii. Simple Text Label

CFDictionaryRef -> CFAttributedStringRef -> CTLineRef

iii. Columnar Layout

createColumnsWithColumnCount (columnPathsArr) + CTFrameDraw

iv. Manual Line Breaking

CTTypesetterRef + CTLineRef + CTLineGetPenOffsetForFlush(center a line)

v. Applying a Paragraph Style

CTParagraphStyleSetting + CTParagraphStyleRef

vi. Displaying Text in a Non-rectangular Region

2. Manage Fonts With Core Text

<1> Common Font Operations

i. Creating Font Descriptors + ii. Creating a Font from a Font Descriptor + iii. Creating Related Fonts

iv. Serializing a Font + v. Creating a Font from Serialized Data + vi. Changing Kerning

vii. Getting Glyphs for Characters

相关文章

  • YYKit Prequel

    一、Text Programming Guide for iOS 1. UIKit Framework <1>Di...

  • ZOOTOPIA Prequel

    By Adela and Ada Once upon a time there was a little fair...

  • 项目用pod 更新 pod报错 Error installing

    Installing YYKit (1.0.9) [!] Error installing YYKit [!] /...

  • YYKit 源码解析

    最近看了YYKit的代码集合,先看下ibireme大神(郭曜源)自己的介绍: YYKit 详细介绍 YYKit 是...

  • YYText 富文本操作

    实现样式 YYKit 传送门[https://github.com/ibireme/YYKit] 头文件

  • 浅析YYKit(base 篇)之头文件解析 1

    yykit 是最近一个很火的开源框架,今天来研究看看yykit源码和一些原理,刚拿到yykit还是 很惊讶,来看看...

  • 一组功能丰富的iOS组件:YYKit

    项目地址:https://github.com/ibireme/YYKit 中文介绍 YYKit 是一组庞大、功能...

  • YYKit

    揭秘 YYModel 的魔法(上)揭秘 YYModel 的魔法(下)YYCache 设计思路YYCache 源码解...

  • YYKit

    YYWebImage:1、相比SDWebImage播放gif图片时内存占用大大降低。SDWebImage中对gif...

  • YYKit

    1.郭耀源博客 2.郭耀源微博 2.专访YYKit作者郭曜源:开源大牛是怎样炼成的 4.YYText文档

网友评论

      本文标题:YYKit Prequel

      本文链接:https://www.haomeiwen.com/subject/bahedxtx.html