APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.font

public final Class GlyphLayout

extends Object
Class Inheritance
Imports
java.lang.ref.SoftReference, java.awt.Font, java.awt.font.FontRenderContext, .GlyphVector, java.awt.geom.AffineTransform, .NoninvertibleTransformException, .Point2D, java.util.ArrayList, .WeakHashMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
GlyphLayout.EngineRecord

Utility class to keep track of script runs, which may have to be reordered rtl when we're finished.

public static class
GlyphLayout.GVData

Storage for layout to build glyph vector data, then generate a real GlyphVector

private static class

Field Summary

Modifier and TypeField and Description
private int
private ArrayList<GlyphLayout.EngineRecord>
private FontRunIterator
private GlyphLayout.GVData
private float[]
private int
private Point2D.Float
private ScriptRun
private FontStrikeDesc
private TextRecord
private int
private static volatile GlyphLayout

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
done(GlyphLayout gl)

Return the old instance of GlyphLayout when you are done.

public static GlyphLayout
get()

Return a possibly recycled instance of GlyphLayout

private void
init(int capacity)

public StandardGlyphVector

Returns:

the laid out glyphvector, if result was passed in, it is returned
layout
(Font
the font to use
font
,
FontRenderContext
the font render context
frc
,
char[]
the text, including optional context before start and after start + count
text
,
int
the start of the text to lay out
offset
,
int
the length of the text to lay out
count
,
int
bidi and context flags java.awt.Font
flags
,
StandardGlyphVector
a StandardGlyphVector to modify, can be null
result
)

Create a glyph vector.

private void
nextEngineRecord(int start, int limit, int script, Font2D font, int gmask)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_ercountback to summary
private int _ercount
_erecordsback to summary
private ArrayList<GlyphLayout.EngineRecord> _erecords
_fontRunsback to summary
private FontRunIterator _fontRuns
_gvdataback to summary
private GlyphLayout.GVData _gvdata
_matback to summary
private float[] _mat
_offsetback to summary
private int _offset
_ptback to summary
private Point2D.Float _pt
_scriptRunsback to summary
private ScriptRun _scriptRuns
_sdback to summary
private FontStrikeDesc _sd
_textRecordback to summary
private TextRecord _textRecord
_typo_flagsback to summary
private int _typo_flags
cacheback to summary
private static volatile GlyphLayout cache

Constructor Detail

GlyphLayoutback to summary
private GlyphLayout()

Method Detail

doneback to summary
public static void done(GlyphLayout gl)

Return the old instance of GlyphLayout when you are done. This enables reuse of GlyphLayout objects.

getback to summary
public static GlyphLayout get()

Return a possibly recycled instance of GlyphLayout

initback to summary
private void init(int capacity)
layoutback to summary
public StandardGlyphVector layout(Font font, FontRenderContext frc, char[] text, int offset, int count, int flags, StandardGlyphVector result)

Create a glyph vector.

Parameters
font:Font

the font to use

frc:FontRenderContext

the font render context

text:char[]

the text, including optional context before start and after start + count

offset:int

the start of the text to lay out

count:int

the length of the text to lay out

flags:int

bidi and context flags java.awt.Font

result:StandardGlyphVector

a StandardGlyphVector to modify, can be null

Returns:StandardGlyphVector

the laid out glyphvector, if result was passed in, it is returned

nextEngineRecordback to summary
private void nextEngineRecord(int start, int limit, int script, Font2D font, int gmask)
sun.font back to summary

private final Class GlyphLayout.EngineRecord

extends Object
Class Inheritance

Utility class to keep track of script runs, which may have to be reordered rtl when we're finished.

Field Summary

Modifier and TypeField and Description
private int
private Font2D
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
init(int start, int limit, Font2D font, int script, int gmask)

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

eflagsback to summary
private int eflags
fontback to summary
private Font2D font
gmaskback to summary
private int gmask
limitback to summary
private int limit
scriptback to summary
private int script
startback to summary
private int start

Constructor Detail

EngineRecordback to summary
pack-priv EngineRecord()

Method Detail

initback to summary
pack-priv void init(int start, int limit, Font2D font, int script, int gmask)
layoutback to summary
pack-priv void layout()
sun.font back to summary

public final Class GlyphLayout.GVData

extends Object
Class Inheritance

Storage for layout to build glyph vector data, then generate a real GlyphVector

Field Summary

Modifier and TypeField and Description
public int
public int
public int[]
public int[]
public float[]
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public StandardGlyphVector
public void
grow()

public void
grow(int delta)

public void
init(int size)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_countback to summary
public int _count
_flagsback to summary
public int _flags
_glyphsback to summary
public int[] _glyphs
_indicesback to summary
public int[] _indices
_positionsback to summary
public float[] _positions
UNINITIALIZED_FLAGSback to summary
private static final int UNINITIALIZED_FLAGS

Constructor Detail

GVDataback to summary
public GVData()

Method Detail

createGlyphVectorback to summary
public StandardGlyphVector createGlyphVector(Font font, FontRenderContext frc, StandardGlyphVector result)
growback to summary
public void grow()
growback to summary
public void grow(int delta)
initback to summary
public void init(int size)
sun.font back to summary

private final Class GlyphLayout.SDCache

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static SoftReference<WeakHashMap<GlyphLayout.SDCache.SDKey, GlyphLayout.SDCache>>
private final AffineTransform
private final FontStrikeDesc

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static GlyphLayout.SDCache
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheRefback to summary
private static SoftReference<WeakHashMap<GlyphLayout.SDCache.SDKey, GlyphLayout.SDCache>> cacheRef
ftxback to summary
private final AffineTransform ftx
sdback to summary
private final FontStrikeDesc sd

Constructor Detail

SDCacheback to summary
private SDCache(Font font, FontRenderContext frc)

Method Detail

getback to summary
public static GlyphLayout.SDCache get(Font font, FontRenderContext frc)
sun.font back to summary

private final Class GlyphLayout.SDCache.SDKey

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Font
private final FontRenderContext
private final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object o)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

fontback to summary
private final Font font
frcback to summary
private final FontRenderContext frc
hashback to summary
private final int hash

Constructor Detail

SDKeyback to summary
pack-priv SDKey(Font font, FontRenderContext frc)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.