*/
package org.apache.fop.fonts;
+import org.apache.fop.pdf.PDFWArray;
+
/**
* Abstract base class for CID fonts.
*/
public boolean isMultiByte() {
return true;
}
-}
+
+ /**
+ * Returns a PDFWArray containing all the widths of the subset to be used.
+ * @return the character widths
+ * @todo Try to avoid dependency on PDF library
+ */
+ public abstract PDFWArray getSubsetWidths();
+
+}
\ No newline at end of file
private CIDFontType cidType = CIDFontType.CIDTYPE2;
private String namePrefix = null; // Quasi unique prefix
- private PDFWArray warray = new PDFWArray();
+ //private PDFWArray warray = new PDFWArray();
private int width[] = null;
private BFEntry[] bfentries = null;
}
}
-/* unused
- public PDFWArray getWidthsAsPDFWArray() {
- if (isEmbeddable()) {
- // Create widths for reencoded chars
- warray = new PDFWArray();
- int[] tmpWidth = new int[usedGlyphsCount];
-
- for (int i = 0; i < usedGlyphsCount; i++) {
- Integer nw = (Integer)usedGlyphsIndex.get(new Integer(i));
- int nwx = (nw == null) ? 0 : nw.intValue();
- tmpWidth[i] = width[nwx];
- }
- warray.addEntry(0, tmpWidth);
- }
- return warray;
- }*/
-
/**
* @see org.apache.fop.fonts.FontDescriptor#isEmbeddable()
*/
return arr;
}
+ /**
+ * @see org.apache.fop.fonts.CIDFont#getSubsetWidths()
+ */
+ public PDFWArray getSubsetWidths() {
+ // Create widths for reencoded chars
+ PDFWArray warray = new PDFWArray();
+ int[] tmpWidth = new int[usedGlyphsCount];
+
+ for (int i = 0; i < usedGlyphsCount; i++) {
+ Integer nw = (Integer)usedGlyphsIndex.get(new Integer(i));
+ int nwx = (nw == null) ? 0 : nw.intValue();
+ tmpWidth[i] = width[nwx];
+ }
+ warray.addEntry(0, tmpWidth);
+ return warray;
+ }
+
/**
* Remaps a codepoint based.
* @param i codepoint to remap
* @param cidWidthIndex index
* @param wds array of widths
*/
+ /*
public void addCIDWidthEntry(int cidWidthIndex, int[] wds) {
this.warray.addEntry(cidWidthIndex, wds);
- }
+ }*/
/**