Frequently Asked Questions
The bad metrics code does not report the trailing characters metrics correctly and so ttfgen has no idea that any trailing characters exist and what the size of the trailing character might be. (This varies from font to font). PHP MUST report this correctly in order for ttfgen to render the font correctly.
<a>) tag. The text within the span will be replaced with the TTF Generated font, while retaining your original link. Example:
<a href="http://www.ttfgen.com"><span class="ttfText">Click here to visit TTFGen</span></a>
Next, please check the permissions of the font images folder. If the images can’t be created, nothing will be displayed. 755 is a good setting.
Installation Guide
We’ll do our best to try and answer any support requests. If you have a general installation problem that isn’t addressed in the FAQ, please leave your comments or questions below. Feature requests are always welcome.
- Download and Unpack the TTFGen archive onto your web server.
- For this example, we will be using (Document Root)/scripts/ttfgen/ as our path.
- Modify the two lines in the config.php to point to the correct document root path on your server.
$cache_prefix = '/path/to/your/site/images/fontcache/'; // folder must be writable $font_prefix = '/path/to/your/site/fonts/'; // points to folder containg .ttf font files
- The $cache_prefix setting points to the location where the cached images will be stored. If this folder does not exist, you must create it.
- The $font_prefix setting points to the folder containing the TTF files. For legal and security purposes, we recommend placing these files outside of your website’s document root folder. This will disable public access to the font files and prevent users from downloading your copyright protected fonts.
- Please remember to use the full server paths when specifying folder locations. Remembering that our example files our located in /scripts/ttfgen/, an example of a correct $font_prefix setting might be: /var/vhosts/domain/www/scripts/ttfgen/
- Open the jquery.ttfgen.js file and modify the default location of ttfgen.php (near the top of the file). You do not need to specify the full server path. A working example would be: /scripts/ttfgen/ttfgen.php.
src: '/scripts/ttfgen/ttfgen.php',
- Include the necessary jQuery .js files in your web files. For example:
<script src="/scripts/jquery.js" type="text/javascript"></script> <script src="/scripts/ttfgen/jquery.metadata.js" type="text/javascript"></script> <script src="/scripts/ttfgen/jquery.ttfgen.js" type="text/javascript"></script>
- The TTFGen package does not come with the main jQuery file, so you will have to download it from jQuery.com.
- Finally, reference TTFGen on your pages using jQuery’s $(document).ready function, and include the style data within your CSS file. For additional assistance, reference the included sample.html or the comments section below.
Support / Comments
We’ll do our best to try and answer any support requests. If you have a general installation problem that isn’t addressed in the FAQ, please leave your comments or questions in the Support section. Feature requests are always welcome.
