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