A simple font utility which facilitates the creation of auxiliary font files by re-mapping character codes to arbitrary glyphs. Pertinent strings can then be ‘enciphered’ such that they are only legible under the generated font and vacuous otherwise. This technique can be employed, for instance, to prohibit copying displayed text onto the clipboard.
The string encipherment using a re-mapped font file is demonstrated here.
git clone https://github.com/ciprian-dragomir/FontRemap.git
Then cd to the project directory
cd FontMap
and install npm package dependencies:
npm install
Finally, clone fonttools utility:
git clone https://github.com/behdad/fonttools.git
node font-remap [options]
Typically, you would use font-remap in the following way:
- Generate a new font file with a random character to glyph mapping (the mapping is also produced and saved):
node font-remap -r <original_font.ttf>
- Use the created font-mapping to encode strings whose character representation is to be concealed:
node font-remap -s 'String to encode' -m <font-map.json>
FontRemap uses fonttools, a tool written in python which extracts character tables from font files into more manageable xml files (.ttx extension), but is also able to reconstruct a true type font from the xml representation. FontRemap uses the xml structured document as an intermediate format. The fonttools package also requires python3 to run.
Due to its reliance on fonttools, FontRemap inherits all its limitations. Additionally, the FontRemap only works with font files which include cmap type 4 or 12 tables at this time.