styles.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. .. _styles:
  2. Styles
  3. ======
  4. Fill
  5. ----
  6. Use this style to define fill of a shape as example below.
  7. .. code-block:: php
  8. $shape->getFill()
  9. ->setFillType(Fill::FILL_GRADIENT_LINEAR)
  10. ->setRotation(270)
  11. ->setStartColor(new Color('FFCCCCCC'))
  12. ->setEndColor(new Color('FFFFFFFF'));
  13. Properties:
  14. - ``fillType``
  15. - ``rotation``
  16. - ``startColor``
  17. - ``endColor``
  18. Border
  19. ------
  20. Use this style to define border of a shape as example below.
  21. .. code-block:: php
  22. $shape->getBorder()
  23. ->setLineStyle(Border::LINE_SINGLE)
  24. ->setLineWidth(4)
  25. ->getColor()->setARGB('FFC00000');
  26. Properties:
  27. - ``lineWidth``
  28. - ``lineStyle``
  29. - ``dashStyle``
  30. - ``color``
  31. Shadow
  32. ------
  33. Use this style to define shadow of a shape as example below.
  34. .. code-block:: php
  35. $shape->getShadow()
  36. ->setVisible(true)
  37. ->setDirection(45)
  38. ->setDistance(10);
  39. Properties:
  40. - ``visible``
  41. - ``blurRadius``
  42. - ``distance``
  43. - ``direction``
  44. - ``alignment``
  45. - ``color``
  46. - ``alpha``
  47. Alignment
  48. ---------
  49. - ``horizontal``
  50. - ``vertical``
  51. - ``level``
  52. - ``indent``
  53. - ``marginLeft``
  54. - ``marginRight``
  55. Font
  56. ----
  57. - ``name``
  58. - ``bold``
  59. - ``italic``
  60. - ``superScript``
  61. - ``subScript``
  62. - ``underline``
  63. - ``strikethrough``
  64. - ``color``
  65. Bullet
  66. ------
  67. - ``bulletType``
  68. - ``bulletFont``
  69. - ``bulletChar``
  70. - ``bulletNumericStyle``
  71. - ``bulletNumericStartAt``
  72. Color
  73. -----
  74. Colors can be applied to different objects, e.g. font or border.
  75. .. code-block:: php
  76. $textRun = $shape->createTextRun('Text');
  77. $textRun->getFont()->setColor(new Color('C00000'));