Class Os2
- java.lang.Object
-
- com.adobe.fontengine.font.opentype.Table
-
- com.adobe.fontengine.font.opentype.Os2
-
public final class Os2 extends Table
Gives access to the 'OS/2' table.Version handling
'OS/2' tables have only a minor version number. This implementation:
- fully supports version 0, 1, 2 and 3 tables,
- interprets version x > 3 tables as version 3 tables,
When some data is not present in the actual version of the table, the accessors return identified values.
Synchronization
Like all tables, these objects are immutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOs2.CodePageIdentifies a code page.static interfaceOs2.SelectionBitsstatic classOs2.UnicodeRangeIdentifies a Unicode range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCapHeight()Get the sCapHeight.EmbeddingPermission.OutlineRestrictiongetEmbeddingOutlineRestriction()Get the outline restriction for embedding, using the constants inEmbeddingPermission.PermissiongetEmbeddingPermission()Get the embedding permission for the font, using the constants inEmbeddingPermission.EmbeddingPermission.SubsettingRestrictiongetEmbeddingSubsettingRestriction()Get the subsetting restriction for embedding, using the constants inEmbeddingPermission.intgetFirstChar()intgetLastChar()LineMetricsgetLineMetrics()Return the line metrics for this font.intgetSelection()Get the fsSelection of this table.intgetTableVersion()Get the version of this table.intgetTypoAscender()Get the sTypoAscender of this table.intgetTypoDescender()Get the sTypoDescender of this table.intgetTypoLineGap()Get the sTypoLineGap of this table.longgetVendor()Get the vendor.intgetWeightClass()Get the usWeight of this table.intgetWidthClass()Get the usWidth of this table.intgetWinAscent()Get the usWinAscent of this table.intgetWinDescent()Get the usWinDescent of this table.intgetxHeight()Get the sxHeight.intpanoseIndicatesProportional()voidstream(Map tables)voidsubsetAndStream(Subset subset, Map tables)booleansupportsCodePage(Os2.CodePage cp)Determine if a code page is supported.booleansupportsUnicodeRange(Os2.UnicodeRange cp)Determine if a Unicode range is supported.
-
-
-
Method Detail
-
getTableVersion
public int getTableVersion() throws InvalidFontExceptionGet the version of this table.- Throws:
InvalidFontException
-
getWeightClass
public int getWeightClass() throws InvalidFontExceptionGet the usWeight of this table.- Throws:
InvalidFontException
-
getWidthClass
public int getWidthClass() throws InvalidFontExceptionGet the usWidth of this table.- Throws:
InvalidFontException
-
panoseIndicatesProportional
public int panoseIndicatesProportional() throws InvalidFontException- Returns:
- 0 if panose indicates the font is fixed pitch; 1 if it indicates proportional; -1 if don't know
- Throws:
InvalidFontException
-
getSelection
public int getSelection() throws InvalidFontExceptionGet the fsSelection of this table.- Throws:
InvalidFontException
-
getFirstChar
public int getFirstChar() throws InvalidFontException- Throws:
InvalidFontException
-
getLastChar
public int getLastChar() throws InvalidFontException- Throws:
InvalidFontException
-
getTypoAscender
public int getTypoAscender() throws InvalidFontExceptionGet the sTypoAscender of this table.- Throws:
InvalidFontException
-
getTypoDescender
public int getTypoDescender() throws InvalidFontExceptionGet the sTypoDescender of this table.- Throws:
InvalidFontException
-
getTypoLineGap
public int getTypoLineGap() throws InvalidFontExceptionGet the sTypoLineGap of this table.- Throws:
InvalidFontException
-
getWinAscent
public int getWinAscent() throws InvalidFontExceptionGet the usWinAscent of this table.- Throws:
InvalidFontException
-
getWinDescent
public int getWinDescent() throws InvalidFontExceptionGet the usWinDescent of this table.- Throws:
InvalidFontException
-
getLineMetrics
public LineMetrics getLineMetrics() throws UnsupportedFontException, InvalidFontException
Return the line metrics for this font. The metrics are expressed in the design space of the font, i.e. they need to be converted through the metrics matrix. Some font formats do not support the notion of line metrics, and in those cases, this method returns null.
-
getVendor
public long getVendor() throws InvalidFontExceptionGet the vendor.- Throws:
InvalidFontException
-
getxHeight
public int getxHeight() throws InvalidFontExceptionGet the sxHeight.- Returns:
- the value of the sCapHeight field if present, Integer.MAX_VALUE otherwise.
- Throws:
InvalidFontException
-
getCapHeight
public int getCapHeight() throws InvalidFontExceptionGet the sCapHeight.- Returns:
- the value of the sCapHeight field if present, Integer.MAX_VALUE otherwise.
- Throws:
InvalidFontException
-
supportsUnicodeRange
public boolean supportsUnicodeRange(Os2.UnicodeRange cp) throws InvalidFontException
Determine if a Unicode range is supported. For some ranges, some versions of the OS/2 table do not expressed whether it is supported.- Returns:
- true iff the Unicode range is expressed and is supported.
- Throws:
InvalidFontException
-
supportsCodePage
public boolean supportsCodePage(Os2.CodePage cp) throws InvalidFontException
Determine if a code page is supported. For some code pages, some versions of the OS/2 table do not expressed whether it is supported.- Returns:
- true iff the code page is expressed and is supported.
- Throws:
InvalidFontException
-
getEmbeddingPermission
public Permission getEmbeddingPermission() throws InvalidFontException
Get the embedding permission for the font, using the constants inEmbeddingPermission.- Returns:
- one of RESTRICTED, PREVIEW_AND_PRINT, EDITABLE, INSTALLABLE or ILLEGAL_VALUE
- Throws:
InvalidFontException
-
getEmbeddingSubsettingRestriction
public EmbeddingPermission.SubsettingRestriction getEmbeddingSubsettingRestriction() throws InvalidFontException
Get the subsetting restriction for embedding, using the constants inEmbeddingPermission.- Returns:
- one of FULL_FONT_ONLY, SUBSETTING_OK or UNKNOWN_SUBSETTING_RESTRICTION
- Throws:
InvalidFontException
-
getEmbeddingOutlineRestriction
public EmbeddingPermission.OutlineRestriction getEmbeddingOutlineRestriction() throws InvalidFontException
Get the outline restriction for embedding, using the constants inEmbeddingPermission.- Returns:
- one of BITMAP_ONLY, OUTLINES_OK or UNKNOWN_OUTLINE_RESTRICTION
- Throws:
InvalidFontException
-
stream
public void stream(Map tables)
-
-