Skip to content

A technique for adding a stroke to text in SwiftUI

Notifications You must be signed in to change notification settings

argomod/TextStroke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Text Stroke in SwiftUI

Text Stroke is a view modifier that adds a stroke to text in SwiftUI.

Caution: Only works with a stroke width less than the thickness of the font.

All feedback welcome.

Screenshot of Text Stroke; white text that read "Text stroke example" is outlined in a 0.5 point black stroke.

Why?

SwiftUI does not have a built-in method of adding an outline to text commonly found in graphic design tools like Figma. After attempting many approaches, I've found this technique produces the most accurate results.

Credits

About

A technique for adding a stroke to text in SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages