/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
int numGlyphs;
/* The following method prepares data used in obtaining FontMetrics.
* This is the one case in which we allow anything other than a
* simple scale to be used with a native font. We do this because in
* order to ensure that clients get the overall metrics they expect
* for a font whatever coordinate system (combination of font and
* device transform) they use.
* X11 fonts can only have a scale applied (remind : non-uniform?)
* We strip out everything else and if necessary obtain an inverse
* tx which we use to return metrics for the font in the transformed
* coordinate system of the font. ie we pass X11 a simple scale, and
* then apply the non-scale part of the font TX to that result.
*/
private int getNativePointSize() {
/* Make a copy of the glyphTX in which we will store the
* font transform, inverting the devTx if necessary
*/
double[] mat = new double[4];
/* Now work backwards to get the font transform */
try {
} catch (NoninvertibleTransformException e) {
e.printStackTrace();
}
}
/* At this point the fontTx may be a simple +ve scale, or it
* may be something more complex.
*/
/* We need to create an inverse transform that doesn't
* include the point size (strictly the uniform scale)
*/
} else {
}
return (int)ptSize;
}
super(nativeFont, desc);
this.nativeFont = nativeFont;
/* If this is a delegate for bitmaps, we expect to have
* been invoked only for a simple scale. If that's not
* true, just bail
*/
if (nativeFont.isBitmapDelegate) {
numGlyphs = 0;
return;
}
}
int ptSize = getNativePointSize();
if (pScalerContext == 0L) {
numGlyphs = 0;
if (FontUtilities.isLogging()) {
.severe("Could not create native strike " +
}
return;
}
}
/* The asymmetry of the following methods is to help preserve
* performance with minimal textual changes to the calling code
* when moving initialisation of these arrays out of the constructor.
* This may be restructured later when there's more room for changes
*/
private boolean usingIntGlyphImages() {
if (intGlyphImages != null) {
return true;
} else if (longAddresses) {
return false;
} else {
/* We could obtain minGlyphIndex and index relative to that
* if we need to save space.
*/
/* This shouldn't be necessary - its a precaution */
if (glyphLenArray < numGlyphs) {
}
intGlyphImages = new int[glyphLenArray];
return true;
}
}
private long[] getLongGlyphImages() {
/* We could obtain minGlyphIndex and index relative to that
* if we need to save space.
*/
/* This shouldn't be necessary - its a precaution */
if (glyphLenArray < numGlyphs) {
}
longGlyphImages = new long[glyphLenArray];
}
return longGlyphImages;
}
boolean nocache) {
super(nativeFont, desc);
this.nativeFont = nativeFont;
}
/* We want the native font to be responsible for reporting the
* font metrics, even if it often delegates to another font.
* The code here isn't yet implementing exactly that. If the glyph
* transform was something native couldn't handle, there's no native
* context from which to obtain metrics. Need to revise this to obtain
* the metrics and transform them. But currently in such a case it
* gets the metrics from a different font - its glyph delegate font.
*/
if (strikeMetrics == null) {
if (pScalerContext != 0) {
}
}
}
return strikeMetrics;
}
private native long createNullScalerContext();
for (int i=0; i<len; i++) {
}
}
long glyphPtr;
if (usingIntGlyphImages()) {
return glyphPtr;
} else {
/* Synchronize in case some other thread has updated this
* cache entry already - unlikely but possible.
*/
synchronized (this) {
return glyphPtr;
} else {
}
}
}
}
/* must be using long (8 byte) addresses */
return glyphPtr;
} else {
synchronized (this) {
return glyphPtr;
} else {
return longGlyphImages[glyphCode];
}
}
}
}
/* This is used when a FileFont uses the native names to create a
* delegate NativeFont/Strike to get images from native. This is used
* because Solaris TrueType fonts have external PCF bitmaps rather than
* embedded bitmaps. This is really only important for CJK fonts as
* for most scripts the external X11 bitmaps aren't much better - if
* at all - than the results from hinting the outlines.
*/
}
}
return pt;
}
}
}
return new GeneralPath();
}
return new GeneralPath();
}
}
/* Returned instead of a NativeStrike.
* It can intercept any request it wants, but mostly
* passes them on to its delegate strike. It is important that
* it override all the inherited FontStrike methods to delegate them
* appropriately.
*/
super(nativeFont, desc);
this.delegateStrike = delegate;
}
/* We want the native font to be responsible for reporting the
* font metrics, even if it often delegates to another font.
* The code here isn't yet implementing exactly that. If the glyph
* transform was something native couldn't handle, there's no native
* context from which to obtain metrics. Need to revise this to obtain
* the metrics and transform them. But currently in such a case it
* gets the metrics from a different font - its glyph delegate font.
*/
if (strikeMetrics == null) {
if (pScalerContext != 0) {
strikeMetrics = super.getFontMetrics();
}
if (strikeMetrics == null) {
}
}
return strikeMetrics;
}
}
}
}
}
}
}
cp = 0xffff;
}
}
}
}
}
}