Licitator 1.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.8 KiB

5 years ago
  1. <?php
  2. namespace Prometeo\CommandsBundle\ManualTraits;
  3. use PhpOffice\PhpWord\Style\Font;
  4. trait StylesTrait
  5. {
  6. public function createDefaultFonts(&$phpword){
  7. $fonts=[];
  8. $chapter= new Font();
  9. $chapter->setBold(true);
  10. $chapter->setName('Century Gothic');
  11. $chapter->setSize(24);
  12. $portada= new Font();
  13. $portada->setBold(true);
  14. $portada->setName('Century Gothic');
  15. $portada->setSize(18);
  16. $second= new Font();
  17. $second->setBold(true);
  18. $second->setName('Century Gothic');
  19. $second->setSize(12);
  20. $paragraph= new Font();
  21. $paragraph->setBold(true);
  22. $paragraph->setName('Verdana');
  23. $paragraph->setSize(10);
  24. $footerportada=new Font();
  25. $footerportada->setBold(true);
  26. $footerportada->setName('Verdana');
  27. $footerportada->setSize(7);
  28. $footerportada->setColor('#808080');
  29. $footer=new Font();
  30. $footer->setBold(true);
  31. $footer->setName('Verdana');
  32. $footer->setSize(6);
  33. $footer->setColor('#9900ff');
  34. $header=new Font();
  35. $header->setBold(true);
  36. $header->setName('Tahoma');
  37. $header->setSize(7);
  38. $header->setColor('#F5F5F5');
  39. $fonts['chapter']=$chapter;
  40. $fonts['second']=$second;
  41. $fonts['paragraph']=$paragraph;
  42. $fonts['footer']=$footer;
  43. $fonts['footerportada']=$footerportada;
  44. $fonts['header']=$header;
  45. $fonts['portada']=$portada;
  46. $this->fonts=$fonts;
  47. $phpword->addFontStyle('font_h1', array('name'=>'Century Gothic', 'size'=>24, 'color'=>'990000'));
  48. $phpword->addFontStyle('font_h2', array('name'=>'Century Gothic', 'size'=>12, 'color'=>'990000'));
  49. $phpword->addTitleStyle(1, "font_h1"); //h1
  50. $phpword->addTitleStyle(2, "font_h2"); //h2
  51. }
  52. }