Class Os2
java.lang.Object
com.adobe.fontengine.font.opentype.Table
com.adobe.fontengine.font.opentype.Os2
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 ClassesModifier and TypeClassDescriptionstatic final classIdentifies a code page.static interfacestatic final classIdentifies a Unicode range. -
Method Summary
Modifier and TypeMethodDescriptionintGet the sCapHeight.Get the outline restriction for embedding, using the constants inEmbeddingPermission.Get the embedding permission for the font, using the constants inEmbeddingPermission.Get the subsetting restriction for embedding, using the constants inEmbeddingPermission.intintReturn the line metrics for this font.intGet the fsSelection of this table.intGet the version of this table.intGet the sTypoAscender of this table.intGet the sTypoDescender of this table.intGet the sTypoLineGap of this table.longGet the vendor.intGet the usWeight of this table.intGet the usWidth of this table.intGet the usWinAscent of this table.intGet the usWinDescent of this table.intGet the sxHeight.intvoidvoidsubsetAndStream(Subset subset, Map tables) booleanDetermine if a code page is supported.booleanDetermine if a Unicode range is supported.
-
Method Details
-
getTableVersion
Get the version of this table.- Throws:
InvalidFontException
-
getWeightClass
Get the usWeight of this table.- Throws:
InvalidFontException
-
getWidthClass
Get the usWidth of this table.- Throws:
InvalidFontException
-
panoseIndicatesProportional
- Returns:
- 0 if panose indicates the font is fixed pitch; 1 if it indicates proportional; -1 if don't know
- Throws:
InvalidFontException
-
getSelection
Get the fsSelection of this table.- Throws:
InvalidFontException
-
getFirstChar
- Throws:
InvalidFontException
-
getLastChar
- Throws:
InvalidFontException
-
getTypoAscender
Get the sTypoAscender of this table.- Throws:
InvalidFontException
-
getTypoDescender
Get the sTypoDescender of this table.- Throws:
InvalidFontException
-
getTypoLineGap
Get the sTypoLineGap of this table.- Throws:
InvalidFontException
-
getWinAscent
Get the usWinAscent of this table.- Throws:
InvalidFontException
-
getWinDescent
Get the usWinDescent of this table.- Throws:
InvalidFontException
-
getLineMetrics
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
Get the vendor.- Throws:
InvalidFontException
-
getxHeight
Get the sxHeight.- Returns:
- the value of the sCapHeight field if present, Integer.MAX_VALUE otherwise.
- Throws:
InvalidFontException
-
getCapHeight
Get the sCapHeight.- Returns:
- the value of the sCapHeight field if present, Integer.MAX_VALUE otherwise.
- Throws:
InvalidFontException
-
supportsUnicodeRange
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
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
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 InvalidFontExceptionGet 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 InvalidFontExceptionGet the outline restriction for embedding, using the constants inEmbeddingPermission.- Returns:
- one of BITMAP_ONLY, OUTLINES_OK or UNKNOWN_OUTLINE_RESTRICTION
- Throws:
InvalidFontException
-
subsetAndStream
-
stream
-