public final class Panose extends Object implements Serializable
References:
Modifier and Type | Class and Description |
---|---|
static class |
Panose.Field
Enumeration of the fields that comprise a PANOSE description.
|
Modifier and Type | Method and Description |
---|---|
long |
difference(Panose otherPanose,
byte[] weights)
Computes the weighted "closeness" of another Panose to this value.
|
static Panose |
forceInstance(byte[] panoseArray)
Creates a new Panose instance without any error checking.
|
Panose |
getBold()
Returns the bold version of this Panose instance.
|
byte |
getElement(int index)
Returns a given element from the underlying Panose array.
|
byte |
getElement(Panose.Field field)
Returns a given element from the underlying Panose array.
|
Panose |
getItalic()
Returns the italic version of this Panose instance.
|
byte[] |
getPanoseArray()
Returns a clone of the the array of bytes representing the PANOSE number.
|
static Panose |
makeInstance(byte[] panoseArray)
Creates a new Panose instance, first checking it for validity.
|
String |
toString() |
static String |
validPanose(byte[] panoseDescription)
Tests the validity of a panose description.
|
public static Panose makeInstance(byte[] panoseArray)
panoseArray
- The array of bytes recording the PANOSE
classification.FontException
- If panoseArray
contains an illegal value.forceInstance(byte[])
public static Panose forceInstance(byte[] panoseArray)
panoseArray
- The array of bytes recording the PANOSE classification.makeInstance(byte[])
public byte[] getPanoseArray()
getElement(int)
to obtain the
value of individual elements in the array.public byte getElement(int index)
index
- The index to the element desired.index
.public byte getElement(Panose.Field field)
field
- The field for which the value is desired.field
.public long difference(Panose otherPanose, byte[] weights)
otherPanose
- Another Panose instance which is being compared to this.weights
- 10-element byte array of weights that should be used for each of the elements
in the comparison.
Values in this array must be between 0 and 127 inclusive.
(This constant is documented at http://www.w3.org/Fonts/Panose/pan2.html#StaticDigits).
Use null if all elements are to be weighted equally.public static String validPanose(byte[] panoseDescription)
panoseDescription
- The panose values to be tested.public Panose getBold()
public Panose getItalic()
Copyright © 2007-2019. All Rights Reserved.