下面列出了java.awt.font.GlyphVector#getFont ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}
/**
* Utility used by getStandardGV.
* Constructs a StandardGlyphVector from a generic glyph vector.
* Do not call this from new contexts without considering the comment
* about "userGlyphs".
*/
private StandardGlyphVector(GlyphVector gv, FontRenderContext frc) {
this.font = gv.getFont();
this.frc = frc;
initFontData();
int nGlyphs = gv.getNumGlyphs();
this.userGlyphs = gv.getGlyphCodes(0, nGlyphs, null);
if (gv instanceof StandardGlyphVector) {
/* userGlyphs will be OK because this is a private constructor
* and the returned instance is used only for rendering.
* It's not constructable by user code, nor returned to the
* application. So we know "userGlyphs" are valid as having
* been either already validated or are the result of layout.
*/
this.glyphs = userGlyphs;
} else {
this.glyphs = getValidatedGlyphs(this.userGlyphs);
}
this.flags = gv.getLayoutFlags() & FLAG_MASK;
if ((flags & FLAG_HAS_POSITION_ADJUSTMENTS) != 0) {
this.positions = gv.getGlyphPositions(0, nGlyphs + 1, null);
}
if ((flags & FLAG_COMPLEX_GLYPHS) != 0) {
this.charIndices = gv.getGlyphCharIndices(0, nGlyphs, null);
}
if ((flags & FLAG_HAS_TRANSFORMS) != 0) {
AffineTransform[] txs = new AffineTransform[nGlyphs]; // worst case
for (int i = 0; i < nGlyphs; ++i) {
txs[i] = gv.getGlyphTransform(i); // gv doesn't have getGlyphsTransforms
}
setGlyphTransforms(txs);
}
}