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.

XSSFFont.java 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.xssf.usermodel;
  16. import java.util.Objects;
  17. import org.apache.poi.ooxml.POIXMLException;
  18. import org.apache.poi.ss.usermodel.Font;
  19. import org.apache.poi.ss.usermodel.FontCharset;
  20. import org.apache.poi.ss.usermodel.FontFamily;
  21. import org.apache.poi.ss.usermodel.FontScheme;
  22. import org.apache.poi.ss.usermodel.FontUnderline;
  23. import org.apache.poi.ss.usermodel.IndexedColors;
  24. import org.apache.poi.util.Internal;
  25. import org.apache.poi.xssf.model.StylesTable;
  26. import org.apache.poi.xssf.model.ThemesTable;
  27. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBooleanProperty;
  28. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
  29. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont;
  30. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontName;
  31. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme;
  32. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize;
  33. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTIntProperty;
  34. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTUnderlineProperty;
  35. import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTVerticalAlignFontProperty;
  36. import org.openxmlformats.schemas.spreadsheetml.x2006.main.STFontScheme;
  37. import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
  38. import org.openxmlformats.schemas.spreadsheetml.x2006.main.STVerticalAlignRun;
  39. /**
  40. * Represents a font used in a workbook.
  41. *
  42. * @author Gisella Bronzetti
  43. */
  44. public class XSSFFont implements Font {
  45. /**
  46. * By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11
  47. */
  48. public static final String DEFAULT_FONT_NAME = "Calibri";
  49. /**
  50. * By default, Microsoft Office Excel 2007 uses the Calibri font in font size 11
  51. */
  52. public static final short DEFAULT_FONT_SIZE = 11;
  53. /**
  54. * Default font color is black
  55. * @see org.apache.poi.ss.usermodel.IndexedColors#BLACK
  56. */
  57. public static final short DEFAULT_FONT_COLOR = IndexedColors.BLACK.getIndex();
  58. private IndexedColorMap _indexedColorMap;
  59. private ThemesTable _themes;
  60. private CTFont _ctFont;
  61. private int _index;
  62. /**
  63. * Create a new XSSFFont
  64. *
  65. * @param font the underlying CTFont bean
  66. */
  67. @Internal
  68. public XSSFFont(CTFont font) {
  69. _ctFont = font;
  70. _index = 0;
  71. }
  72. /**
  73. * Called from parsing styles.xml
  74. * @param font CTFont
  75. * @param index font index
  76. * @param colorMap for default or custom indexed colors
  77. */
  78. @Internal
  79. public XSSFFont(CTFont font, int index, IndexedColorMap colorMap) {
  80. _ctFont = font;
  81. _index = (short)index;
  82. _indexedColorMap = colorMap;
  83. }
  84. /**
  85. * Create a new XSSFont. This method is protected to be used only by XSSFWorkbook
  86. */
  87. public XSSFFont() {
  88. this._ctFont = CTFont.Factory.newInstance();
  89. setFontName(DEFAULT_FONT_NAME);
  90. setFontHeight((double)DEFAULT_FONT_SIZE);
  91. }
  92. /**
  93. * get the underlying CTFont font
  94. */
  95. @Internal
  96. public CTFont getCTFont() {
  97. return _ctFont;
  98. }
  99. /**
  100. * get a boolean value for the boldness to use.
  101. *
  102. * @return boolean - bold
  103. */
  104. public boolean getBold() {
  105. CTBooleanProperty bold = _ctFont.sizeOfBArray() == 0 ? null : _ctFont.getBArray(0);
  106. return (bold != null && bold.getVal());
  107. }
  108. /**
  109. * get character-set to use.
  110. *
  111. * @return int - character-set (0-255)
  112. * @see FontCharset
  113. */
  114. public int getCharSet() {
  115. CTIntProperty charset = _ctFont.sizeOfCharsetArray() == 0 ? null : _ctFont.getCharsetArray(0);
  116. return charset == null ? FontCharset.ANSI.getValue() : FontCharset.valueOf(charset.getVal()).getValue();
  117. }
  118. /**
  119. * get the indexed color value for the font
  120. * References a color defined in IndexedColors.
  121. *
  122. * @return short - indexed color to use
  123. * @see IndexedColors
  124. */
  125. public short getColor() {
  126. CTColor color = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
  127. if (color == null) return IndexedColors.BLACK.getIndex();
  128. long index = color.getIndexed();
  129. if (index == XSSFFont.DEFAULT_FONT_COLOR) {
  130. return IndexedColors.BLACK.getIndex();
  131. } else if (index == IndexedColors.RED.getIndex()) {
  132. return IndexedColors.RED.getIndex();
  133. } else {
  134. return (short)index;
  135. }
  136. }
  137. /**
  138. * get the color value for the font
  139. * References a color defined as Standard Alpha Red Green Blue color value (ARGB).
  140. *
  141. * @return XSSFColor - rgb color to use
  142. */
  143. public XSSFColor getXSSFColor() {
  144. CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
  145. if(ctColor != null) {
  146. XSSFColor color = XSSFColor.from(ctColor, _indexedColorMap);
  147. if(_themes != null) {
  148. _themes.inheritFromThemeAsRequired(color);
  149. }
  150. return color;
  151. } else {
  152. return null;
  153. }
  154. }
  155. /**
  156. * get the color value for the font
  157. * References a color defined in theme.
  158. *
  159. * @return short - theme defined to use
  160. */
  161. public short getThemeColor() {
  162. CTColor color = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
  163. long index = color == null ? 0 : color.getTheme();
  164. return (short) index;
  165. }
  166. /**
  167. * Get the font height in unit's of 1/20th of a point.
  168. * <p>
  169. * For many users, the related {@link #getFontHeightInPoints()}
  170. * will be more helpful, as that returns font heights in the
  171. * more familiar points units, eg 10, 12, 14.
  172. * @return short - height in 1/20ths of a point
  173. * @see #getFontHeightInPoints()
  174. */
  175. public short getFontHeight() {
  176. return (short)(getFontHeightRaw()*Font.TWIPS_PER_POINT);
  177. }
  178. /**
  179. * Get the font height in points.
  180. * <p>
  181. * This will return the same font height that is shown in Excel,
  182. * such as 10 or 14 or 28.
  183. * @return short - height in the familiar unit of measure - points
  184. * @see #getFontHeight()
  185. */
  186. public short getFontHeightInPoints() {
  187. return (short)getFontHeightRaw();
  188. }
  189. /**
  190. * Return the raw font height, in points, but also
  191. * including fractions.
  192. */
  193. private double getFontHeightRaw() {
  194. CTFontSize size = _ctFont.sizeOfSzArray() == 0 ? null : _ctFont.getSzArray(0);
  195. if (size != null) {
  196. return size.getVal();
  197. }
  198. return DEFAULT_FONT_SIZE;
  199. }
  200. /**
  201. * get the name of the font (i.e. Arial)
  202. *
  203. * @return String - a string representing the name of the font to use
  204. */
  205. public String getFontName() {
  206. CTFontName name = _ctFont.sizeOfNameArray() == 0 ? null : _ctFont.getNameArray(0);
  207. return name == null ? DEFAULT_FONT_NAME : name.getVal();
  208. }
  209. /**
  210. * get a boolean value that specify whether to use italics or not
  211. *
  212. * @return boolean - value for italic
  213. */
  214. public boolean getItalic() {
  215. CTBooleanProperty italic = _ctFont.sizeOfIArray() == 0 ? null : _ctFont.getIArray(0);
  216. return italic != null && italic.getVal();
  217. }
  218. /**
  219. * get a boolean value that specify whether to use a strikeout horizontal line through the text or not
  220. *
  221. * @return boolean - value for strikeout
  222. */
  223. public boolean getStrikeout() {
  224. CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? null : _ctFont.getStrikeArray(0);
  225. return strike != null && strike.getVal();
  226. }
  227. /**
  228. * get normal,super or subscript.
  229. *
  230. * @return short - offset type to use (none,super,sub)
  231. * @see Font#SS_NONE
  232. * @see Font#SS_SUPER
  233. * @see Font#SS_SUB
  234. */
  235. public short getTypeOffset() {
  236. CTVerticalAlignFontProperty vAlign = _ctFont.sizeOfVertAlignArray() == 0 ? null : _ctFont.getVertAlignArray(0);
  237. if (vAlign == null) {
  238. return Font.SS_NONE;
  239. }
  240. int val = vAlign.getVal().intValue();
  241. switch (val) {
  242. case STVerticalAlignRun.INT_BASELINE:
  243. return Font.SS_NONE;
  244. case STVerticalAlignRun.INT_SUBSCRIPT:
  245. return Font.SS_SUB;
  246. case STVerticalAlignRun.INT_SUPERSCRIPT:
  247. return Font.SS_SUPER;
  248. default:
  249. throw new POIXMLException("Wrong offset value " + val);
  250. }
  251. }
  252. /**
  253. * get type of text underlining to use
  254. *
  255. * @return byte - underlining type
  256. * @see org.apache.poi.ss.usermodel.FontUnderline
  257. */
  258. public byte getUnderline() {
  259. CTUnderlineProperty underline = _ctFont.sizeOfUArray() == 0 ? null : _ctFont.getUArray(0);
  260. if (underline != null) {
  261. FontUnderline val = FontUnderline.valueOf(underline.getVal().intValue());
  262. return val.getByteValue();
  263. }
  264. return Font.U_NONE;
  265. }
  266. /**
  267. * set a boolean value for the boldness to use. If omitted, the default value is true.
  268. *
  269. * @param bold - boldness to use
  270. */
  271. public void setBold(boolean bold) {
  272. if(bold){
  273. CTBooleanProperty ctBold = _ctFont.sizeOfBArray() == 0 ? _ctFont.addNewB() : _ctFont.getBArray(0);
  274. ctBold.setVal(true);
  275. } else {
  276. _ctFont.setBArray(null);
  277. }
  278. }
  279. /**
  280. * set character-set to use.
  281. *
  282. * @param charset - charset
  283. * @see FontCharset
  284. */
  285. public void setCharSet(byte charset) {
  286. int cs = charset & 0xff;
  287. setCharSet(cs);
  288. }
  289. /**
  290. * set character-set to use.
  291. *
  292. * @param charset - charset
  293. * @see FontCharset
  294. */
  295. public void setCharSet(int charset) {
  296. FontCharset fontCharset = FontCharset.valueOf(charset);
  297. if(fontCharset != null) {
  298. setCharSet(fontCharset);
  299. } else {
  300. throw new POIXMLException("Attention: an attempt to set a type of unknow charset and charset");
  301. }
  302. }
  303. /**
  304. * set character-set to use.
  305. *
  306. * @param charSet
  307. */
  308. public void setCharSet(FontCharset charSet) {
  309. CTIntProperty charsetProperty;
  310. if(_ctFont.sizeOfCharsetArray() == 0) {
  311. charsetProperty = _ctFont.addNewCharset();
  312. } else {
  313. charsetProperty = _ctFont.getCharsetArray(0);
  314. }
  315. // We know that FontCharset only has valid entries in it,
  316. // so we can just set the int value from it
  317. charsetProperty.setVal( charSet.getValue() );
  318. }
  319. /**
  320. * set the indexed color for the font
  321. *
  322. * @param color - color to use
  323. * @see #DEFAULT_FONT_COLOR - Note: default font color
  324. * @see IndexedColors
  325. */
  326. public void setColor(short color) {
  327. CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
  328. switch (color) {
  329. case Font.COLOR_NORMAL: {
  330. ctColor.setIndexed(XSSFFont.DEFAULT_FONT_COLOR);
  331. break;
  332. }
  333. case Font.COLOR_RED: {
  334. ctColor.setIndexed(IndexedColors.RED.getIndex());
  335. break;
  336. }
  337. default:
  338. ctColor.setIndexed(color);
  339. }
  340. }
  341. /**
  342. * set the color for the font in Standard Alpha Red Green Blue color value
  343. *
  344. * @param color - color to use
  345. */
  346. public void setColor(XSSFColor color) {
  347. if(color == null) _ctFont.setColorArray(null);
  348. else {
  349. CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
  350. if (ctColor.isSetIndexed()) {
  351. ctColor.unsetIndexed();
  352. }
  353. ctColor.setRgb(color.getRGB());
  354. }
  355. }
  356. /**
  357. * set the font height in points.
  358. *
  359. * @param height - height in points
  360. */
  361. public void setFontHeight(short height) {
  362. setFontHeight((double) height/Font.TWIPS_PER_POINT);
  363. }
  364. /**
  365. * set the font height in points.
  366. *
  367. * @param height - height in points
  368. */
  369. public void setFontHeight(double height) {
  370. CTFontSize fontSize = _ctFont.sizeOfSzArray() == 0 ? _ctFont.addNewSz() : _ctFont.getSzArray(0);
  371. fontSize.setVal(height);
  372. }
  373. /**
  374. * set the font height in points.
  375. *
  376. * @see #setFontHeight
  377. */
  378. public void setFontHeightInPoints(short height) {
  379. setFontHeight((double)height);
  380. }
  381. /**
  382. * set the theme color for the font to use
  383. *
  384. * @param theme - theme color to use
  385. */
  386. public void setThemeColor(short theme) {
  387. CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
  388. ctColor.setTheme(theme);
  389. }
  390. /**
  391. * set the name for the font (i.e. Arial).
  392. * If the font doesn't exist (because it isn't installed on the system),
  393. * or the charset is invalid for that font, then another font should
  394. * be substituted.
  395. * The string length for this attribute shall be 0 to 31 characters.
  396. * Default font name is Calibri.
  397. *
  398. * @param name - value representing the name of the font to use
  399. * @see #DEFAULT_FONT_NAME
  400. */
  401. public void setFontName(String name) {
  402. CTFontName fontName = _ctFont.sizeOfNameArray() == 0 ? _ctFont.addNewName() : _ctFont.getNameArray(0);
  403. fontName.setVal(name == null ? DEFAULT_FONT_NAME : name);
  404. }
  405. /**
  406. * set a boolean value for the property specifying whether to use italics or not
  407. * If omitted, the default value is true.
  408. *
  409. * @param italic - value for italics or not
  410. */
  411. public void setItalic(boolean italic) {
  412. if(italic){
  413. CTBooleanProperty bool = _ctFont.sizeOfIArray() == 0 ? _ctFont.addNewI() : _ctFont.getIArray(0);
  414. bool.setVal(true);
  415. } else {
  416. _ctFont.setIArray(null);
  417. }
  418. }
  419. /**
  420. * set a boolean value for the property specifying whether to use a strikeout horizontal line through the text or not
  421. * If omitted, the default value is true.
  422. *
  423. * @param strikeout - value for strikeout or not
  424. */
  425. public void setStrikeout(boolean strikeout) {
  426. if(strikeout) {
  427. CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? _ctFont.addNewStrike() : _ctFont.getStrikeArray(0);
  428. strike.setVal(true);
  429. } else {
  430. _ctFont.setStrikeArray(null);
  431. }
  432. }
  433. /**
  434. * set normal,super or subscript, that representing the vertical-alignment setting.
  435. * Setting this to either subscript or superscript shall make the font size smaller if a
  436. * smaller font size is available.
  437. *
  438. * @param offset - offset type to use (none,super,sub)
  439. * @see #SS_NONE
  440. * @see #SS_SUPER
  441. * @see #SS_SUB
  442. */
  443. public void setTypeOffset(short offset) {
  444. if(offset == Font.SS_NONE){
  445. _ctFont.setVertAlignArray(null);
  446. } else {
  447. CTVerticalAlignFontProperty offsetProperty = _ctFont.sizeOfVertAlignArray() == 0 ? _ctFont.addNewVertAlign() : _ctFont.getVertAlignArray(0);
  448. switch (offset) {
  449. case Font.SS_NONE:
  450. offsetProperty.setVal(STVerticalAlignRun.BASELINE);
  451. break;
  452. case Font.SS_SUB:
  453. offsetProperty.setVal(STVerticalAlignRun.SUBSCRIPT);
  454. break;
  455. case Font.SS_SUPER:
  456. offsetProperty.setVal(STVerticalAlignRun.SUPERSCRIPT);
  457. break;
  458. default:
  459. throw new IllegalStateException("Invalid type offset: " + offset);
  460. }
  461. }
  462. }
  463. /**
  464. * set the style of underlining that is used.
  465. * The none style is equivalent to not using underlining at all.
  466. *
  467. * @param underline - underline type to use
  468. * @see FontUnderline
  469. */
  470. public void setUnderline(byte underline) {
  471. setUnderline(FontUnderline.valueOf(underline));
  472. }
  473. /**
  474. * set an enumeration representing the style of underlining that is used.
  475. * The none style is equivalent to not using underlining at all.
  476. * The possible values for this attribute are defined by the FontUnderline
  477. *
  478. * @param underline - FontUnderline enum value
  479. */
  480. public void setUnderline(FontUnderline underline) {
  481. if(underline == FontUnderline.NONE && _ctFont.sizeOfUArray() > 0){
  482. _ctFont.setUArray(null);
  483. } else {
  484. CTUnderlineProperty ctUnderline = _ctFont.sizeOfUArray() == 0 ? _ctFont.addNewU() : _ctFont.getUArray(0);
  485. STUnderlineValues.Enum val = STUnderlineValues.Enum.forInt(underline.getValue());
  486. ctUnderline.setVal(val);
  487. }
  488. }
  489. public String toString() {
  490. return _ctFont.toString();
  491. }
  492. /**
  493. * Perform a registration of ourselves
  494. * to the style table
  495. */
  496. public long registerTo(StylesTable styles) {
  497. return registerTo(styles, true);
  498. }
  499. public long registerTo(StylesTable styles, boolean force) {
  500. this._themes = styles.getTheme();
  501. this._index = styles.putFont(this, force);
  502. return this._index;
  503. }
  504. /**
  505. * Records the Themes Table that is associated with
  506. * the current font, used when looking up theme
  507. * based colours and properties.
  508. */
  509. public void setThemesTable(ThemesTable themes) {
  510. this._themes = themes;
  511. }
  512. /**
  513. * get the font scheme property.
  514. * is used only in StylesTable to create the default instance of font
  515. *
  516. * @return FontScheme
  517. * @see org.apache.poi.xssf.model.StylesTable#createDefaultFont()
  518. */
  519. @SuppressWarnings("JavadocReference")
  520. public FontScheme getScheme() {
  521. CTFontScheme scheme = _ctFont.sizeOfSchemeArray() == 0 ? null : _ctFont.getSchemeArray(0);
  522. return scheme == null ? FontScheme.NONE : FontScheme.valueOf(scheme.getVal().intValue());
  523. }
  524. /**
  525. * set font scheme property
  526. *
  527. * @param scheme - FontScheme enum value
  528. * @see FontScheme
  529. */
  530. public void setScheme(FontScheme scheme) {
  531. CTFontScheme ctFontScheme = _ctFont.sizeOfSchemeArray() == 0 ? _ctFont.addNewScheme() : _ctFont.getSchemeArray(0);
  532. STFontScheme.Enum val = STFontScheme.Enum.forInt(scheme.getValue());
  533. ctFontScheme.setVal(val);
  534. }
  535. /**
  536. * get the font family to use.
  537. *
  538. * @return the font family to use
  539. * @see org.apache.poi.ss.usermodel.FontFamily
  540. */
  541. public int getFamily() {
  542. CTIntProperty family = _ctFont.sizeOfFamilyArray() == 0 ? null : _ctFont.getFamilyArray(0);
  543. return family == null ? FontFamily.NOT_APPLICABLE.getValue() : FontFamily.valueOf(family.getVal()).getValue();
  544. }
  545. /**
  546. * Set the font family this font belongs to.
  547. * A font family is a set of fonts having common stroke width and serif characteristics.
  548. * The font name overrides when there are conflicting values.
  549. *
  550. * @param value - font family
  551. * @see FontFamily
  552. */
  553. public void setFamily(int value) {
  554. CTIntProperty family = _ctFont.sizeOfFamilyArray() == 0 ? _ctFont.addNewFamily() : _ctFont.getFamilyArray(0);
  555. family.setVal(value);
  556. }
  557. /**
  558. * set an enumeration representing the font family this font belongs to.
  559. * A font family is a set of fonts having common stroke width and serif characteristics.
  560. *
  561. * @param family font family
  562. * @see #setFamily(int value)
  563. */
  564. public void setFamily(FontFamily family) {
  565. setFamily(family.getValue());
  566. }
  567. @Override
  568. @Deprecated
  569. public short getIndex() {
  570. return (short)getIndexAsInt();
  571. }
  572. @Override
  573. public int getIndexAsInt()
  574. {
  575. return _index;
  576. }
  577. public int hashCode(){
  578. return _ctFont.toString().hashCode();
  579. }
  580. public boolean equals(Object o){
  581. if(!(o instanceof XSSFFont)) return false;
  582. XSSFFont cf = (XSSFFont)o;
  583. // BUG 60845
  584. return Objects.equals(this.getItalic(), cf.getItalic())
  585. && Objects.equals(this.getBold(), cf.getBold())
  586. && Objects.equals(this.getStrikeout(), cf.getStrikeout())
  587. && Objects.equals(this.getCharSet(), cf.getCharSet())
  588. && Objects.equals(this.getColor(), cf.getColor())
  589. && Objects.equals(this.getFamily(), cf.getFamily())
  590. && Objects.equals(this.getFontHeight(), cf.getFontHeight())
  591. && Objects.equals(this.getFontName(), cf.getFontName())
  592. && Objects.equals(this.getScheme(), cf.getScheme())
  593. && Objects.equals(this.getThemeColor(), cf.getThemeColor())
  594. && Objects.equals(this.getTypeOffset(), cf.getTypeOffset())
  595. && Objects.equals(this.getUnderline(), cf.getUnderline())
  596. && Objects.equals(this.getXSSFColor(), cf.getXSSFColor());
  597. }
  598. }