/*
* 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.
*/
static boolean longAddresses;
static {
switch (StrikeCache.nativeAddressSize) {
case 8: longAddresses = true; break;
case 4: longAddresses = false; break;
default: throw new RuntimeException("Unexpected address size");
}
}
/* the ScalerContext is a native structure pre-filled with the
* info needed to setup the scaler for this strike. Its immutable
* so we set it up when the strike is created and free it when the
* strike is disposed. There's then no need to pass the info down
* separately to native on every call to the scaler.
*/
protected long pScalerContext;
/* Only one of these two arrays is non-null.
* use the one that matches size of an address (32 or 64 bits)
*/
protected long[] longGlyphImages;
protected int[] intGlyphImages;
/* Used by the TrueTypeFont subclass, which is the only client
* of getGlyphPoint(). The field and method are here because
* there is no TrueTypeFontStrike subclass.
* This map is a cache of the positions of points on the outline
* of a TrueType glyph. It is used by the OpenType layout engine
* to perform mark positioning. Without this cache every position
* request involves scaling and hinting the glyph outline potentially
* over and over again.
*/
protected boolean getImageWithAdvance;
protected static final int complexTX =
this.physicalFont = physicalFont;
}
protected PhysicalStrike() {
}
/* A number of methods are delegated by the strike to the scaler
* context which is a shared resource on a physical font.
*/
public int getNumGlyphs() {
return physicalFont.getNumGlyphs();
}
/* These 3 metrics methods below should be implemented to return
* values in user space.
*/
if (strikeMetrics == null) {
}
return strikeMetrics;
}
}
}
return 0;
}
/* Used by the OpenType engine for mark positioning.
*/
if (glyphPointMapCache == null) {
synchronized (this) {
if (glyphPointMapCache == null) {
}
}
} else {
}
}
return gp;
}
}
}