Example:
//Instantiating a Workbook object //Instantiating a Workbook object $workbook = new cells\Workbook(); //Obtaining the reference of the newly added worksheet by passing its sheet index $worksheet = $workbook->getWorksheets()->get(0); //Accessing the "A1" cell from the worksheet $cell = $worksheet->getCells()->get("A1"); //Adding some value to the "A1" cell $cell->putValue("Hello Aspose!"); $style = $cell->getStyle(); $font = $style->getFont(); //Setting the font name to "Times New Roman" $font->setName("Times New Roman"); //Setting font size to 14 $font->setSize(14); //setting font color as Red $font->setColor(cells\Color::getRed()); $cell->setStyle($style);
Property Getters/Setters Summary | ||
---|---|---|
function | getArgbColor() | |
function | setArgbColor(value) | |
Gets and sets the color with a 32-bit ARGB value. | ||
function | getCapsType() | |
function | setCapsType(value) | |
Gets and sets the text caps type. The value of the property is TextCapsType integer constant. | ||
function | getCharset() | |
function | setCharset(value) | |
Represent the character set. | ||
function | getColor() | |
function | setColor(value) | |
Gets or sets the |
||
function | getDoubleSize() | |
function | setDoubleSize(value) | |
Gets and sets the double size of the font. | ||
function | isBold() | |
function | setBold(value) | |
Gets or sets a value indicating whether the font is bold. | ||
function | isItalic() | |
function | setItalic(value) | |
Gets or sets a value indicating whether the font is italic. | ||
function | isNormalizeHeights() | |
function | setNormalizeHeights(value) | |
Indicates whether the normalization of height that is to be applied to the text run. | ||
function | isStrikeout() | |
function | setStrikeout(value) | |
Gets or sets a value indicating whether the font is single strikeout. | ||
function | isSubscript() | |
function | setSubscript(value) | |
Gets or sets a value indicating whether the font is subscript. | ||
function | isSuperscript() | |
function | setSuperscript(value) | |
Gets or sets a value indicating whether the font is super script. | ||
function | getName() | |
function | setName(value) | |
Gets or sets the name of the |
||
function | getSchemeType() | |
function | setSchemeType(value) | |
Gets and sets the scheme type of the font. The value of the property is FontSchemeType integer constant. | ||
function | getScriptOffset() | |
function | setScriptOffset(value) | |
Gets and sets the script offset,in unit of percentage | ||
function | getSize() | |
function | setSize(value) | |
Gets or sets the size of the font. | ||
function | getStrikeType() | |
function | setStrikeType(value) | |
Gets the strike type of the text. The value of the property is TextStrikeType integer constant. | ||
function | getThemeColor() | |
function | setThemeColor(value) | |
Gets and sets the theme color. | ||
function | getUnderline() | |
function | setUnderline(value) | |
Gets or sets the font underline type. The value of the property is FontUnderlineType integer constant. |
Method Summary | ||
---|---|---|
function | equals(font) | |
Checks if two fonts are equals. | ||
function | toString() | |
Returns a string represents the current Cell object. |
Property Getters/Setters Detail |
---|
getCharset/setCharset : Number | |
function getCharset() / function setCharset(value) |
isItalic/setItalic : boolean | |
function isItalic() / function setItalic(value) |
isBold/setBold : boolean | |
function isBold() / function setBold(value) |
getCapsType/setCapsType : Number | |
function getCapsType() / function setCapsType(value) |
getStrikeType/setStrikeType : Number | |
function getStrikeType() / function setStrikeType(value) |
isStrikeout/setStrikeout : boolean | |
function isStrikeout() / function setStrikeout(value) |
getScriptOffset/setScriptOffset : Number | |
function getScriptOffset() / function setScriptOffset(value) |
isSuperscript/setSuperscript : boolean | |
function isSuperscript() / function setSuperscript(value) |
isSubscript/setSubscript : boolean | |
function isSubscript() / function setSubscript(value) |
getUnderline/setUnderline : Number | |
function getUnderline() / function setUnderline(value) |
getName/setName : String | |
function getName() / function setName(value) |
Example:
$workbook = new cells\Workbook(); //Obtaining the reference of the newly added worksheet by passing its sheet index $worksheet = $workbook->getWorksheets()->get(0); //Accessing the "A1" cell from the worksheet $cell = $worksheet->getCells()->get("A1"); //Adding some value to the "A1" cell $cell->putValue("Hello Aspose!"); $style = $cell->getStyle(); $font = $style->getFont(); $font->setName("Times New Roman"); $cell->setStyle($style);
getDoubleSize/setDoubleSize : Number | |
function getDoubleSize() / function setDoubleSize(value) |
getSize/setSize : Number | |
function getSize() / function setSize(value) |
getThemeColor/setThemeColor : ThemeColor | |
function getThemeColor() / function setThemeColor(value) |
getColor/setColor : Color | |
function getColor() / function setColor(value) |
getArgbColor/setArgbColor : Number | |
function getArgbColor() / function setArgbColor(value) |
isNormalizeHeights/setNormalizeHeights : boolean | |
function isNormalizeHeights() / function setNormalizeHeights(value) |
getSchemeType/setSchemeType : Number | |
function getSchemeType() / function setSchemeType(value) |
Method Detail |
---|
equals | |
function equals(font) |
font: Font
- Compared font object.toString | |
function toString() |