All Projects → SYLuffy → FOTextLayout

SYLuffy / FOTextLayout

Licence: MIT license
实现文字横竖向切换,实现各种文字的排版,可以某种程度上替代UILabel。

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to FOTextLayout

Stacklabel
🔥空祖家的堆叠标签(以下碎念:一开始起名字“StackLabel”没想太多结果被人吐槽Stack是整齐堆叠的意思...........好吧这是我的锅不过现在要改也来不及了,好用就行了...吧?
Stars: ✭ 471 (+1208.33%)
Mutual labels:  label, textview
Tyattributedlabel
TYAttributedLabel 简单,强大的属性文本控件(无需了解CoreText),支持图文混排显示,支持添加链接,image和UIView控件,支持自定义排版显示
Stars: ✭ 2,875 (+7886.11%)
Mutual labels:  label, coretext
Tytext
text asynchronous rendering by TextKit for iOS
Stars: ✭ 127 (+252.78%)
Mutual labels:  label, textview
Attributedstring
基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
Stars: ✭ 294 (+716.67%)
Mutual labels:  label, textview
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+338.89%)
Mutual labels:  label, textview
vertical-timeline
Responsive, jQuery-based vertical timeline generator
Stars: ✭ 75 (+108.33%)
Mutual labels:  vertical
Android-SGTextView
同时带字体描边 渐变 阴影的TextView - both have stroker, gradient and shadow TextView
Stars: ✭ 18 (-50%)
Mutual labels:  textview
LicenseTextView
Custom Lincese TextView for android
Stars: ✭ 31 (-13.89%)
Mutual labels:  textview
Hyena
鬣狗快速开发库(2018年6月停止维护)
Stars: ✭ 21 (-41.67%)
Mutual labels:  textview
label-actions
🤖 GitHub Action that performs certain tasks when issues, pull requests or discussions are labeled or unlabeled
Stars: ✭ 60 (+66.67%)
Mutual labels:  label
EasyMoney-Widgets
The widgets (EditText and TextView) for support of money requirements like currency, number formatting, comma formatting etc.
Stars: ✭ 91 (+152.78%)
Mutual labels:  textview
CheckableTextView
A simple and flexible Checked TextView or Checkable TextView
Stars: ✭ 108 (+200%)
Mutual labels:  textview
action-release-label
🏷️ GitHub Action to output a semver update level from a pull request release label
Stars: ✭ 41 (+13.89%)
Mutual labels:  label
embedded-text
Multiline TextBox for the embedded-graphics Rust crate
Stars: ✭ 35 (-2.78%)
Mutual labels:  textview
TextViewPlus
an android library for setting custom font in xml layout
Stars: ✭ 27 (-25%)
Mutual labels:  textview
dependent-issues
📦 A GitHub Action for marking issues as dependent on another
Stars: ✭ 83 (+130.56%)
Mutual labels:  label
hat-view
Allow to put "hat" on TextView. Inspired by Telegram appbar title with Santa Claus hat 🎅🏻
Stars: ✭ 51 (+41.67%)
Mutual labels:  textview
STTextView
📝 STTextView is a light-weight library that adds a placeholder to the UITextView.
Stars: ✭ 36 (+0%)
Mutual labels:  textview
KodeEditor
A simple code editor with syntax highlighting and pinch to zoom
Stars: ✭ 60 (+66.67%)
Mutual labels:  textview
Socially
Socially is a textView which is able to create separate clickable views according to your requirements.
Stars: ✭ 28 (-22.22%)
Mutual labels:  textview

FOTextLayout

实现文字的竖向排列(已区分中英文的竖向方向)。 实现各种文字的排版。 支持 NSAttributedStringKey 大部分的富文本属性,比如:字间距,行间距等。 这个项目本人会长期维护,也欢迎大家积极提issues。

动图展示

image

安装

使用cocoapods的方式

 pod 'FOTextLayout', '~> 0.0.1'

也可以把demo工程里面的 FOText文件夹 拖到你的工程里面。

使用方法

你可以直接使用文件夹里的FOTextView这个控件,利用富文本,构造好一个NSAttributedString对象传入进去就行了。

代码如下:

    self.boundView = [[FOTextView alloc] init];
    
    //直接使用富文本构造你的 文本信息。颜色,字间距,行间距等
    NSAttributedString *string1 = [[NSAttributedString alloc] initWithString:@"asdasqwecx12ok东皋嘉雨新痕涨,沙觜鹭来鸥聚。\n堪爱处最好是、一川夜月光流渚。"];
    NSAttributedString* result = [self buildAttrString:string1.string withFont:@"Copperplate-Light" fontSize:13
                                             lineSpace:2 kern:self.kern fontColor:[UIColor blackColor] delLine:NO];

    [self.boundView setAttString:result];
    [self.view addSubview:self.boundView];

设置横竖向排版

    //是否竖向排列
    self.boundView.isVertical = NO;

设置文字排列方向

typedef NS_ENUM(NSInteger,FOTextAlignment) {
    FOTextAlignmentLeft,
    FOTextAlignmentCenter,
    FOTextAlignmentRight
};

[self.boundView setTextAlignment:FOTextAlignmentLeft];

在你实际的使用中,你可以对FOTextView进行自定义。

参考项目

此文字排版库,参考了YYText里关于文字排版的部分代码,特别感谢YYText的作者 YYText

License

MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].