Package org.apache.poi.hslf.record
Class FontEntityAtom
java.lang.Object
org.apache.poi.hslf.record.Record
org.apache.poi.hslf.record.RecordAtom
org.apache.poi.hslf.record.FontEntityAtom
This atom corresponds exactly to a Windows Logical Font (LOGFONT) structure.
It keeps all the information needed to define the attributes of a font,
such as height, width, etc. For more information, consult the
Windows API Programmer's reference.
- Author:
- Yegor Kozlov
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a new instance ofFontEntityAtomprotectedFontEntityAtom(byte[] source, int start, int len) Build an instance ofFontEntityAtomfrom on-disk data -
Method Summary
Modifier and TypeMethodDescriptionintget the character setintget the character set Bit 1: If set, font is subsettedintA null-terminated string that specifies the typeface name of the font.intget the font typeintget lfPitchAndFamilylongReturns the type (held as a little endian in bytes 3 and 4) that this class handlesvoidsetCharSet(int charset) set the character setvoidsetFontFlags(int flags) set the font flags Bit 1: If set, font is subsettedvoidsetFontIndex(int idx) voidsetFontName(String name) Set the name of the font.voidsetFontType(int type) set the font typevoidsetPitchAndFamily(int val) set lfPitchAndFamilyvoidwriteOut(OutputStream out) Write the contents of the record back, so it can be written to diskMethods inherited from class org.apache.poi.hslf.record.RecordAtom
getChildRecords, isAnAtomMethods inherited from class org.apache.poi.hslf.record.Record
buildRecordAtOffset, createRecordForType, findChildRecords, writeLittleEndian, writeLittleEndian
-
Constructor Details
-
FontEntityAtom
protected FontEntityAtom(byte[] source, int start, int len) Build an instance ofFontEntityAtomfrom on-disk data -
FontEntityAtom
public FontEntityAtom()Create a new instance ofFontEntityAtom
-
-
Method Details
-
getRecordType
public long getRecordType()Description copied from class:RecordReturns the type (held as a little endian in bytes 3 and 4) that this class handles- Specified by:
getRecordTypein classRecord
-
getFontName
A null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 32 characters including the null terminator.- Returns:
- font name
-
setFontName
Set the name of the font. The length of this string must not exceed 32 characters including the null terminator. Will be converted to null-terminated if not already- Parameters:
name- of the font
-
setFontIndex
public void setFontIndex(int idx) -
getFontIndex
public int getFontIndex() -
setCharSet
public void setCharSet(int charset) set the character set- Parameters:
charset- - characterset
-
getCharSet
public int getCharSet()get the character set- Returns:
- charset - characterset
-
setFontFlags
public void setFontFlags(int flags) set the font flags Bit 1: If set, font is subsetted- Parameters:
flags- - the font flags
-
getFontFlags
public int getFontFlags()get the character set Bit 1: If set, font is subsetted- Returns:
- the font flags
-
setFontType
public void setFontType(int type) set the font typeBit 1: Raster Font Bit 2: Device Font Bit 3: TrueType Font
- Parameters:
type- - the font type
-
getFontType
public int getFontType()get the font typeBit 1: Raster Font Bit 2: Device Font Bit 3: TrueType Font
- Returns:
- the font type
-
setPitchAndFamily
public void setPitchAndFamily(int val) set lfPitchAndFamily- Parameters:
val- - Corresponds to the lfPitchAndFamily field of the Win32 API LOGFONT structure
-
getPitchAndFamily
public int getPitchAndFamily()get lfPitchAndFamily- Returns:
- corresponds to the lfPitchAndFamily field of the Win32 API LOGFONT structure
-
writeOut
Write the contents of the record back, so it can be written to disk- Specified by:
writeOutin classRecord- Throws:
IOException
-