Path: blob/master/src/java.desktop/share/classes/sun/font/FontStrike.java
41154 views
/*1* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.font;2627import java.awt.Rectangle;28import java.awt.geom.GeneralPath;29import java.awt.geom.Rectangle2D;30import java.awt.geom.Point2D;3132public abstract class FontStrike {333435protected FontStrikeDisposer disposer;36protected FontStrikeDesc desc;37protected StrikeMetrics strikeMetrics;38protected boolean algoStyle = false;39protected float boldness = 1f;40protected float italic = 0f;41/*42* lastLookupTime is updated by Font2D.getStrike and can be used to43* choose strikes that have not been newly referenced for purging when44* memory usage gets too high. Active strikes will never be purged45* because purging is via GC of WeakReferences.46*/47//protected long lastlookupTime/* = System.currentTimeMillis()*/;4849public abstract int getNumGlyphs();5051abstract StrikeMetrics getFontMetrics();5253abstract void getGlyphImagePtrs(int[] glyphCodes, long[] images,int len);5455abstract long getGlyphImagePtr(int glyphcode);5657// pt, result in device space58abstract void getGlyphImageBounds(int glyphcode,59Point2D.Float pt,60Rectangle result);6162abstract Point2D.Float getGlyphMetrics(int glyphcode);6364abstract Point2D.Float getCharMetrics(char ch);6566abstract float getGlyphAdvance(int glyphCode);6768abstract float getCodePointAdvance(int cp);6970abstract Rectangle2D.Float getGlyphOutlineBounds(int glyphCode);7172abstract GeneralPath73getGlyphOutline(int glyphCode, float x, float y);7475abstract GeneralPath76getGlyphVectorOutline(int[] glyphs, float x, float y);777879}808182