quintanamo / HTML-Font-Monospacer

A JS script to take any text within an HTML element and set all of the letters to the same block size. I'm not sure how useful this is, but if you have any non-monospaced fonts you'd like to behave as if they were, this will do so by creating an element for each letter and setting the width to a size defined by the user.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

> to add the script to your HTML file, add '<script src="monospace.js"></script>' after the element you want to monospace OR at the end of the body element (preferred).
  
> to change the size of each letter's box, change the letterSize variable inside the script to whatever you'd like.  For example, the default is as follows:  'letterSize = "10px"'.

> if you have any questions, suggestions, or comments, feel free to email me at quintin@quintinherb.net.

About

A JS script to take any text within an HTML element and set all of the letters to the same block size. I'm not sure how useful this is, but if you have any non-monospaced fonts you'd like to behave as if they were, this will do so by creating an element for each letter and setting the width to a size defined by the user.


Languages

Language:JavaScript 100.0%