Package org.apache.poi.hwmf.record
Class HwmfFont
java.lang.Object
org.apache.poi.hwmf.record.HwmfFont
- All Implemented Interfaces:
FontInfo,GenericRecord
- Direct Known Subclasses:
HemfFont
The Font object specifies the attributes of a logical font
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClipPrecision Flags specify clipping precision, which defines how to clip characters that are partially outside a clipping region.static enumThe output quality defines how carefully to attempt to match the logical font attributes to those of an actual physical font.static enumThe output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, pitch, and font type. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FontCharsetAn 8-bit unsigned integer that defines the character set.protected final HwmfFont.WmfClipPrecisionAn 8-bit unsigned integer that defines the clipping precision.protected intA 16-bit signed integer that defines the angle, in tenths of degrees, between the escapement vector and the x-axis of the device.protected StringA null-terminated string of 8-bit Latin-1 [ISO/IEC-8859-1] ANSI characters that specifies the typeface name of the font.protected FontFamilyFont families specify the look of fonts in a general way and are intended for specifying fonts when the exact typeface wanted is not available.protected doubleA 16-bit signed integer that specifies the height, in logical units, of the font's character cell.protected booleanA 8-bit Boolean value that specifies the italic attribute of the font.protected intA 16-bit signed integer that defines the angle, in tenths of degrees, between each character's base line and the x-axis of the device.protected HwmfFont.WmfOutPrecisionAn 8-bit unsigned integer that defines the output precision.protected FontPitchA property of a font that describes the pitch (MSB 2 bits)protected intA PitchAndFamily object that defines the pitch and the family of the font.protected HwmfFont.WmfFontQualityAn 8-bit unsigned integer that defines the output quality.protected booleanAn 8-bit Boolean value that specifies the strike out attribute of the font.protected booleanAn 8-bit Boolean value that specifies the underline attribute of the font.protected intA 16-bit signed integer that defines the weight of the font in the range 0 through 1000.protected intA 16-bit signed integer that defines the average width, in logical units, of characters in the font. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdoubleintgetPitch()intintintgetWidth()intinit(LittleEndianInputStream leis, long recordSize) voidbooleanisItalic()booleanbooleanprotected intreadString(LittleEndianInputStream leis, StringBuilder sb, int limit) protected intreadString(LittleEndianInputStream leis, StringBuilder sb, int limit, Charset charset) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.poi.common.usermodel.fonts.FontInfo
getFacets, getIndex, getPanose, setCharset, setFamily, setIndex, setPanose, setPitch, setTypefaceMethods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
Field Details
-
height
protected double heightA 16-bit signed integer that specifies the height, in logical units, of the font's character cell. The character height is computed as the character cell height minus the internal leading. The font mapper SHOULD interpret the height as follows. negative value: The font mapper SHOULD transform this value into device units and match its absolute value against the character height of available fonts. zero value: A default height value MUST be used when creating a physical font. positive value: The font mapper SHOULD transform this value into device units and match it against the cell height of available fonts. For all height comparisons, the font mapper SHOULD find the largest physical font that does not exceed the requested size. -
width
protected int widthA 16-bit signed integer that defines the average width, in logical units, of characters in the font. If Width is 0x0000, the aspect ratio of the device SHOULD be matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference. -
escapement
protected int escapementA 16-bit signed integer that defines the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text. -
orientation
protected int orientationA 16-bit signed integer that defines the angle, in tenths of degrees, between each character's base line and the x-axis of the device. -
weight
protected int weightA 16-bit signed integer that defines the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is 0x0000, a default weight SHOULD be used. -
italic
protected boolean italicA 8-bit Boolean value that specifies the italic attribute of the font. 0 = not italic / 1 = italic. -
underline
protected boolean underlineAn 8-bit Boolean value that specifies the underline attribute of the font. 0 = not underlined / 1 = underlined -
strikeOut
protected boolean strikeOutAn 8-bit Boolean value that specifies the strike out attribute of the font. 0 = not striked out / 1 = striked out -
charSet
An 8-bit unsigned integer that defines the character set. It SHOULD be set to a value in theFontCharsetEnumeration. The DEFAULT_CHARSET value MAY be used to allow the name and size of a font to fully describe the logical font. If the specified font name does not exist, a font in another character set MAY be substituted. The DEFAULT_CHARSET value is set to a value based on the current system locale. For example, when the system locale is United States, it is set to ANSI_CHARSET. If a typeface name in the FaceName field is specified, the CharSet value MUST match the character set of that typeface. -
outPrecision
An 8-bit unsigned integer that defines the output precision. -
clipPrecision
An 8-bit unsigned integer that defines the clipping precision. These flags can be combined to specify multiple options.- See Also:
-
quality
An 8-bit unsigned integer that defines the output quality. -
pitchAndFamily
protected int pitchAndFamilyA PitchAndFamily object that defines the pitch and the family of the font. Font families specify the look of fonts in a general way and are intended for specifying fonts when the exact typeface wanted is not available. -
family
Font families specify the look of fonts in a general way and are intended for specifying fonts when the exact typeface wanted is not available. (LSB 4 bits) -
pitch
A property of a font that describes the pitch (MSB 2 bits) -
facename
A null-terminated string of 8-bit Latin-1 [ISO/IEC-8859-1] ANSI characters that specifies the typeface name of the font. The length of this string MUST NOT exceed 32 8-bit characters, including the terminating null.
-
-
Constructor Details
-
HwmfFont
public HwmfFont()
-
-
Method Details
-
init
- Throws:
IOException
-
initDefaults
public void initDefaults() -
getHeight
public double getHeight() -
getWidth
public int getWidth() -
getEscapement
public int getEscapement() -
getOrientation
public int getOrientation() -
getWeight
public int getWeight() -
isItalic
public boolean isItalic() -
isUnderline
public boolean isUnderline() -
isStrikeOut
public boolean isStrikeOut() -
getOutPrecision
-
getClipPrecision
-
getQuality
-
getPitchAndFamily
public int getPitchAndFamily() -
getFamily
-
getPitch
-
getTypeface
- Specified by:
getTypefacein interfaceFontInfo- Returns:
- the full name of the font, i.e. font family + type face
-
getCharset
- Specified by:
getCharsetin interfaceFontInfo- Returns:
- the font charset
-
toString
-
readString
-
readString
protected int readString(LittleEndianInputStream leis, StringBuilder sb, int limit, Charset charset) -
getGenericProperties
- Specified by:
getGenericPropertiesin interfaceGenericRecord
-