/*
* 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.
*/
/*
* This isn't a critical performance case, so don't do any
* char->glyph map caching for Type1 fonts. The ones that are used
* in composites will be cached there.
*/
initMapper();
}
private void initMapper() {
try {
} catch (FontScalerException fe) {
try {
} catch (FontScalerException e) { //should not happen
missingGlyph = 0;
}
}
}
public int getNumGlyphs() {
try {
return scaler.getNumGlyphs();
} catch (FontScalerException e) {
return getNumGlyphs();
}
}
public int getMissingGlyphCode() {
return missingGlyph;
}
try {
} catch(FontScalerException e) {
return canDisplay(ch);
}
}
try {
} catch (FontScalerException e) {
return charToGlyph(ch);
}
}
return missingGlyph;
} else {
try {
} catch (FontScalerException e) {
return charToGlyph(ch);
}
}
}
/* The conversion into surrogates is misleading.
* The Type1 glyph mapper only accepts 16 bit unsigned shorts.
* If its > not in the range it can use assign the missing glyph.
*/
for (int i=0; i<count; i++) {
if (code >= HI_SURROGATE_START &&
if (low >= LO_SURROGATE_START &&
low <= LO_SURROGATE_END) {
}
}
if (code >= 0x10000) {
i += 1; // Empty glyph slot after surrogate
}
}
}
/* I believe this code path is never exercised. Its there mainly
* to be an issue for Type1 fonts. So no need to optimise it.
*/
for (int i=0; i<count; i++) {
}
}
/* This variant checks if shaping is needed and immediately
* returns true if it does. A caller of this method should be expecting
* to check the return type because it needs to know how to handle
* the character data for display.
*/
for (int i=0; i<count; i++) {
if (code >= HI_SURROGATE_START &&
if (low >= LO_SURROGATE_START &&
low <= LO_SURROGATE_END) {
}
}
continue;
}
return true;
}
else if (code >= 0x10000) {
i += 1; // Empty glyph slot after surrogate
continue;
}
}
return false;
}
}