OK I spent some time tonight examine how other apps group fonts into font families.
Most apps are probably either extracting the metadata from the font files or useing existing OS APIs to do that,
but once there is a font data list they need to be put into a menu/font picker so people can select them.
This would be much easier if we could access the fonts metadata tables with xTalk syntax and get the font family names, but we don't have that capability presently.
We could just group our fonts based on the individual name, but then we still need some way of knowing which words are part of the font family name and which words are style names, in order to guess the family name. We can't just assume the font's family name is the first word of a font, because some font families have 2, 3, even 4 words to their name. The solution to this problem as I see it is to iterate backwards through the words of the font name, comparing each to a list of words that are known to be used as font style-names, then eliminating them from the name until we are left with what must be the family name. With that in mind I've gone through a bunch of fonts from various foundries and prepared a list of all of the words used as font style-name 'keywords' that I could find.
This first list is the most commonly used style names:
Code: Select all
Condensed
Cond
Compressed
Compact
Extended
Extra
ExtraCondensed
Extrabold
Extralight
Extrabold
Plain
Regular
Normal
Book
Italic
Oblique
Med
Medium
Demi
Demibold
Semi
Semibold
SemiCondensed
SemiExtended
Bold
Heavy
Black
Light
Ultra
Wide
Utlra
UltraLight
Ultrawide
Expanded
SuperLight
Thin
Narrow
This next list can be considered a secondary set of less commonly used style names.
I wouldn't
strictly assume these are
NOT part of the font's family's name,
but I have seen all of these used as Font style variations on a root font family.
Some of these are font weights like the numbers for variable width fonts, others are more like characteristics of the font's graphical quality or use case (such as Dingbats, Symbols, Smallcaps etc.)
Code: Select all
Serif
Sans
San Serif
Sanserif
Standard
Std
Roman
Solid
Script
Cursive
Mono
Monospace
Fantasy
Display
Title
Caps
Capitals
Small Caps
Smallcaps
Initials
Gothic
Text
Slanted
Nackslanted
Grotesk
Outline
Line
Keyline
Inline
Hairline
Shadow
Engraved
White
Round
Rounded
Initials
Ornaments
Ornamentals
Symbols
Dingbats
Decorations
Flourishes
Massive
Grand
Pro
OldStyle
Alt
One
Two
Three
Next
A
B
C
L
XL
XXL
100 through 900 stepping 100 (Variable Width Fonts)
Even if we had syntax to get the metadata/ names tables from the fonts the way some apps obviously do, that does NOT guarantee a font family will be perfectly grouped into a family sub-menu.
Consider this screenshot from Adobe Illustrator's Font Picker Drop down menu, notice that the OTF version of the selected Helvetica variation is NOT grouped with the rest of the font, which are from an older .TTF formated version of Helvetica.
- Screenshot 2024-08-07 at 10.26.54 PM.png (100.29 KiB) Viewed 2928 times
I suppose if you wanted to, you could group Helvetica Neue together with plain old Helvetica (but I've never seen an app do that).
My point is that sorting huge lists of fonts is hard.