This article was published over a year ago, so please be aware that some content may be out of date.

Friday, February 11, 2022 12:41 PM

List All Glyph Names For A Font In Swift

This code snippet will show you how to print a list of all the glphys in a particular font using Swift.

Swift
List All Glyph Names For A Font In Swift

In Swift, you can get a complete list of all the available glyphs for a given font by printing the name for each glyph:

let font = CGFont("Helvetica" as CFString)!
	
for i in 0..<font.numberOfGlyphs {
	print(font.name(for: CGGlyph(i))!)
}
Thank you for reading this article.
I hope you learned something useful.
If you've made it this far, you might like to follow me on Twitter where I post similar content and connect with like-minded people.
Follow me on Twitter
Laravel
Different Ways To Pass Data To A Laravel View
Different Ways To Pass Data To A Laravel View

Laravel views allow you to pass data to a view in a number of different ways. In this article, I'll go over four methods and describe the pros and cons for each one.

Read this article
Apple
Ten Tips For Mac Beginners
Ten Tips For Mac Beginners

Apple makes some of the most intuitive software around, but if you're coming from another platform, your first Mac experience can be quite confusing. In this article I'll go through some tips and tricks I wish I'd known when I first started using a Mac way back in 2004.

Read this article
Privacy Policy
Copyright © 2023 Carl Cassar. All Rights Reserved.