Reglyph is a simple tool which parses an OpenType or TrueType font and outputs its Unicode coverage (i.e. the list of its supported glyphs). The output can be formatted in a ready to use regular expression.
Reglyph can be used:
- when needing to find missing glyphs in Adobe InDesign or any other rich-text editor that provides a regex-compatible search & replace function,
- for extending the supported range of a web page with the
- in any other situation where you need to know which Unicode characters are supported by a font.
Reglyph can be used in a terminal or as a Node.js module.
First you will need Node.js to be installed on your computer.
Then run the following command to install Reglyph:
$ npm install -g reglyph
To use Reglyph against a font file, simply type in a terminal:
$ reglyph path/to/font --option value
Avalaible options are:
--presetis the preset to use to format the output. If not specified, the default preset "perl-negate" is used.
--custom-presetsis the path to a custom preset file for overriding the default one. Note that the new JSON object is merged with the old one, so built-in presets will remains available until you override them.
--list-presetsoutputs the list of available presets with their descriptions. Can be used in combination with the
--versionoutputs Reglyph current version.
--helpshows Reglyph help for CLI.
Reglyph can also be used as a Node.js module with
require("reglyph"). Please read the source for more information about this.
$ reglyph path/to/font/Dashley.ttf outputs a regular expression which can be directly used in Adobe InDesign (GREP search) for finding glyphs not supported by the Dashley font:
$ reglyph path/to/font/Dashley.ttf -p html outputs the enumeration of supported hexadecimal html entities:
! " # $ % & ' ( ) * + , - . / 0 1 2 3 etc.
The MIT License (MIT)
Copyright (c) 2015 Thomas Brouard
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.