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
public class HwmfFont extends Object implements FontInfo, GenericRecord
The Font object specifies the attributes of a logical font
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHwmfFont.WmfClipPrecisionClipPrecision Flags specify clipping precision, which defines how to clip characters that are partially outside a clipping region.static classHwmfFont.WmfFontQualityThe output quality defines how carefully to attempt to match the logical font attributes to those of an actual physical font.static classHwmfFont.WmfOutPrecisionThe output precision defines how closely the output must match the requested font's height, width, character orientation, escapement, pitch, and font type.
-
Field Summary
Fields Modifier and Type Field Description protected FontCharsetcharSetAn 8-bit unsigned integer that defines the character set.protected HwmfFont.WmfClipPrecisionclipPrecisionAn 8-bit unsigned integer that defines the clipping precision.protected intescapementA 16-bit signed integer that defines the angle, in tenths of degrees, between the escapement vector and the x-axis of the device.protected StringfacenameA null-terminated string of 8-bit Latin-1 [ISO/IEC-8859-1] ANSI characters that specifies the typeface name of the font.protected FontFamilyfamilyFont 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 doubleheightA 16-bit signed integer that specifies the height, in logical units, of the font's character cell.protected booleanitalicA 8-bit Boolean value that specifies the italic attribute of the font.protected intorientationA 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.WmfOutPrecisionoutPrecisionAn 8-bit unsigned integer that defines the output precision.protected FontPitchpitchA property of a font that describes the pitch (MSB 2 bits)protected intpitchAndFamilyA PitchAndFamily object that defines the pitch and the family of the font.protected HwmfFont.WmfFontQualityqualityAn 8-bit unsigned integer that defines the output quality.protected booleanstrikeOutAn 8-bit Boolean value that specifies the strike out attribute of the font.protected booleanunderlineAn 8-bit Boolean value that specifies the underline attribute of the font.protected intweightA 16-bit signed integer that defines the weight of the font in the range 0 through 1000.protected intwidthA 16-bit signed integer that defines the average width, in logical units, of characters in the font.
-
Constructor Summary
Constructors Constructor Description HwmfFont()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontCharsetgetCharset()HwmfFont.WmfClipPrecisiongetClipPrecision()intgetEscapement()FontFamilygetFamily()Map<String,Supplier<?>>getGenericProperties()doublegetHeight()intgetOrientation()HwmfFont.WmfOutPrecisiongetOutPrecision()FontPitchgetPitch()intgetPitchAndFamily()HwmfFont.WmfFontQualitygetQuality()StringgetTypeface()intgetWeight()intgetWidth()intinit(LittleEndianInputStream leis, long recordSize)voidinitDefaults()booleanisItalic()booleanisStrikeOut()booleanisUnderline()protected intreadString(LittleEndianInputStream leis, StringBuilder sb, int limit)protected intreadString(LittleEndianInputStream leis, StringBuilder sb, int limit, Charset charset)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.fonts.FontInfo
getFacets, getIndex, getPanose, setCharset, setFamily, setIndex, setPanose, setPitch, setTypeface
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren, getGenericRecordType
-
-
-
-
Field Detail
-
height
protected double height
A 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 width
A 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 escapement
A 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 orientation
A 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 weight
A 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 italic
A 8-bit Boolean value that specifies the italic attribute of the font. 0 = not italic / 1 = italic.
-
underline
protected boolean underline
An 8-bit Boolean value that specifies the underline attribute of the font. 0 = not underlined / 1 = underlined
-
strikeOut
protected boolean strikeOut
An 8-bit Boolean value that specifies the strike out attribute of the font. 0 = not striked out / 1 = striked out
-
charSet
protected FontCharset 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
protected HwmfFont.WmfOutPrecision outPrecision
An 8-bit unsigned integer that defines the output precision.
-
clipPrecision
protected final HwmfFont.WmfClipPrecision clipPrecision
An 8-bit unsigned integer that defines the clipping precision. These flags can be combined to specify multiple options.- See Also:
HwmfFont.WmfClipPrecision
-
quality
protected HwmfFont.WmfFontQuality quality
An 8-bit unsigned integer that defines the output quality.
-
pitchAndFamily
protected int pitchAndFamily
A 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
protected FontFamily 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
protected FontPitch pitch
A property of a font that describes the pitch (MSB 2 bits)
-
facename
protected String 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.
-
-
Method Detail
-
init
public int init(LittleEndianInputStream leis, long recordSize) throws IOException
- 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
public HwmfFont.WmfOutPrecision getOutPrecision()
-
getClipPrecision
public HwmfFont.WmfClipPrecision getClipPrecision()
-
getQuality
public HwmfFont.WmfFontQuality getQuality()
-
getPitchAndFamily
public int getPitchAndFamily()
-
getFamily
public FontFamily getFamily()
-
getTypeface
public String getTypeface()
- Specified by:
getTypefacein interfaceFontInfo
-
getCharset
public FontCharset getCharset()
- Specified by:
getCharsetin interfaceFontInfo
-
readString
protected int readString(LittleEndianInputStream leis, StringBuilder sb, int limit)
-
readString
protected int readString(LittleEndianInputStream leis, StringBuilder sb, int limit, Charset charset)
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericPropertiesin interfaceGenericRecord
-
-