UIBezierPath+YYAdd.h 960 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // UIBezierPath+YYAdd.h
  3. // YYKit <https://github.com/ibireme/YYKit>
  4. //
  5. // Created by ibireme on 14/10/30.
  6. // Copyright (c) 2015 ibireme.
  7. //
  8. // This source code is licensed under the MIT-style license found in the
  9. // LICENSE file in the root directory of this source tree.
  10. //
  11. #import <UIKit/UIKit.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. Provides extensions for `UIBezierPath`.
  15. */
  16. @interface UIBezierPath (YYAdd)
  17. /**
  18. Creates and returns a new UIBezierPath object initialized with the text glyphs
  19. generated from the specified font.
  20. @discussion It doesnot support apple emoji. If you want get emoji image, try
  21. [UIImage imageWithEmoji:size:] in `UIImage(YYAdd)`.
  22. @param text The text to generate glyph path.
  23. @param font The font to generate glyph path.
  24. @return A new path object with the text and font, or nil if an error occurs.
  25. */
  26. + (nullable UIBezierPath *)bezierPathWithText:(NSString *)text font:(UIFont *)font;
  27. @end
  28. NS_ASSUME_NONNULL_END