3sidedcube / cubefoundation-ios

Extensions, objects, and utilities used across newer 3SC iOS projects.
Apache License 2.0
0 stars 0 forks source link

🟢 Low: Add Support For System Font [Medium] #11

Closed BenShutt closed 1 year ago

BenShutt commented 1 year ago

TL;DR

New feature to add support for system fonts.

Summary

Previously, a TextStyle had to be constructed with:

 TextStyle(font: "Some String", ... )

now I have created a CustomFont enum which takes:

case .system
case .custom(String) // Name of the custom font

and updated the TextStyle

Notes

1) I'm not attached to any of the names, please do suggest improvements 2) It is backwards compatible atm, but wondering if this might work nice to construct TextStyles like:

TextStyle(.system, ...) // or
TextStyle("OpenSans", ...)

it would free up the property named font which I'm having to work around atm to use mappedFont (See files).