font discovery
1.0.0Find system font files matching a font spec.
About Font-Discovery
This is a library to find system font files. It works on systems with DirectWrite (Windows), CoreText (macOS, iOS), and FontConfig (Linux, BSD). It does not have any foreign dependencies that aren't already directly available on the system.
How To
You can list all fonts by using list-fonts
, or find a specific font using find-font
. Both of these functions take a number of arguments to query for fonts with specific properties (family
, slant
, weight
, spacing
, stretch
). Both of them return font
instances, from which you can query the precise properties, as well as their font file location with file
.
System Information
Definition Index
-
ORG.SHIRAKUMO.FONT-DISCOVERY
No documentation provided.-
EXTERNAL CLASS FONT
-
EXTERNAL FUNCTION DEINIT
Uninitializes the library. This will shut down foreign libraries and deallocate cache memory. Returns T if it did so. It will not close the foreign libraries that were opened by INIT. It is safe to call this function multiple times. See INIT
-
EXTERNAL FUNCTION FIND-FONT
- &REST
- ARGS
- &KEY
- FAMILY
- SLANT
- WEIGHT
- SPACING
- STRETCH
Attempts to find a font with specifications that match the query as close as possible. Returns a FONT instance, or NIL if no match can be found. Note that on some systems the returned font may not be an exact match, but rather a closest approximation. For the possible values of the arguments, see the FONT class and its reader functions. Doing this will automatically call INIT. See LIST-FONTS See INIT See FONT
-
EXTERNAL FUNCTION INIT
-
EXTERNAL FUNCTION LIST-FONTS
- &REST
- ARGS
- &KEY
- FAMILY
- SLANT
- WEIGHT
- SPACING
- STRETCH
-
EXTERNAL FUNCTION REFRESH
Refreshes the font cache. This should cause new system fonts to be recognised. You should call this function whenever you think the list of system fonts might have changed. Returns T if the cache was updated. Doing this will automatically call INIT. See INIT
-
EXTERNAL GENERIC-FUNCTION FAMILY
- OBJECT
Returns the font family name. See FONT
-
EXTERNAL GENERIC-FUNCTION FILE
- OBJECT
Returns the pathname to the font file. This may be a TTF or OTF file. See FONT
-
EXTERNAL GENERIC-FUNCTION SLANT
- OBJECT
Returns the slant of the font. This may be one of the following keywords, in order of increasing slant, or a system-dependent numeric value for the font's slant. :ROMAN :ITALIC :OBLIQUE See FONT
-
EXTERNAL GENERIC-FUNCTION SPACING
- OBJECT
Returns the font's spacing. This may be one of the following keywords, in order of increasing spacing, or a system-dependent numeric value for the font's spacing. :PROPORTIONAL :DUALSPACE :MONOSPACE :CHARCELL See FONT
-
EXTERNAL GENERIC-FUNCTION STRETCH
- OBJECT
Returns the font's stretch factor. This may be one of the following keywords, in order of increasing stretch factor, or a system-dependent numeric value for the font's stretch factor. :ULTRA-CONDENSED :EXTRA-CONDENSED :CONDENSED :SEMI-CONDENSED :NORMAL :SEMI-EXPANDED :EXPANDED :EXTRA-EXPANDED :ULTRA-EXPANDED See FONT
-
EXTERNAL GENERIC-FUNCTION WEIGHT
- OBJECT
Returns the weight of the font. This may be one of the following keywords, in order of increasing weight, or a system-dependent numeric value for the font's weight. :THIN :EXTRA-LIGHT :LIGHT :SEMI-LIGHT :BOOK :REGULAR :MEDIUM :SEMI-BOLD :BOLD :EXTRA-BOLD :BLACK :EXTRA-BLACK See FONT
-