164 float x, float y) 165 throws FontScalerException; 166 167 abstract GeneralPath getGlyphVectorOutline(long pScalerContext, int[] glyphs, 168 int numGlyphs, float x, float y) 169 throws FontScalerException; 170 171 /* Used by Java2D disposer to ensure native resources are released. 172 Note: this method does not release any of created 173 scaler context objects! */ 174 public void dispose() {} 175 176 /* At the moment these 3 methods are needed for Type1 fonts only. 177 * For Truetype fonts we extract required info outside of scaler 178 * on java layer. 179 */ 180 abstract int getNumGlyphs() throws FontScalerException; 181 abstract int getMissingGlyphCode() throws FontScalerException; 182 abstract int getGlyphCode(char charCode) throws FontScalerException; 183 184 /* This method returns table cache used by native layout engine. 185 * This cache is essentially just small collection of 186 * pointers to various truetype tables. See definition of TTLayoutTableCache 187 * in the fontscalerdefs.h for more details. 188 * 189 * Note that tables themselves have same format as defined in the truetype 190 * specification, i.e. font scaler do not need to perform any preprocessing. 191 * 192 * Probably it is better to have API to request pointers to each table 193 * separately instead of requesting pointer to some native structure. 194 * (then there is not need to share its definition by different 195 * implementations of scaler). 196 * However, this means multiple JNI calls and potential impact on performance. 197 * 198 * Note: return value 0 is legal. 199 * This means tables are not available (e.g. type1 font). 200 */ 201 abstract long getLayoutTableCache() throws FontScalerException; 202 203 /* Used by the OpenType engine for mark positioning. */ 204 abstract Point2D.Float getGlyphPoint(long pScalerContext, 205 int glyphCode, int ptNumber) 206 throws FontScalerException; 207 208 abstract long getUnitsPerEm(); 209 210 /* Returns pointer to native structure describing rasterization attributes. 211 Format of this structure is scaler-specific. 212 213 Callee is responsible for freeing scaler context (using free()). 214 215 Note: 216 Context is tightly associated with strike and it is actually 217 freed when corresponding strike is being released. 218 */ 219 abstract long createScalerContext(double[] matrix, 220 int aa, int fm, 221 float boldness, float italic, 222 boolean disableHinting); | 164 float x, float y) 165 throws FontScalerException; 166 167 abstract GeneralPath getGlyphVectorOutline(long pScalerContext, int[] glyphs, 168 int numGlyphs, float x, float y) 169 throws FontScalerException; 170 171 /* Used by Java2D disposer to ensure native resources are released. 172 Note: this method does not release any of created 173 scaler context objects! */ 174 public void dispose() {} 175 176 /* At the moment these 3 methods are needed for Type1 fonts only. 177 * For Truetype fonts we extract required info outside of scaler 178 * on java layer. 179 */ 180 abstract int getNumGlyphs() throws FontScalerException; 181 abstract int getMissingGlyphCode() throws FontScalerException; 182 abstract int getGlyphCode(char charCode) throws FontScalerException; 183 184 /* Used by the OpenType engine for mark positioning. */ 185 abstract Point2D.Float getGlyphPoint(long pScalerContext, 186 int glyphCode, int ptNumber) 187 throws FontScalerException; 188 189 abstract long getUnitsPerEm(); 190 191 /* Returns pointer to native structure describing rasterization attributes. 192 Format of this structure is scaler-specific. 193 194 Callee is responsible for freeing scaler context (using free()). 195 196 Note: 197 Context is tightly associated with strike and it is actually 198 freed when corresponding strike is being released. 199 */ 200 abstract long createScalerContext(double[] matrix, 201 int aa, int fm, 202 float boldness, float italic, 203 boolean disableHinting); |