/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.fop.fonts.base14; import java.awt.Rectangle; import java.net.URI; import java.util.Map; import java.util.Set; import org.apache.fop.fonts.Base14Font; import org.apache.fop.fonts.CodePointMapping; import org.apache.fop.fonts.FontType; import org.apache.fop.fonts.Typeface; // CSOFF: ConstantNameCheck public class extends Base14Font { private static final URI fontFileURI; private static final String fontName = ""; private static final String fullName = ""; private static final Set familyNames; private static final int underlinePosition = ; private static final int underlineThickness = ; private static final String encoding = ""; private static final int capHeight = ; private static final int xHeight = ; private static final int ascender = ; private static final int descender = ; private static final int firstChar = ; private static final int lastChar = ; private static final int[] width; private static final Rectangle[] boundingBoxes; private final CodePointMapping mapping = CodePointMapping.getMapping(""); private static final Map kerning; private boolean enableKerning; static { URI uri = null; try { uri = new URI("base14:" + fontName.toLowerCase()); } catch (java.net.URISyntaxException e) { throw new RuntimeException(e); } fontFileURI = uri; width = new int[256]; boundingBoxes = new Rectangle[256]; familyNames = new java.util.HashSet(); familyNames.add(""); kerning = new java.util.HashMap(); Integer first; Integer second; Map pairs; } public () { this(false); } public (boolean enableKerning) { this.enableKerning = enableKerning; } public String getEncodingName() { return encoding; } public URI getFontURI() { return fontFileURI; } public String getFontName() { return fontName; } public String getEmbedFontName() { return getFontName(); } public String getFullName() { return fullName; } public Set getFamilyNames() { return familyNames; } public FontType getFontType() { return FontType.TYPE1; } public int getAscender(int size) { return size * ascender; } public int getCapHeight(int size) { return size * capHeight; } public int getDescender(int size) { return size * descender; } public int getXHeight(int size) { return size * xHeight; } public int getUnderlinePosition(int size) { return size * underlinePosition; } public int getUnderlineThickness(int size) { return size * underlineThickness; } public int getFirstChar() { return firstChar; } public int getLastChar() { return lastChar; } public int getWidth(int i, int size) { return size * width[i]; } public Rectangle getBoundingBox(int glyphIndex, int size) { Rectangle bbox = boundingBoxes[glyphIndex]; return new Rectangle(bbox.x * size, bbox.y * size, bbox.width * size, bbox.height * size); } public int[] getWidths() { int[] arr = new int[getLastChar() - getFirstChar() + 1]; System.arraycopy(width, getFirstChar(), arr, 0, getLastChar() - getFirstChar() + 1); return arr; } public boolean hasKerningInfo() { return enableKerning; } public java.util.Map getKerningInfo() { return kerning; } public boolean hasKerningInfo() { return false; } public java.util.Map getKerningInfo() { return java.util.Collections.EMPTY_MAP; } public char mapChar(char c) { notifyMapOperation(); char d = mapping.mapChar(c); if (d != 0) { return d; } else { this.warnMissingGlyph(c); return Typeface.NOT_FOUND; } } public boolean hasChar(char c) { return (mapping.mapChar(c) > 0); } } width[0x] = ; boundingBoxes[0x] = new Rectangle(, , , ); first = ; pairs = (Map)kerning.get(first); if (pairs == null) { pairs = new java.util.HashMap(); kerning.put(first, pairs); } second = ; pairs.put(second, );