19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package sun.font;
27
28 import java.awt.Font;
29 import java.awt.geom.AffineTransform;
30 import java.awt.geom.GeneralPath;
31 import java.awt.geom.Point2D;
32 import java.awt.geom.Rectangle2D;
33 import java.util.concurrent.ConcurrentHashMap;
34
35
36 public abstract class PhysicalStrike extends FontStrike {
37
38 static final long INTMASK = 0xffffffffL;
39
40 private PhysicalFont physicalFont;
41 protected CharToGlyphMapper mapper;
42 /* the ScalerContext is a native structure pre-filled with the
43 * info needed to setup the scaler for this strike. Its immutable
44 * so we set it up when the strike is created and free it when the
45 * strike is disposed. There's then no need to pass the info down
46 * separately to native on every call to the scaler.
47 */
48 protected long pScalerContext;
49
50 /* Only one of these two arrays is non-null.
51 * use the one that matches size of an address (32 or 64 bits)
52 */
53 protected long[] longGlyphImages;
54 protected int[] intGlyphImages;
55
56 /* Used by the TrueTypeFont subclass, which is the only client
57 * of getGlyphPoint(). The field and method are here because
58 * there is no TrueTypeFontStrike subclass.
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package sun.font;
27
28 import java.awt.Font;
29 import java.awt.geom.AffineTransform;
30 import java.awt.geom.GeneralPath;
31 import java.awt.geom.Point2D;
32 import java.awt.geom.Rectangle2D;
33 import java.util.concurrent.ConcurrentHashMap;
34
35
36 public abstract class PhysicalStrike extends FontStrike {
37
38 static final long INTMASK = 0xffffffffL;
39 static boolean longAddresses;
40 static {
41 switch (StrikeCache.nativeAddressSize) {
42 case 8: longAddresses = true; break;
43 case 4: longAddresses = false; break;
44 default: throw new RuntimeException("Unexpected address size");
45 }
46 }
47
48 private PhysicalFont physicalFont;
49 protected CharToGlyphMapper mapper;
50 /* the ScalerContext is a native structure pre-filled with the
51 * info needed to setup the scaler for this strike. Its immutable
52 * so we set it up when the strike is created and free it when the
53 * strike is disposed. There's then no need to pass the info down
54 * separately to native on every call to the scaler.
55 */
56 protected long pScalerContext;
57
58 /* Only one of these two arrays is non-null.
59 * use the one that matches size of an address (32 or 64 bits)
60 */
61 protected long[] longGlyphImages;
62 protected int[] intGlyphImages;
63
64 /* Used by the TrueTypeFont subclass, which is the only client
65 * of getGlyphPoint(). The field and method are here because
66 * there is no TrueTypeFontStrike subclass.
|