forked from dblencowe/tfpdf
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial work on refactoring the font metric code - Moved away from the archaic method of writing out PHP to a file and including it in the next run, by writing out the metrics data as JSON and reading from the file as required. - General tidying up of code and trying to make sense of the > character 127 processing, and why we're doing what we're doing. - For some reason, character widths appear to be broken for characters > 127 when reading the 127 file - when the file doesn't exist and we process on-the-fly, the widths appear to be OK. Hmmz. * A bunch of reactors and cleanup around writing and accessing the font metrics and character widths files
- Loading branch information
David Wilcock
authored
Nov 25, 2016
1 parent
feb2c18
commit b21d98a
Showing
80 changed files
with
3,789 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* test_unicode.php | ||
* | ||
* @author David Wilcock <[email protected]> | ||
* @copyright Venditan Limited 2016 | ||
*/ | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$obj_pdf = new \tFPDF\PDF(); | ||
$obj_pdf->AddPage(); | ||
$obj_pdf->AddFont('DejaVuSans', '', 'DejaVuSans.ttf', true); | ||
$obj_pdf->SetFont('DejaVuSans'); | ||
|
||
$obj_pdf->SetTextColor(0,0,0); | ||
$obj_pdf->Cell(100, 2, 'Hyggelig å møte deg'); | ||
|
||
$str_file = sys_get_temp_dir() . '/tfpdf_unicode_test.pdf'; | ||
file_put_contents($str_file, $obj_pdf->output()); | ||
|
||
echo "Written file " . $str_file . PHP_EOL; |
111 changes: 111 additions & 0 deletions
111
src/font/unifont/babelstonehan-bold-character-width-127.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?php | ||
$rangeid=32; | ||
$prevcid=126; | ||
$prevwidth=500; | ||
$interval=true; | ||
$range=array ( | ||
29 => | ||
array ( | ||
0 => 500, | ||
), | ||
32 => | ||
array ( | ||
0 => 500, | ||
1 => 500, | ||
'interval' => true, | ||
2 => 500, | ||
3 => 500, | ||
4 => 500, | ||
5 => 500, | ||
6 => 500, | ||
7 => 500, | ||
8 => 500, | ||
9 => 500, | ||
10 => 500, | ||
11 => 500, | ||
12 => 500, | ||
13 => 500, | ||
14 => 500, | ||
15 => 500, | ||
16 => 500, | ||
17 => 500, | ||
18 => 500, | ||
19 => 500, | ||
20 => 500, | ||
21 => 500, | ||
22 => 500, | ||
23 => 500, | ||
24 => 500, | ||
25 => 500, | ||
26 => 500, | ||
27 => 500, | ||
28 => 500, | ||
29 => 500, | ||
30 => 500, | ||
31 => 500, | ||
32 => 500, | ||
33 => 500, | ||
34 => 500, | ||
35 => 500, | ||
36 => 500, | ||
37 => 500, | ||
38 => 500, | ||
39 => 500, | ||
40 => 500, | ||
41 => 500, | ||
42 => 500, | ||
43 => 500, | ||
44 => 500, | ||
45 => 500, | ||
46 => 500, | ||
47 => 500, | ||
48 => 500, | ||
49 => 500, | ||
50 => 500, | ||
51 => 500, | ||
52 => 500, | ||
53 => 500, | ||
54 => 500, | ||
55 => 500, | ||
56 => 500, | ||
57 => 500, | ||
58 => 500, | ||
59 => 500, | ||
60 => 500, | ||
61 => 500, | ||
62 => 500, | ||
63 => 500, | ||
64 => 500, | ||
65 => 500, | ||
66 => 500, | ||
67 => 500, | ||
68 => 500, | ||
69 => 500, | ||
70 => 500, | ||
71 => 500, | ||
72 => 500, | ||
73 => 500, | ||
74 => 500, | ||
75 => 500, | ||
76 => 500, | ||
77 => 500, | ||
78 => 500, | ||
79 => 500, | ||
80 => 500, | ||
81 => 500, | ||
82 => 500, | ||
83 => 500, | ||
84 => 500, | ||
85 => 500, | ||
86 => 500, | ||
87 => 500, | ||
88 => 500, | ||
89 => 500, | ||
90 => 500, | ||
91 => 500, | ||
92 => 500, | ||
93 => 500, | ||
94 => 500, | ||
), | ||
); | ||
?> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
src/font/unifont/babelstonehan-bolditalic-character-width-127.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<?php | ||
$rangeid=32; | ||
$prevcid=126; | ||
$prevwidth=500; | ||
$interval=true; | ||
$range=array ( | ||
29 => | ||
array ( | ||
0 => 500, | ||
), | ||
32 => | ||
array ( | ||
0 => 500, | ||
1 => 500, | ||
'interval' => true, | ||
2 => 500, | ||
3 => 500, | ||
4 => 500, | ||
5 => 500, | ||
6 => 500, | ||
7 => 500, | ||
8 => 500, | ||
9 => 500, | ||
10 => 500, | ||
11 => 500, | ||
12 => 500, | ||
13 => 500, | ||
14 => 500, | ||
15 => 500, | ||
16 => 500, | ||
17 => 500, | ||
18 => 500, | ||
19 => 500, | ||
20 => 500, | ||
21 => 500, | ||
22 => 500, | ||
23 => 500, | ||
24 => 500, | ||
25 => 500, | ||
26 => 500, | ||
27 => 500, | ||
28 => 500, | ||
29 => 500, | ||
30 => 500, | ||
31 => 500, | ||
32 => 500, | ||
33 => 500, | ||
34 => 500, | ||
35 => 500, | ||
36 => 500, | ||
37 => 500, | ||
38 => 500, | ||
39 => 500, | ||
40 => 500, | ||
41 => 500, | ||
42 => 500, | ||
43 => 500, | ||
44 => 500, | ||
45 => 500, | ||
46 => 500, | ||
47 => 500, | ||
48 => 500, | ||
49 => 500, | ||
50 => 500, | ||
51 => 500, | ||
52 => 500, | ||
53 => 500, | ||
54 => 500, | ||
55 => 500, | ||
56 => 500, | ||
57 => 500, | ||
58 => 500, | ||
59 => 500, | ||
60 => 500, | ||
61 => 500, | ||
62 => 500, | ||
63 => 500, | ||
64 => 500, | ||
65 => 500, | ||
66 => 500, | ||
67 => 500, | ||
68 => 500, | ||
69 => 500, | ||
70 => 500, | ||
71 => 500, | ||
72 => 500, | ||
73 => 500, | ||
74 => 500, | ||
75 => 500, | ||
76 => 500, | ||
77 => 500, | ||
78 => 500, | ||
79 => 500, | ||
80 => 500, | ||
81 => 500, | ||
82 => 500, | ||
83 => 500, | ||
84 => 500, | ||
85 => 500, | ||
86 => 500, | ||
87 => 500, | ||
88 => 500, | ||
89 => 500, | ||
90 => 500, | ||
91 => 500, | ||
92 => 500, | ||
93 => 500, | ||
94 => 500, | ||
), | ||
); | ||
?> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.