Latest 1.1.0
Homepage https://github.com/aderussell/string-to-CGPathRef
License MIT
Platforms ios 6.0, requires ARC
Frameworks Foundation, CoreText
Authors

A category for UIBezierPath that add methods which will create a path for a specified NSAttributedString.
For use with iOS 6 and later.

Installing the project

pod 'ARCGPathFromString'

Creating a path from an NSString

You can create paths for single line NSStrings by specifying the font to use.

+ (UIBezierPath *)pathForString:(NSString *)string withFont:(UIFont *)font

The multi line method also requires the text alignment (can be left, right, center, or justified) and a maximum width for each line of text.

+ (UIBezierPath *)pathForMultilineString:(NSString *)string withFont:(UIFont *)font maxWidth:(CGFloat)maxWidth textAlignment:(NSTextAlignment)alignment

Creating a path from an NSAttributedString

You can also create paths for single line NSAttributedStrings

+ (UIBezierPath *)pathForAttributedString:(NSAttributedString *)string

The multi line method also requires a maximum width for each line of text.

+ (UIBezierPath *)pathForMultilineAttributedString:(NSAttributedString *)string maxWidth:(CGFloat)maxWidth

License

ARCGPathFromString is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ARCGPathFromString",
    "version": "1.1.0",
    "summary": "Takes in an NSString or NSAttributedString and creates a CGPathRef for that string.",
    "description": "This CocoaPod provides methods for creating CGPaths from NSStrings and NSAttributedStrings. A category for UIBezierPath also allows UIBezierPaths to be produced from strings.",
    "homepage": "https://github.com/aderussell/string-to-CGPathRef",
    "license": "MIT",
    "authors": {
        "aderussell": "[email protected]"
    },
    "social_media_url": "https://twitter.com/ade177",
    "source": {
        "git": "https://github.com/aderussell/string-to-CGPathRef.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "6.0"
    },
    "requires_arc": true,
    "source_files": "ARCGPathFromString/*",
    "frameworks": [
        "Foundation",
        "CoreText"
    ]
}

Pin It on Pinterest

Share This