Methods Summary |
---|
protected void | fillFields(org.apache.poi.hssf.record.RecordInputStream in)
field_1_font_height = in.readShort();
field_2_attributes = in.readShort();
field_3_color_palette_index = in.readShort();
field_4_bold_weight = in.readShort();
field_5_super_sub_script = in.readShort();
field_6_underline = in.readByte();
field_7_family = in.readByte();
field_8_charset = in.readByte();
field_9_zero = in.readByte();
field_10_font_name_len = in.readByte();
if (field_10_font_name_len > 0)
{
if (in.readByte() == 0)
{ // is compressed unicode
field_11_font_name = in.readCompressedUnicode(LittleEndian.ubyteToInt(field_10_font_name_len));
}
else
{ // is not compressed unicode
field_11_font_name = in.readUnicodeLEString(field_10_font_name_len);
}
}
|
public short | getAttributes()get the font attributes (see individual bit getters that reference this method)
return field_2_attributes;
|
public short | getBoldWeight()get the bold weight for this font (100-1000dec or 0x64-0x3e8). Default is
0x190 for normal and 0x2bc for bold
return field_4_bold_weight;
|
public byte | getCharset()get the character set
return field_8_charset;
|
public short | getColorPaletteIndex()get the font's color palette index
return field_3_color_palette_index;
|
public byte | getFamily()get the font family (TODO)
return field_7_family;
|
public short | getFontHeight()gets the height of the font in 1/20th point units
return field_1_font_height;
|
public java.lang.String | getFontName()get the name of the font
return field_11_font_name;
|
public byte | getFontNameLength()get the length of the fontname string
return field_10_font_name_len;
|
public int | getRecordSize()
return (getFontNameLength() * 2) + 20;
|
public short | getSid()
return sid;
|
public short | getSuperSubScript()get the type of super or subscript for the font
return field_5_super_sub_script;
|
public byte | getUnderline()get the type of underlining for the font
return field_6_underline;
|
public boolean | isItalic()get whether the font is to be italics or not
return italic.isSet(field_2_attributes);
|
public boolean | isMacoutlined()whether to use the mac outline font style thing (mac only) - Some mac person
should comment this instead of me doing it (since I have no idea)
return macoutline.isSet(field_2_attributes);
|
public boolean | isMacshadowed()whether to use the mac shado font style thing (mac only) - Some mac person
should comment this instead of me doing it (since I have no idea)
return macshadow.isSet(field_2_attributes);
|
public boolean | isStruckout()get whether the font is to be stricken out or not
return strikeout.isSet(field_2_attributes);
|
public int | serialize(int offset, byte[] data)
int realflen = getFontNameLength() * 2;
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(
data, 2 + offset,
( short ) (15 + realflen
+ 1)); // 19 - 4 (sid/len) + font name length = datasize
// undocumented single byte (1)
LittleEndian.putShort(data, 4 + offset, getFontHeight());
LittleEndian.putShort(data, 6 + offset, getAttributes());
LittleEndian.putShort(data, 8 + offset, getColorPaletteIndex());
LittleEndian.putShort(data, 10 + offset, getBoldWeight());
LittleEndian.putShort(data, 12 + offset, getSuperSubScript());
data[ 14 + offset ] = getUnderline();
data[ 15 + offset ] = getFamily();
data[ 16 + offset ] = getCharset();
data[ 17 + offset ] = field_9_zero;
data[ 18 + offset ] = getFontNameLength();
data[ 19 + offset ] = ( byte ) 1;
if (getFontName() != null) {
StringUtil.putUnicodeLE(getFontName(), data, 20 + offset);
}
return getRecordSize();
|
public void | setAttributes(short attributes)set the font attributes (see individual bit setters that reference this method)
field_2_attributes = attributes;
|
public void | setBoldWeight(short bw)set the bold weight for this font (100-1000dec or 0x64-0x3e8). Default is
0x190 for normal and 0x2bc for bold
field_4_bold_weight = bw;
|
public void | setCharset(byte charset)set the character set
field_8_charset = charset;
|
public void | setColorPaletteIndex(short cpi)set the font's color palette index
field_3_color_palette_index = cpi;
|
public void | setFamily(byte f)set the font family (TODO)
field_7_family = f;
|
public void | setFontHeight(short height)sets the height of the font in 1/20th point units
field_1_font_height = height;
|
public void | setFontName(java.lang.String fn)set the name of the font
field_11_font_name = fn;
|
public void | setFontNameLength(byte len)set the length of the fontname string
field_10_font_name_len = len;
|
public void | setItalic(boolean italics)set the font to be italics or not
field_2_attributes = italic.setShortBoolean(field_2_attributes, italics);
|
public void | setMacoutline(boolean mac)whether to use the mac outline font style thing (mac only) - Some mac person
should comment this instead of me doing it (since I have no idea)
field_2_attributes = macoutline.setShortBoolean(field_2_attributes, mac);
|
public void | setMacshadow(boolean mac)whether to use the mac shado font style thing (mac only) - Some mac person
should comment this instead of me doing it (since I have no idea)
field_2_attributes = macshadow.setShortBoolean(field_2_attributes, mac);
|
public void | setStrikeout(boolean strike)set the font to be stricken out or not
field_2_attributes = strikeout.setShortBoolean(field_2_attributes, strike);
|
public void | setSuperSubScript(short sss)set the type of super or subscript for the font
field_5_super_sub_script = sss;
|
public void | setUnderline(byte u)set the type of underlining for the font
field_6_underline = u;
|
public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer.append("[FONT]\n");
buffer.append(" .fontheight = ")
.append(Integer.toHexString(getFontHeight())).append("\n");
buffer.append(" .attributes = ")
.append(Integer.toHexString(getAttributes())).append("\n");
buffer.append(" .italic = ").append(isItalic())
.append("\n");
buffer.append(" .strikout = ").append(isStruckout())
.append("\n");
buffer.append(" .macoutlined= ").append(isMacoutlined())
.append("\n");
buffer.append(" .macshadowed= ").append(isMacshadowed())
.append("\n");
buffer.append(" .colorpalette = ")
.append(Integer.toHexString(getColorPaletteIndex())).append("\n");
buffer.append(" .boldweight = ")
.append(Integer.toHexString(getBoldWeight())).append("\n");
buffer.append(" .supersubscript = ")
.append(Integer.toHexString(getSuperSubScript())).append("\n");
buffer.append(" .underline = ")
.append(Integer.toHexString(getUnderline())).append("\n");
buffer.append(" .family = ")
.append(Integer.toHexString(getFamily())).append("\n");
buffer.append(" .charset = ")
.append(Integer.toHexString(getCharset())).append("\n");
buffer.append(" .namelength = ")
.append(Integer.toHexString(getFontNameLength())).append("\n");
buffer.append(" .fontname = ").append(getFontName())
.append("\n");
buffer.append("[/FONT]\n");
return buffer.toString();
|
protected void | validateSid(short id)
if (id != sid)
{
throw new RecordFormatException("NOT A FONT RECORD");
}
|