function socialcalc_cellformat_parsefont in Sheetnode 5
Same name and namespace in other branches
- 6 socialcalc.inc \socialcalc_cellformat_parsefont()
- 7.2 socialcalc.inc \socialcalc_cellformat_parsefont()
- 7 socialcalc.inc \socialcalc_cellformat_parsefont()
1 call to socialcalc_cellformat_parsefont()
- _sheetnode_phpexcel_export_do in modules/
sheetnode_phpexcel/ sheetnode_phpexcel.export.inc
File
- ./
socialcalc.inc, line 664 - SocialCalc manipulation functions Translated from socialcalc-3.js and companion files
Code
function socialcalc_cellformat_parsefont($cell, $sheet) {
if (empty($cell['font'])) {
return FALSE;
}
$parts = array();
preg_match('/^(\\*|\\S+? \\S+?) (\\S+?) (\\S.*)$/', $sheet['fonts'][$cell['font']], $parts);
$font = array();
if ($parts[3] != '*') {
$font['family'] = $parts[3];
}
if ($parts[2] != '*') {
$font['size'] = $parts[2];
}
if ($parts[1] != '*') {
$font['bold'] = strpos($parts[1], 'bold') !== FALSE;
$font['italic'] = strpos($parts[1], 'italic') !== FALSE;
}
return $font;
}