No Description

FontTable.php 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. * @link https://github.com/PHPOffice/PHPWord
  14. * @copyright 2010-2014 PHPWord contributors
  15. * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
  16. */
  17. namespace PhpOffice\PhpWord\Writer\Word2007\Part;
  18. /**
  19. * Word2007 font table writer: word/fontTable.xml
  20. *
  21. * @todo Generate content dynamically
  22. * @since 0.10.0
  23. */
  24. class FontTable extends AbstractPart
  25. {
  26. /**
  27. * Write fontTable.xml.
  28. *
  29. * @return string
  30. */
  31. public function write()
  32. {
  33. $str = '';
  34. $str .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
  35. $str .= '<w:fonts ' .
  36. 'xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" ' .
  37. 'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">';
  38. $str .= '<w:font w:name="Times New Roman">';
  39. $str .= '<w:panose1 w:val="02020603050405020304" />';
  40. $str .= '<w:charset w:val="00" />';
  41. $str .= '<w:family w:val="roman" />';
  42. $str .= '<w:pitch w:val="variable" />';
  43. $str .= '<w:sig w:usb0="E0002AFF" w:usb1="C0007841" w:usb2="00000009" w:usb3="00000000" ' .
  44. 'w:csb0="000001FF" w:csb1="00000000" />';
  45. $str .= '</w:font>';
  46. $str .= '<w:font w:name="Courier New">';
  47. $str .= '<w:panose1 w:val="02070309020205020404" />';
  48. $str .= '<w:charset w:val="00" />';
  49. $str .= '<w:family w:val="modern" />';
  50. $str .= '<w:pitch w:val="fixed" />';
  51. $str .= '<w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" ' .
  52. 'w:csb0="000001FF" w:csb1="00000000" />';
  53. $str .= '</w:font>';
  54. $str .= '<w:font w:name="Wingdings">';
  55. $str .= '<w:panose1 w:val="05000000000000000000" />';
  56. $str .= '<w:charset w:val="02" />';
  57. $str .= '<w:family w:val="auto" />';
  58. $str .= '<w:pitch w:val="variable" />';
  59. $str .= '<w:sig w:usb0="00000000" w:usb1="10000000" w:usb2="00000000" w:usb3="00000000" ' .
  60. 'w:csb0="80000000" w:csb1="00000000" />';
  61. $str .= '</w:font>';
  62. $str .= '<w:font w:name="Symbol">';
  63. $str .= '<w:panose1 w:val="05050102010706020507" />';
  64. $str .= '<w:charset w:val="02" />';
  65. $str .= '<w:family w:val="roman" />';
  66. $str .= '<w:pitch w:val="variable" />';
  67. $str .= '<w:sig w:usb0="00000000" w:usb1="10000000" w:usb2="00000000" w:usb3="00000000" ' .
  68. 'w:csb0="80000000" w:csb1="00000000" />';
  69. $str .= '</w:font>';
  70. $str .= '<w:font w:name="Arial">';
  71. $str .= '<w:panose1 w:val="020B0604020202020204" />';
  72. $str .= '<w:charset w:val="00" />';
  73. $str .= '<w:family w:val="swiss" />';
  74. $str .= '<w:pitch w:val="variable" />';
  75. $str .= '<w:sig w:usb0="E0002AFF" w:usb1="C0007843" w:usb2="00000009" w:usb3="00000000" ' .
  76. 'w:csb0="000001FF" w:csb1="00000000" />';
  77. $str .= '</w:font>';
  78. $str .= '<w:font w:name="Cambria">';
  79. $str .= '<w:panose1 w:val="02040503050406030204" />';
  80. $str .= '<w:charset w:val="00" />';
  81. $str .= '<w:family w:val="roman" />';
  82. $str .= '<w:pitch w:val="variable" />';
  83. $str .= '<w:sig w:usb0="A00002EF" w:usb1="4000004B" w:usb2="00000000" w:usb3="00000000" ' .
  84. 'w:csb0="0000019F" w:csb1="00000000" />';
  85. $str .= '</w:font>';
  86. $str .= '<w:font w:name="Calibri">';
  87. $str .= '<w:panose1 w:val="020F0502020204030204" />';
  88. $str .= '<w:charset w:val="00" />';
  89. $str .= '<w:family w:val="swiss" />';
  90. $str .= '<w:pitch w:val="variable" />';
  91. $str .= '<w:sig w:usb0="E10002FF" w:usb1="4000ACFF" w:usb2="00000009" w:usb3="00000000" ' .
  92. 'w:csb0="0000019F" w:csb1="00000000" />';
  93. $str .= '</w:font>';
  94. $str .= '</w:fonts>';
  95. return $str;
  96. }
  97. }