< prev index next >

src/java.desktop/share/classes/sun/font/FreetypeFontScaler.java

Print this page




 146         }
 147         return FontScaler.getNullScaler().
 148             getGlyphOutline(0L, glyphCode, x,y);
 149     }
 150 
 151     synchronized GeneralPath getGlyphVectorOutline(
 152                      long pScalerContext, int[] glyphs, int numGlyphs,
 153                      float x, float y) throws FontScalerException {
 154         if (nativeScaler != 0L) {
 155             return getGlyphVectorOutlineNative(font.get(),
 156                                                pScalerContext,
 157                                                nativeScaler,
 158                                                glyphs,
 159                                                numGlyphs,
 160                                                x, y);
 161         }
 162         return FontScaler
 163             .getNullScaler().getGlyphVectorOutline(0L, glyphs, numGlyphs, x, y);
 164     }
 165 
 166     synchronized long getLayoutTableCache() throws FontScalerException {
 167         return getLayoutTableCacheNative(nativeScaler);
 168     }
 169 
 170     public synchronized void dispose() {
 171         if (nativeScaler != 0L) {
 172             disposeNativeScaler(font.get(), nativeScaler);
 173             nativeScaler = 0L;
 174         }
 175     }
 176 
 177     synchronized int getNumGlyphs() throws FontScalerException {
 178         if (nativeScaler != 0L) {
 179             return getNumGlyphsNative(nativeScaler);
 180         }
 181         return FontScaler.getNullScaler().getNumGlyphs();
 182     }
 183 
 184     synchronized int getMissingGlyphCode()  throws FontScalerException {
 185         if (nativeScaler != 0L) {
 186             return getMissingGlyphCodeNative(nativeScaler);
 187         }
 188         return FontScaler.getNullScaler().getMissingGlyphCode();
 189     }


 225             int indexInCollection, boolean supportsCJK, int filesize);
 226     private native StrikeMetrics getFontMetricsNative(Font2D font,
 227             long pScalerContext, long pScaler);
 228     private native float getGlyphAdvanceNative(Font2D font,
 229             long pScalerContext, long pScaler, int glyphCode);
 230     private native void getGlyphMetricsNative(Font2D font,
 231             long pScalerContext, long pScaler,
 232             int glyphCode, Point2D.Float metrics);
 233     private native long getGlyphImageNative(Font2D font,
 234             long pScalerContext, long pScaler, int glyphCode);
 235     private native Rectangle2D.Float getGlyphOutlineBoundsNative(Font2D font,
 236             long pScalerContext, long pScaler, int glyphCode);
 237     private native GeneralPath getGlyphOutlineNative(Font2D font,
 238             long pScalerContext, long pScaler,
 239             int glyphCode, float x, float y);
 240     private native GeneralPath getGlyphVectorOutlineNative(Font2D font,
 241             long pScalerContext, long pScaler,
 242             int[] glyphs, int numGlyphs, float x, float y);
 243     native Point2D.Float getGlyphPointNative(Font2D font,
 244             long pScalerContext, long pScaler, int glyphCode, int ptNumber);
 245 
 246     private native long getLayoutTableCacheNative(long pScaler);
 247 
 248     private native void disposeNativeScaler(Font2D font2D, long pScaler);
 249 
 250     private native int getGlyphCodeNative(Font2D font, long pScaler, char charCode);
 251     private native int getNumGlyphsNative(long pScaler);
 252     private native int getMissingGlyphCodeNative(long pScaler);
 253 
 254     private native long getUnitsPerEMNative(long pScaler);
 255 
 256     native long createScalerContextNative(long pScaler, double[] matrix,
 257             int aa, int fm, float boldness, float italic);
 258 
 259     /* Freetype scaler context does not contain any pointers that
 260        has to be invalidated if native scaler is bad */
 261     void invalidateScalerContext(long pScalerContext) {}
 262 }


 146         }
 147         return FontScaler.getNullScaler().
 148             getGlyphOutline(0L, glyphCode, x,y);
 149     }
 150 
 151     synchronized GeneralPath getGlyphVectorOutline(
 152                      long pScalerContext, int[] glyphs, int numGlyphs,
 153                      float x, float y) throws FontScalerException {
 154         if (nativeScaler != 0L) {
 155             return getGlyphVectorOutlineNative(font.get(),
 156                                                pScalerContext,
 157                                                nativeScaler,
 158                                                glyphs,
 159                                                numGlyphs,
 160                                                x, y);
 161         }
 162         return FontScaler
 163             .getNullScaler().getGlyphVectorOutline(0L, glyphs, numGlyphs, x, y);
 164     }
 165 




 166     public synchronized void dispose() {
 167         if (nativeScaler != 0L) {
 168             disposeNativeScaler(font.get(), nativeScaler);
 169             nativeScaler = 0L;
 170         }
 171     }
 172 
 173     synchronized int getNumGlyphs() throws FontScalerException {
 174         if (nativeScaler != 0L) {
 175             return getNumGlyphsNative(nativeScaler);
 176         }
 177         return FontScaler.getNullScaler().getNumGlyphs();
 178     }
 179 
 180     synchronized int getMissingGlyphCode()  throws FontScalerException {
 181         if (nativeScaler != 0L) {
 182             return getMissingGlyphCodeNative(nativeScaler);
 183         }
 184         return FontScaler.getNullScaler().getMissingGlyphCode();
 185     }


 221             int indexInCollection, boolean supportsCJK, int filesize);
 222     private native StrikeMetrics getFontMetricsNative(Font2D font,
 223             long pScalerContext, long pScaler);
 224     private native float getGlyphAdvanceNative(Font2D font,
 225             long pScalerContext, long pScaler, int glyphCode);
 226     private native void getGlyphMetricsNative(Font2D font,
 227             long pScalerContext, long pScaler,
 228             int glyphCode, Point2D.Float metrics);
 229     private native long getGlyphImageNative(Font2D font,
 230             long pScalerContext, long pScaler, int glyphCode);
 231     private native Rectangle2D.Float getGlyphOutlineBoundsNative(Font2D font,
 232             long pScalerContext, long pScaler, int glyphCode);
 233     private native GeneralPath getGlyphOutlineNative(Font2D font,
 234             long pScalerContext, long pScaler,
 235             int glyphCode, float x, float y);
 236     private native GeneralPath getGlyphVectorOutlineNative(Font2D font,
 237             long pScalerContext, long pScaler,
 238             int[] glyphs, int numGlyphs, float x, float y);
 239     native Point2D.Float getGlyphPointNative(Font2D font,
 240             long pScalerContext, long pScaler, int glyphCode, int ptNumber);


 241 
 242     private native void disposeNativeScaler(Font2D font2D, long pScaler);
 243 
 244     private native int getGlyphCodeNative(Font2D font, long pScaler, char charCode);
 245     private native int getNumGlyphsNative(long pScaler);
 246     private native int getMissingGlyphCodeNative(long pScaler);
 247 
 248     private native long getUnitsPerEMNative(long pScaler);
 249 
 250     native long createScalerContextNative(long pScaler, double[] matrix,
 251             int aa, int fm, float boldness, float italic);
 252 
 253     /* Freetype scaler context does not contain any pointers that
 254        has to be invalidated if native scaler is bad */
 255     void invalidateScalerContext(long pScalerContext) {}
 256 }
< prev index next >