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.FontType; import org.apache.fop.fonts.Base14Font; import org.apache.fop.fonts.CodePointMapping; import org.apache.fop.fonts.Typeface; public class extends Base14Font { private final static URI fontFileURI; private final static String fontName = ""; private final static String fullName = ""; private final static Set familyNames; private final static int underlinePosition = ; private final static int underlineThickness = ; private final static String encoding = ""; private final static int capHeight = ; private final static int xHeight = ; private final static int ascender = ; private final static int descender = ; private final static int firstChar = ; private final static int lastChar = ; private final static int[] width; private final static Rectangle[] boundingBoxes; private final CodePointMapping mapping = CodePointMapping.getMapping(""); private final static Map kerning; private boolean enableKerning = false; static { URI uri = null; try { uri = new URI("base14:" + fontName.toLowerCase()); } catch (java.net.URISyntaxException e) { } fontFileURI = uri; width = new int[256]; boundingBoxes = new Rectangle[256]; kerning = new java.util.HashMap(); Integer first, second; Map pairs; familyNames = new java.util.HashSet(); familyNames.add(""); } 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 = new Integer(); pairs = (Map)kerning.get(first); if (pairs == null) { pairs = new java.util.HashMap(); kerning.put(first, pairs); } second = new Integer(); pairs.put(second, new Integer());