Skip to content

A simple font utility which re-maps characters of a font to random glyphs, such that encoded strings are legible only when the generated font is applied but vacuous otherwise.

Notifications You must be signed in to change notification settings

ciprian-dragomir/FontRemap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FontRemap

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.

Demo

The string encipherment using a re-mapped font file is demonstrated here.

Installation

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

Usage

node font-remap [options]

Typically, you would use font-remap in the following way:

  1. 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>
  1. 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>

Dependecies

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.

Notes

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.

About

A simple font utility which re-maps characters of a font to random glyphs, such that encoded strings are legible only when the generated font is applied but vacuous otherwise.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published