Adding input file with font to generate (iso with colors) + adding an optional extension suffix on font extension
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
// Lato/Lato-Italic.ttf Lato/Lato-LightItalic.ttf Lato/Lato-Thin.ttf Lato/Lato-Bold.ttf Lato/Lato-Black.ttf Lato/Lato-Regular.ttf Lato/Lato-BlackItalic.ttf Lato/Lato-BoldItalic.ttf Lato/Lato-Light.ttf Lato/Lato-ThinItalic.ttf
|
||||
// Generated from FontToolCore
|
||||
|
||||
import UIKit
|
||||
|
62
SampleFiles/Fonts/Generated/R2Font+FontGenAllScript.swift
Normal file
62
SampleFiles/Fonts/Generated/R2Font+FontGenAllScript.swift
Normal file
@ -0,0 +1,62 @@
|
||||
// Generated from FontToolCore
|
||||
|
||||
import UIKit
|
||||
|
||||
extension R2Font {
|
||||
|
||||
enum FontName: String {
|
||||
case LatoItalic = "Lato-Italic"
|
||||
case LatoLightItalic = "Lato-LightItalic"
|
||||
case LatoHairline = "Lato-Hairline"
|
||||
case LatoBold = "Lato-Bold"
|
||||
case LatoBlack = "Lato-Black"
|
||||
case LatoRegular = "Lato-Regular"
|
||||
case LatoBlackItalic = "Lato-BlackItalic"
|
||||
case LatoBoldItalic = "Lato-BoldItalic"
|
||||
case LatoLight = "Lato-Light"
|
||||
case LatoHairlineItalic = "Lato-HairlineItalic"
|
||||
}
|
||||
|
||||
// MARK: - Getter
|
||||
|
||||
func LatoItalic(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoItalic.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoLightItalic(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoLightItalic.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoHairline(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoHairline.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoBold(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoBold.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoBlack(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoBlack.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoRegular(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoRegular.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoBlackItalic(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoBlackItalic.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoBoldItalic(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoBoldItalic.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoLight(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoLight.rawValue, size: size)!
|
||||
}
|
||||
|
||||
func LatoHairlineItalic(withSize size: CGFloat) -> UIFont {
|
||||
UIFont(name: FontName.LatoHairlineItalic.rawValue, size: size)!
|
||||
}
|
||||
|
||||
}
|
10
SampleFiles/Fonts/sampleFontsAll.txt
Normal file
10
SampleFiles/Fonts/sampleFontsAll.txt
Normal file
@ -0,0 +1,10 @@
|
||||
Lato-Black
|
||||
Lato-BlackItalic
|
||||
Lato-Bold
|
||||
Lato-BoldItalic
|
||||
Lato-Italic
|
||||
Lato-Light
|
||||
Lato-LightItalic
|
||||
Lato-Regular
|
||||
Lato-Thin
|
||||
Lato-ThinItalic
|
3
SampleFiles/Fonts/sampleFontsSpecific.txt
Normal file
3
SampleFiles/Fonts/sampleFontsSpecific.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Lato-Black
|
||||
Lato-Bold
|
||||
Lato-Regular
|
@ -1,7 +1,15 @@
|
||||
#/bin/bash
|
||||
|
||||
# Font
|
||||
swift run -c release FontToolCore ./Fonts --extension-output-path ./Fonts/Generated --extension-name R2Font
|
||||
swift run -c release FontToolCore "./Fonts/sampleFontsAll.txt" \
|
||||
--extension-output-path "./Fonts/Generated" \
|
||||
--extension-name "R2Font" \
|
||||
--extension-suffix "GenAllScript"
|
||||
|
||||
# Color
|
||||
swift run -c release ColorToolCore ./Colors/sampleColors1.txt --style all --xcassets-path "./Colors/colors.xcassets" --extension-output-path "./Colors/Generated/" --extension-name "UIColor" --extension-suffix "GenAllScript"
|
||||
swift run -c release ColorToolCore "./Colors/sampleColors1.txt" \
|
||||
--style all \
|
||||
--xcassets-path "./Colors/colors.xcassets" \
|
||||
--extension-output-path "./Colors/Generated/" \
|
||||
--extension-name "UIColor" \
|
||||
--extension-suffix "GenAllScript"
|
||||
|
Reference in New Issue
Block a user