public final class Font extends XLSRecord implements FormatConstants
offset name size contents
---
4 dyHeight 2 Height in 1/20 point (twips)
6 grbit 2 attributes
grbit Mask Contents
0 0001H 1 = Characters are bold
1 0002H 1 = Characters are italic
2 0004H 1 = Characters are underlined
3 0008H 1 = Characters are struck out
8 icv 2 index to color palette
10 bls 2 bold style (weight) 100-1000 default is 190h norm 2bch bold
12 sss 2 super/sub (0 = none, 1 = super, 2 = sub)
14 uls 1 Underline Style (0 = none, 1 = single, 2 = double, 21h = single acctg, 22h = dble acctg)
15 bFamily 1 Font Family (WinAPI LOGFONT struct)
16 bCharSet 1 Characterset (WinAPI LOGFONT struct)
17 reserved 0
18 cch 1 Length of font name
19 rgch var Font name
"http://www.extentech.com">Extentech Inc.XF,
FORMAT,
Serialized Formcol, continues, DEBUGLEVEL, hyperlink, idx, isBlank, isBoolean, isContinueMerged, isString, lastidx, myxf, offset, rw, streamer, wkbook, worksheetALIGN_CENTER, ALIGN_CENTER_ACROSS_SELECTION, ALIGN_DEFAULT, ALIGN_FILL, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_VERTICAL_BOTTOM, ALIGN_VERTICAL_CENTER, ALIGN_VERTICAL_JUSTIFY, ALIGN_VERTICAL_TOP, Aqua, Black, Blue, BlueGray, BOLD, BORDER_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM, BORDER_MEDIUM_DASH_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_MEDIUM_DASHED, BORDER_NAMES, BORDER_NAMES_HTML, BORDER_NONE, BORDER_SIZES_HTML, BORDER_SLANTED_DASH_DOT, BORDER_STYLES_JSON, BORDER_THICK, BORDER_THIN, BrightGreen, Brown, BUILTIN_FORMATS, BUILTIN_FORMATS_JP, BUILTIN_FORMATS_MHTML, COLOR_AQUA, COLOR_BLACK, COLOR_BLACK2, COLOR_BLACK3, COLOR_BLUE, COLOR_BLUE_CHART, COLOR_BLUE_GRAY, COLOR_BRIGHT_GREEN, COLOR_BROWN, COLOR_CYAN, COLOR_DARK_BLUE, COLOR_DARK_GREEN, COLOR_DARK_PURPLE, COLOR_DARK_RED, COLOR_DARK_TEAL, COLOR_DARK_YELLOW, COLOR_GOLD, COLOR_GRAY25, COLOR_GRAY40, COLOR_GRAY50, COLOR_GRAY80, COLOR_GREEN, COLOR_INDIGO, COLOR_LAVENDER, COLOR_LIGHT_BLUE, COLOR_LIGHT_GREEN, COLOR_LIGHT_ORANGE, COLOR_LIGHT_PURPLE, COLOR_LIGHT_TURQUOISE, COLOR_LIGHT_YELLOW, COLOR_LIME, COLOR_MEDIUM_PURPLE, COLOR_OLIVE_GREEN, COLOR_OLIVE_GREEN_CHART, COLOR_ORANGE, COLOR_PALE_BLUE, COLOR_PINK, COLOR_PLUM, COLOR_RED, COLOR_RED_CHART, COLOR_ROSE, COLOR_SALMON, COLOR_SEA_GREEN, COLOR_SKY_BLUE, COLOR_TAN, COLOR_TEAL, COLOR_TURQUOISE, COLOR_VIOLET, COLOR_WHITE, COLOR_WHITE2, COLOR_WHITE3, COLOR_YELLOW, COLOR_YELLOW_CHART, COLORNAMES, COLORTABLE, CURRENCY_FORMATS, Dark_Blue, Dark_Green, Dark_Purple, Dark_Red, Dark_Teal, Dark_Yellow, DATE_FORMATS, DEFAULT_FONT_FACE, DEFAULT_FONT_SIZE, DEFAULT_FONT_WEIGHT, EXCEL_FORMAT_LOOKUP, FORMAT_NOSCRIPT, FORMAT_SUBSCRIPT, FORMAT_SUPERSCRIPT, Gold, Gray15, Gray25, Gray40, Gray50, Gray80, Green, HORIZONTAL_ALIGNMENTS, HTMLCOLORNAMES, Indigo, Lavender, Light_Blue, Light_Green, Light_Orange, Light_Purple, Light_Turquoise, Light_Yellow, Lime, Medium_Purple, NUMERIC_FORMATS, OliveGreen, Orange, PaleBlue, PATTERN_CHECKERBOARD1, PATTERN_CHECKERBOARD2, PATTERN_CROSSPATCH1, PATTERN_DIAG_STRIPES1, PATTERN_DIAG_STRIPES2, PATTERN_DIAG_STRIPES3, PATTERN_DIAG_STRIPES4, PATTERN_DIAG_STRIPES5, PATTERN_DIAG_STRIPES6, PATTERN_DIAG_STRIPES7, PATTERN_DIAG_STRIPES8, PATTERN_FILLED, PATTERN_GRID1, PATTERN_HOR_STRIPES1, PATTERN_HOR_STRIPES2, PATTERN_HOR_STRIPES3, PATTERN_HOR_STRIPES4, PATTERN_HVY_DOTS, PATTERN_HVY_FILL, PATTERN_LIGHT_DOTS, PATTERN_LIGHT_FILL, PATTERN_MED_DOTS, PATTERN_MED_FILL, PATTERN_NONE, PATTERN_PATCHY1, PATTERN_PATCHY2, PATTERN_PATCHY3, PATTERN_PATCHY4, PATTERN_VERT_STRIPES1, PATTERN_VERT_STRIPES2, PATTERN_VERT_STRIPES3, PATTERN_VERT_STRIPES4, patternmap, Pink, PLAIN, Plum, Red, Rose, Salmon, SeaGreen, SkyBlue, STYLE_UNDERLINE_DOUBLE, STYLE_UNDERLINE_DOUBLE_ACCTG, STYLE_UNDERLINE_NONE, STYLE_UNDERLINE_SINGLE, STYLE_UNDERLINE_SINGLE_ACCTG, SVGCOLORSTRINGS, Tan, Teal, Turquoise, VERTICAL_ALIGNMENTS, Violet, White, YellowAI, ALLOWDUPES, ALRUNS, AREA, AREAFORMAT, ARRAY, ATTACHEDLABEL, AUTOFILTER, AXCENT, AXESUSED, AXIS, AXISLINEFORMAT, AXISPARENT, BACKUP, BAR, BEGIN, BLANK, BOF, BOOKBOOL, BOOLERR, BOPPOP, BOPPOPCUSTOM, BOTTOM_MARGIN, BOTTOMMARGIN, BOUNDSHEET, CALC_MODE_PROP, CALCCOUNT, CALCMODE, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, CATLAB, CATSERRANGE, CF, CF12, CHART, CHART3DBARSHAPE, CHARTFORMAT, CHARTFORMATLINK, CHARTFRTINFO, CHARTLINE, CODENAME, COLINFO, CONDFMT, CONDFMT12, CONTINUE, COUNTRY, CRN, CRTLAYOUT12, CRTLAYOUT12A, DAT, DATAFORMAT, DATALABEXT, DATALABEXTCONTENTS, DATE1904, DBCELL, DCON, DCONBIN, DCONNAME, DCONREF, DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM, DEFAULTENCODING, DEFAULTROWHEIGHT, DEFAULTTEXT, DEFCOLWIDTH, DELTA, DIMENSIONS, DROPBAR, DSF, DV, DVAL, END, ENDBLOCK, ENDEXTSST, ENDOBJECT, EOF, EXCEL2K, EXTERNCOUNT, EXTERNNAME, EXTERNSHEET, EXTSST, FBI, FEATHEADR, FILE_LOCK, FILEPASS, FONT, FONTBASIS, FONTX, FOOTERREC, FORMAT, FORMULA, FRAME, FRTFONTLIST, FRTWRAPPER, GARBAGE, GELFRAME, GUTS, HCENTER, HEADERREC, HLINK, HORIZONTAL_PAGE_BREAKS, IFMT, INDEX, INTERFACE_HDR, ITERATION, LABEL, LABELSST, LEFT_MARGIN, LEFTMARGIN, LEGEND, LEGENDXN, LINE, LINEFORMAT, MARKERFORMAT, MAXCOLS, MAXCOLS_BIFF8, MAXRECLEN, MAXROWS, MAXROWS_BIFF8, MERGEDCELLS, MSODRAWING, MSODRAWINGGROUP, MSODRAWINGSELECTION, MULBLANK, MULRK, NAME, NOTE, NUMBER, OBJ, OBJECTLINK, OBJPROTECT, OBPROJ, PALETTE, PANE, PASSWORD, PHONETIC, PICF, PIE, PIEFORMAT, PIVOTCHARTBITS, PIVOTCHARTLINK, PLOTAREA, PLOTGROWTH, PLS, PLV, POS, PRECISION, PRINT_GRIDLINES, PRINT_ROW_HEADERS, PRINTGRID, PRINTROWCOL, PROT4REV, PROTECT, QSISXTAG, RADAR, RADARAREA, RANGEPROTECTION, REFMODE, REFTRACK_PROP, RIGHT_MARGIN, RIGHTMARGIN, RK, ROW, RRD_HEAD, RRD_INFO, RSTRING, RTENTEXU, RTMERGECELLS, SBASEREF, SCATTER, SCENPROTECT, SCL, SELECTION, SERAUXERRBAR, SERAUXTREND, SERFMT, SERIES, SERIESLIST, SERIESTEXT, SERPARENT, SERTOCRT, SETUP, SHAREDUPES, SHEETLAYOUT, SHEETPROTECTION, SHRFMLA, SHTPROPS, SIIINDEX, SST, STARTBLOCK, STARTOBJECT, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE, STRINGREC, STYLE, SUPBOOK, SURFACE, SXADDL, SXBOOL, SXDB, SXDBB, SXDBEX, SXDI, SXEX, SXFDB, SXFDBTYPE, SXFORMAT, SXIVD, SXLI, SXNUM, SXPI, SXSTREAMID, SXSTRING, SXVD, SXVDEX, SXVI, SXVIEW, SXVIEWEX9, SXVIEWLINK, SXVS, TABID, TABLE, TABLESTYLES, TEXTDISP, THREED, TICK, TOP_MARGIN, TOPMARGIN, TXO, TYPE_BLANK, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FORMULA, TYPE_FP, TYPE_INT, TYPE_STRING, UNICODEENCODING, UNITS, USERBVIEW, USERSVIEWBEGIN, USERSVIEWEND, USETEMPFILE_PROP, USR_EXCL, VALIDATEWORKBOOK, VALUERANGE, VB_MODULE, VCENTER, VERTICAL_PAGE_BREAKS, WINDOW_PROTECT, WINDOW1, WINDOW2, WK_CHART, WK_FILE, WK_GLOBALS, WK_MACROSHEET, WK_WORKSHEET, WSBOOL, XCT, XF, XLS_MAX_COLS, YMULT| Constructor and Description |
|---|
Font() |
Font(String nm,
int stl,
int sz)
Create a New Font from the String definition.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
FontHeightToPoints(int h) |
boolean |
getBold()
get if the font is bold or not
|
int |
getColor()
gets the color of this font as an index into excel 2003 color table
|
Color |
getColorAsColor()
Get the color for this Font as a avt.Color
|
String |
getColorAsHex()
Get the color of this Font as a web-compliant Hex String
|
String |
getColorAsOOXMLRBG()
returns the font color as an OOXML-compliant Hex Stringf *
|
int |
getFontColor()
Deprecated.
use getColor()
|
int |
getFontHeight() |
double |
getFontHeightInPoints() |
String |
getFontName() |
int |
getFontWeight() |
int |
getIdx() |
boolean |
getIsBold()
Get if the font is bold or not
|
boolean |
getItalic()
Get if the font is italic or not
|
String |
getOOXML()
generate the OOXML to define this Font
|
Color |
getOOXMLColor()
return the OOXML font color element
|
int |
getScript()
returns the super/sub script for the Font
|
boolean |
getStricken()
Get if the font record is striken our or not
|
String |
getSVG()
return the appropriate SVG string to define this font
|
boolean |
getUnderlined()
Get if the font is underlined or not
|
int |
getUnderlineStyle()
Get an int representing the underline style of this record, matches int
records in FormatConstants.STYLE_UNDERLINE*****
|
String |
getXML() |
String |
getXML(boolean convertToUnicodeFont)
return an XML desciptor for this font
|
void |
init()
Initialize the font record
|
boolean |
isCondensed()
return whether this font is Condensed (OOXML-specific) Macintosh
compatibility setting.
|
boolean |
isExtended()
return whether this font is Expanded (OOXML-specific) Macintosh
compatibility setting.
|
boolean |
matches(Font f)
return true if font f matches key attributes of this font
|
static Font |
parseOOXML(org.xmlpull.v1.XmlPullParser xpp,
WorkBookHandle bk)
parse incoming OOXML into a Font object
|
static int |
PointsToFontHeight(double h)
utility to convert points to correct font height
|
void |
setBold(boolean b)
Set or unset bold attribute of the font record
|
void |
setColor(Color color)
Sets the font color via java.awt.Color
|
void |
setColor(int cl)
Set the font color via index into 2003 color table
|
void |
setColor(String clr)
Sets the font color via a web-compliant Hex String
|
void |
setCondensed(boolean condensed)
set whether this font is Condensed (OOXML-specific) Macintosh
compatibility setting.
|
void |
setExtended(boolean extended)
set whether this font is Extended (OOXML-specific) Macintosh
compatibility setting.
|
void |
setFontHeight(int ht)
Set the size of the font in 1/20 point units
|
void |
setFontName(String fn)
Set the Font name.
|
void |
setFontWeight(int wt)
Set the weight of the font in 1/20 point units 100-1000 range.
|
void |
setGrbit()
update the Grbit bytes in the underlying byte stream
|
void |
setIdx(int idx) |
void |
setItalic(boolean b) |
void |
setOOXMLColor(Color c)
store OOXML font color
|
void |
setScript(int ss)
Set the super/sub script for the Font
super/sub (0 = none, 1 = super, 2 = sub)
|
void |
setStricken(boolean b) |
void |
setUnderlined(boolean b) |
void |
setUnderlineStyle(byte styl)
Set the underline style of this font recotd
|
void |
setWorkBook(WorkBook b)
add to Fonts table in Workbook
|
String |
toString() |
addContinue, clone, close, copyFormat, getBooleanVal, getByteAt, getByteReader, getBytes, getBytesAt, getCellAddress, getCellAddressWithSheet, getCellType, getColNumber, getColorTable, getContinueVect, getData, getDataType, getDblVal, getDefaultVal, getEncryptedByteReader, getFirstBlock, getFloatVal, getFont, getFormatPattern, getFormulaRec, getHyperlink, getInternalVal, getIntLocation, getIntVal, getIxfe, getLastBlock, getLength, getMergeRange, getOffset, getOpcode, getPrototype, getRealRecordIndex, getRecDesc, getRecordIndex, getRow, getRowNumber, getSheet, getStreamer, getStringVal, getStringVal, getWorkBook, getXfRec, hasContinues, initRowCol, isFormula, isNumber, isReadOnly, isValueForCell, mergeContinues, postStream, preStream, remove, removeContinues, resetCacheBytes, setBooleanVal, setByteReader, setCol, setData, setDebugLevel, setDoubleVal, setEncryptedByteReader, setFirstBlock, setFloatVal, setHyperlink, setIndex, setIntVal, setIsValueForCell, setIxfe, setLastBlock, setLength, setMergeRange, setOffset, setOpcode, setRow, setRowCol, setRowNumber, setSheet, setStreamer, setStringVal, setValueForCell, setXFRecord, setXFRecord, shouldEncrypt, toHexDumppublic Font()
public Font(String nm, int stl, int sz)
String - font nameint - font styleint - font size in Pointspublic void init()
public boolean getStricken()
public void setStricken(boolean b)
public boolean getItalic()
public void setItalic(boolean b)
public boolean getUnderlined()
public void setUnderlined(boolean b)
public boolean getBold()
public void setBold(boolean b)
b - public void setGrbit()
public int getIdx()
public void setIdx(int idx)
idx - public void setWorkBook(WorkBook b)
setWorkBook in interface BiffRecsetWorkBook in class XLSRecordpublic String getFontName()
public int getUnderlineStyle()
public void setUnderlineStyle(byte styl)
styl - public void setFontName(String fn)
public void setScript(int ss)
public int getScript()
public void setColor(int cl)
public void setColor(Color color)
public void setColor(String clr)
public void setFontHeight(int ht)
public static int PointsToFontHeight(double h)
h - public static double FontHeightToPoints(int h)
public int getFontWeight()
public int getFontHeight()
public double getFontHeightInPoints()
public Color getColorAsColor()
public String getColorAsHex()
public String getColorAsOOXMLRBG()
public int getFontColor()
public int getColor()
public void setFontWeight(int wt)
public boolean getIsBold()
public String getXML()
public String getXML(boolean convertToUnicodeFont)
convertToUnicodeFont - if true, font family will be changed to ArialUnicodeMS
(standard unicode) for non-ascii fontspublic boolean matches(Font f)
f - public void setOOXMLColor(Color c)
c - public Color getOOXMLColor()
public void setCondensed(boolean condensed)
condensed - public boolean isCondensed()
public void setExtended(boolean extended)
expanded - public boolean isExtended()
public String getOOXML()
public static Font parseOOXML(org.xmlpull.v1.XmlPullParser xpp, WorkBookHandle bk)
xpp - public String getSVG()
Copyright © 2002–2019 Starter Inc.. All rights reserved.