< prev index next >

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

Print this page




  63     protected int fileSize;
  64 
  65     protected FontScaler scaler;
  66 
  67     /* The following variables are used, (and in the case of the arrays,
  68      * only initialised) for select fonts where a native scaler may be
  69      * used to get glyph images and metrics.
  70      * glyphToCharMap is filled in on the fly and used to do a reverse
  71      * lookup when a FileFont needs to get the charcode back from a glyph
  72      * code so it can re-map via a NativeGlyphMapper to get a native glyph.
  73      * This isn't a big hit in time, since a boolean test is sufficient
  74      * to choose the usual default path, nor in memory for fonts which take
  75      * the native path, since fonts have contiguous zero-based glyph indexes,
  76      * and these obviously do all exist in the font.
  77      */
  78     protected boolean checkedNatives;
  79     protected boolean useNatives;
  80     protected NativeFont[] nativeFonts;
  81     protected char[] glyphToCharMap;
  82     /*
  83      * @throws FontFormatException - if the font can't be opened
  84      */
  85     FileFont(String platname, Object nativeNames)
  86         throws FontFormatException {
  87 
  88         super(platname, nativeNames);
  89     }
  90 
  91     FontStrike createStrike(FontStrikeDesc desc) {
  92         if (!checkedNatives) {
  93            checkUseNatives();
  94         }
  95         return new FileFontStrike(this, desc);
  96     }
  97 
  98     protected boolean checkUseNatives() {
  99         checkedNatives = true;
 100         return useNatives;
 101     }
 102 
 103     /* This method needs to be accessible to FontManager if there is




  63     protected int fileSize;
  64 
  65     protected FontScaler scaler;
  66 
  67     /* The following variables are used, (and in the case of the arrays,
  68      * only initialised) for select fonts where a native scaler may be
  69      * used to get glyph images and metrics.
  70      * glyphToCharMap is filled in on the fly and used to do a reverse
  71      * lookup when a FileFont needs to get the charcode back from a glyph
  72      * code so it can re-map via a NativeGlyphMapper to get a native glyph.
  73      * This isn't a big hit in time, since a boolean test is sufficient
  74      * to choose the usual default path, nor in memory for fonts which take
  75      * the native path, since fonts have contiguous zero-based glyph indexes,
  76      * and these obviously do all exist in the font.
  77      */
  78     protected boolean checkedNatives;
  79     protected boolean useNatives;
  80     protected NativeFont[] nativeFonts;
  81     protected char[] glyphToCharMap;
  82     /*
  83      * @throws FontFormatException if the font can't be opened
  84      */
  85     FileFont(String platname, Object nativeNames)
  86         throws FontFormatException {
  87 
  88         super(platname, nativeNames);
  89     }
  90 
  91     FontStrike createStrike(FontStrikeDesc desc) {
  92         if (!checkedNatives) {
  93            checkUseNatives();
  94         }
  95         return new FileFontStrike(this, desc);
  96     }
  97 
  98     protected boolean checkUseNatives() {
  99         checkedNatives = true;
 100         return useNatives;
 101     }
 102 
 103     /* This method needs to be accessible to FontManager if there is


< prev index next >