Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
71 / 71 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
FontTable | |
100.00% |
71 / 71 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
write | |
100.00% |
71 / 71 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * This file is part of PHPWord - A pure PHP library for reading and writing |
4 | * word processing documents. |
5 | * |
6 | * PHPWord is free software distributed under the terms of the GNU Lesser |
7 | * General Public License version 3 as published by the Free Software Foundation. |
8 | * |
9 | * For the full copyright and license information, please read the LICENSE |
10 | * file that was distributed with this source code. For the full list of |
11 | * contributors, visit https://github.com/PHPOffice/PHPWord/contributors. |
12 | * |
13 | * @see https://github.com/PHPOffice/PHPWord |
14 | * |
15 | * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 |
16 | */ |
17 | |
18 | namespace PhpOffice\PhpWord\Writer\Word2007\Part; |
19 | |
20 | /** |
21 | * Word2007 font table writer: word/fontTable.xml. |
22 | * |
23 | * @todo Generate content dynamically |
24 | * |
25 | * @since 0.10.0 |
26 | */ |
27 | class FontTable extends AbstractPart |
28 | { |
29 | /** |
30 | * Write fontTable.xml. |
31 | * |
32 | * @return string |
33 | */ |
34 | public function write() |
35 | { |
36 | $str = ''; |
37 | $str .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'; |
38 | $str .= '<w:fonts ' . |
39 | 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" ' . |
40 | 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">'; |
41 | |
42 | $str .= '<w:font w:name="Times New Roman">'; |
43 | $str .= '<w:panose1 w:val="02020603050405020304" />'; |
44 | $str .= '<w:charset w:val="00" />'; |
45 | $str .= '<w:family w:val="roman" />'; |
46 | $str .= '<w:pitch w:val="variable" />'; |
47 | $str .= '<w:sig w:usb0="E0002AFF" w:usb1="C0007841" w:usb2="00000009" w:usb3="00000000" ' . |
48 | 'w:csb0="000001FF" w:csb1="00000000" />'; |
49 | $str .= '</w:font>'; |
50 | |
51 | $str .= '<w:font w:name="Courier New">'; |
52 | $str .= '<w:panose1 w:val="02070309020205020404" />'; |
53 | $str .= '<w:charset w:val="00" />'; |
54 | $str .= '<w:family w:val="modern" />'; |
55 | $str .= '<w:pitch w:val="fixed" />'; |
56 | $str .= '<w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" ' . |
57 | 'w:csb0="000001FF" w:csb1="00000000" />'; |
58 | $str .= '</w:font>'; |
59 | |
60 | $str .= '<w:font w:name="Wingdings">'; |
61 | $str .= '<w:panose1 w:val="05000000000000000000" />'; |
62 | $str .= '<w:charset w:val="02" />'; |
63 | $str .= '<w:family w:val="auto" />'; |
64 | $str .= '<w:pitch w:val="variable" />'; |
65 | $str .= '<w:sig w:usb0="00000000" w:usb1="10000000" w:usb2="00000000" w:usb3="00000000" ' . |
66 | 'w:csb0="80000000" w:csb1="00000000" />'; |
67 | $str .= '</w:font>'; |
68 | |
69 | $str .= '<w:font w:name="Symbol">'; |
70 | $str .= '<w:panose1 w:val="05050102010706020507" />'; |
71 | $str .= '<w:charset w:val="02" />'; |
72 | $str .= '<w:family w:val="roman" />'; |
73 | $str .= '<w:pitch w:val="variable" />'; |
74 | $str .= '<w:sig w:usb0="00000000" w:usb1="10000000" w:usb2="00000000" w:usb3="00000000" ' . |
75 | 'w:csb0="80000000" w:csb1="00000000" />'; |
76 | $str .= '</w:font>'; |
77 | |
78 | $str .= '<w:font w:name="Arial">'; |
79 | $str .= '<w:panose1 w:val="020B0604020202020204" />'; |
80 | $str .= '<w:charset w:val="00" />'; |
81 | $str .= '<w:family w:val="swiss" />'; |
82 | $str .= '<w:pitch w:val="variable" />'; |
83 | $str .= '<w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" ' . |
84 | 'w:csb0="000001FF" w:csb1="00000000" />'; |
85 | $str .= '</w:font>'; |
86 | |
87 | $str .= '<w:font w:name="Cambria">'; |
88 | $str .= '<w:panose1 w:val="02040503050406030204" />'; |
89 | $str .= '<w:charset w:val="00" />'; |
90 | $str .= '<w:family w:val="roman" />'; |
91 | $str .= '<w:pitch w:val="variable" />'; |
92 | $str .= '<w:sig w:usb0="A00002EF" w:usb1="4000004B" w:usb2="00000000" w:usb3="00000000" ' . |
93 | 'w:csb0="0000019F" w:csb1="00000000" />'; |
94 | $str .= '</w:font>'; |
95 | |
96 | $str .= '<w:font w:name="Calibri">'; |
97 | $str .= '<w:panose1 w:val="020F0502020204030204" />'; |
98 | $str .= '<w:charset w:val="00" />'; |
99 | $str .= '<w:family w:val="swiss" />'; |
100 | $str .= '<w:pitch w:val="variable" />'; |
101 | $str .= '<w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" ' . |
102 | 'w:csb0="0000019F" w:csb1="00000000" />'; |
103 | $str .= '</w:font>'; |
104 | |
105 | $str .= '<w:font w:name="Garamond">'; |
106 | $str .= '<w:panose1 w:val="02020404030301010803" />'; |
107 | $str .= '<w:charset w:val="00" />'; |
108 | $str .= '<w:family w:val="roman" />'; |
109 | $str .= '<w:pitch w:val="variable" />'; |
110 | $str .= '<w:sig w:usb0="00000287" w:usb1="00000002" w:usb2="00000000" w:usb3="00000000" ' . |
111 | 'w:csb0="0000009F" w:csb1="00000000" />'; |
112 | $str .= '</w:font>'; |
113 | |
114 | $str .= '</w:fonts>'; |
115 | |
116 | return $str; |
117 | } |
118 | } |