目前还只会用NSMutableAttributedString计算固定宽度的内容size,如下:
1、根据内容初始化
NSMutableAttributedString *attrContent = [NSMutableAttributedString attributedStringWithString:text];
2、设置自体
[attrContent setFont:[UIFont systemFontOfSize:customFontSize]];
3、计算内容的高度和宽度(这里限制了最大宽度)
CGSize msgSize = [attrContent sizeConstrainedToSize:CGSizeMake(customWidth, 999)];
待完善和补充。。。