To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / .svn / pristine / 66 / 6653bba19b2648bf78a9587cfaa0d1c40a201319.svn-base @ 1297:0a574315af3e

History | View | Annotate | Download (1.43 KB)

1
To embed TrueType fonts (.TTF) files, you need to extract the font metrics and 
2
build the required tables using the provided utility (/fonts/ttf2ufm). 
3

    
4
TTF2UFM is a modified version of Mark Heath's TTF 2 PT1 converter 
5
(http://ttf2pt1.sourceforge.net/) by Steven Wittens <steven@acko.net> 
6
(http://www.acko.net/blog/ufpdf). ttf2ufm, is included in /ttf2ufm-src. 
7
The /fonts/ttf2ufm folder contains a compiled Windows binary. 
8
TTF 2 UFM is identical to TTF 2 PT1 except that it also generates a .ufm file 
9
for usage with makefontuni.php or makefontuni.rb.
10

    
11

    
12
Setting up a Truetype font for usage with UFPDF:
13
  1) Generate the font's .ufm metrics file by processing it with the provided 
14
      ttf2ufm program (modified ttf2pt1). For example:
15
      $ ttf2ufm -a -F myfont.ttf
16
  
17
  2) Run makefontuni_ruby.php with the .ttf and .ufm filenames as argument:
18
      $ php -q makefontuni_ruby.php myfont.ttf myfont.ufm
19
  
20
  3) Copy the resulting .rb, .z and .ctg.z file to the TCPDF font directory.
21
  
22
  4) Rename php font files variations for bold and italic using the following schema:
23
    	[basic-font-name]b.rb for bold variation
24
    	[basic-font-name]i.rb for oblique variation
25
    	[basic-font-name]bi.rb for bold oblique variation
26
  	
27
  5) Rename the name of the font in the first line of each .rb file:
28
      TCPDFFontDescriptor.define('dtlargotitalic') do |font|
29
     becomes:
30
      TCPDFFontDescriptor.define('dtlargoti') do |font|