text: //
  //  NSString+LabelWidthAndHeight.h
  //  MyFramework
  //
  //  Created by 张发政 on 2017/1/12.
  //  Copyright © 2017年 zhangfazheng. All rights reserved.
  //
  
  #import <Foundation/Foundation.h>
  #import <UIKit/UIKit.h>
  
  /*计算相应字体样式的字符串的宽和高**/
  @interface NSString (LabelWidthAndHeight)
  /**
   *  Get the string's height with the fixed width.
   *
   *  @param attribute String's attribute, eg. attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:18.f]}
   *  @param width     Fixed width.
   *
   *  @return String's height.
   */
  - (CGFloat)heightWithStringAttribute:(NSDictionary <NSString *, id> *)attribute fixedWidth:(CGFloat)width;
  
  /**
   *  Get the string's width.
   *
   *  @param attribute String's attribute, eg. attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:18.f]}
   *
   *  @return String's width.
   */
  - (CGFloat)widthWithStringAttribute:(NSDictionary <NSString *, id> *)attribute;
  
  /**
   *  Get a line of text height.
   *
   *  @param attribute String's attribute, eg. attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:18.f]}
   *
   *  @return String's width.
   */
  + (CGFloat)oneLineOfTextHeightWithStringAttribute:(NSDictionary <NSString *, id> *)attribute;
  
  #pragma mark - Font.
  
  /**
   *  Get the string's height with the fixed width.
   *
   *  @param font  String's font.
   *  @param width Fixed width.
   *
   *  @return String's height.
   */
  - (CGFloat)heightWithStringFont:(UIFont *)font fixedWidth:(CGFloat)width;
  
  /**
   *  Get the string's width.
   *
   *  @param font  String's font.
   *
   *  @return String's width.
   */
  - (CGFloat)widthWithStringFont:(UIFont *)font;
  
  /**
   *  Get a line of text height.
   *
   *  @param font  String's font.
   *
   *  @return String's width.
   */
  + (CGFloat)oneLineOfTextHeightWithStringFont:(UIFont *)font;
  @end
  