/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* performance:
* it seems expensive that when using a composite font for
* every char you have to find which "slot" can display it.
* Just the fact that you need to check at all ..
* A composite glyph code ducks this by encoding the slot into the
* glyph code, but you still need to get from char to glyph code.
*/
algoStyle = true;
boldness = 1.33f;
}
italic = 0.7f;
}
}
}
/* do I need this (see Strike::compositeStrikeForGlyph) */
}
strike =
}
return strike;
}
public int getNumGlyphs() {
return compFont.getNumGlyphs();
}
if (strikeMetrics == null) {
}
}
return strikeMetrics;
}
/* Performance tweak: Slot 0 can often return all the glyphs
* Note slot zero doesn't need to be masked.
* Could go a step further and support getting a run of glyphs.
* This would help many locales a little.
*
* Note that if a client constructs an invalid a composite glyph that
* references an invalid slot, that the behaviour is currently
* that this slot index falls through to CompositeFont.getSlotFont(int)
* which will substitute a default font, from which to obtain the
* strike. If its an invalid glyph code for a valid slot, then the
* physical font for that slot will substitute the missing glyph.
*/
return;
}
}
}
}
}
}
}
}
/* REMIND where to cache?
* The glyph advance is already cached by physical strikes and that's a lot
* of the work.
* Also FontDesignMetrics maintains a latin char advance cache, so don't
* cache advances here as apps tend to hold onto metrics objects when
* performance is sensitive to it. Revisit this assumption later.
*/
}
}
return new GeneralPath();
} else {
return path;
}
}
/* The physical font slot for each glyph is encoded in the glyph ID
* To be as efficient as possible we find a run of glyphs from the
* same slot and create a temporary array of these glyphs decoded
* to the slot. The slot font is then queried for the GeneralPath
* for that run of glyphs. GeneralPaths from each run are appended
* to create the shape for the whole glyph array.
*/
int glyphIndex = 0;
int[] tmpGlyphs;
int start = glyphIndex;
glyphIndex++;
}
for (int i=0;i<tmpLen;i++) {
}
}
}
return new GeneralPath();
} else {
return path;
}
}
}