diff --git a/README.md b/README.md index 8beb9de..f37d7fd 100644 --- a/README.md +++ b/README.md @@ -10,57 +10,114 @@ Font generator generates an extension of `UIFont` and `Font` (or custom classes) iOS required to use the **real name** of the font, this name can be different from its filename. To get the **real name**, it uses `fc-scan`. So, be sure that your `$PATH` variable contains path of `fc-scan`. + +```sh +USAGE: +swift run -c release ResgenSwift fonts [-f] --extension-output-path \ + [--static-members ] \ + [--visibility ] \ + [--extension-name ] \ + [--extension-name-ui-kit ] \ + [--extension-suffix ] \ + [--info-plist-paths ] + +ARGUMENTS: + Input files where fonts ared defined. + +OPTIONS: + -f, -F Should force generation + --static-members + Tell if it will generate static properties or methods (default: false) + --visibility + Visibility of extension and properties. Possibles values: public, private, package, internal. Default is internal (default: internal) + --extension-output-path + Path where to generate the extension. + --extension-name + Extension name. If not specified, it will generate an Font extension. (default: Font) + --extension-name-ui-kit + Extension name. If not specified, no extension will be generated. + --extension-suffix + Extension suffix. Ex: MyApp, it will generate {extensionName}+FontsMyApp.swift + --info-plist-paths + Info.plist paths (array). Will be used to update UIAppFonts content + --version Show the version. + -h, --help Show help information. +``` + **Example** ```sh -swift run -c release ResgenSwift fonts $FORCE_FLAG "./Fonts/fonts.txt" \ +swift run -c release ResgenSwift fonts -f "./Fonts/fonts.txt" \ --extension-output-path "./Fonts/Generated" \ + --static-members true \ + --visibility "public" \ --extension-name "AppFont" \ --extension-name-ui-kit "UIAppFont" \ --extension-suffix "GreatApp" \ - --static-members true \ - --info-plist-paths "./path/one/to/Info.plist ./path/two/to/Info.plist" + --info-plist-paths "./path/one/to/Info.plist ./path/two/to/Info.plist" ``` -**Parameters** - -1. `-f`: force generation -2. Font input folder, it will search for every `.ttf` and `.otf` files specified in `fonts.txt` -3. `--extension-output-path`: path where to generate generated extension -4. `--extension-name` *(optional)* : name of the class to add SwiftUI getters -5. `--extension-name-ui-kit` *(optional)* : name of the class to add UIKit getters -6. `--extension-suffix` *(optional)* : additional text which is added to the filename (ex: `AppFont+GreatApp.swift`) -7. `--static-members` *(optional)*: generate static properties or not -8. `--info-plist-paths` *(optional)*: array of `.plist`, you can specify multiple `Info.plist` for multiple targets - - ## Colors Colors generator generates colorsets in specified xcassets and an extension of `Color` (or a custom class) associated to those colorsets. If the extension name is not specified, no extension will be generated. + ```sh -swift run -c release ResgenSwift colors $FORCE_FLAG "./Colors/colors.txt" \ - --style all \ - --xcassets-path "./Colors/colors.xcassets" \ - --extension-output-path "./Colors/Generated/" \ - --extension-name "AppColor" \ - --extension-name-ui-kit "UIAppColor" \ - --extension-suffix "GreatApp" \ - --static-members true +USAGE: +swift run -c release ResgenSwift colors [-f] \ + --style