FontNames final class
Minn\Theme\FontNames · public/minn/src/Minn/Theme/FontNames.php · 56 lines
The font library's names (probes fonts and font-writes): a font-family list as a family stores it, the identity a face is stored under (its title, which the duplicate check compares), and the font types an upload may carry.
Constants and properties
| const | MIME_TYPES = array ( 'otf' => 'application/vnd.ms-opentype', 'ttf' => 'font/sfnt', 'woff' => 'font/woff', 'woff2' => 'font/woff2', ) | The font types an upload may carry, by extension. |
| private | STRETCH = array ( 'normal' => '100%', 'ultra-condensed' => '50%', 'extra-condensed' => '62.5%', 'condensed' => '75%', 'semi-condensed' => '87.5%', 'semi-expanded' => '112.5%', 'expanded' => '125%', 'extra-expanded' => '150%', 'ultra-expanded' => '200%', ) | Stretch keywords as percentages, replaced one after another in this order, as the reference replaces them: a keyword that holds one replaced before it keeps the rest ("semi-condensed" is "semi-75%", "ultra-expanded" is "ultra-125%"). |
Public
| static | family(mixed $fontFamily): string# | A font-family list as text, each name trimmed of spaces and quotes, then joined by ", ": a name of letters and hyphens alone as it is, any other (a space, a digit, an underscore) double-quoted. |
| static | quoted(mixed $name): string# | One name of a font-family list, double-quoted unless it is letters and hyphens alone. |
| static | faceSlug(mixed $settings): string# | A face's identity: its family list (trimmed, lower case, split at each comma and the spaces after it, each name's quotes trimmed), style (lower case), weight (lower case, normal and bold as numbers), stretch (lower case, keywords as percentages) and unicode range (upper case), joined by ";". A property left out takes its default (normal, 400, 100%, U+0-10FFFF); one given empty stays empty. |
Nothing matches.