public class PDFGlyphWidthTable
extends java.lang.Object
The pdf format for widths looks like: [cid [w1 w2 w3] cidfirst cidlast w4 cid2 [w5 w6 w7 w8]]
so the widths for a range of cids can be specified as an array of widths, or by a single width that applies to every cid in the range.
All WidthTableEntries have a startcid & endcid range and can then hold either a) an array of endcid-startcid+1 floats b) a single float
The widthtable can then do a binary search through the table to find the specific widthtable entry. The worst possible case would be a table of 64k entries, each describing a single glyph, and a search for a glyph through this would take log2(65536) = 16 hops through a huge table. Any fontlist this large would actually just revert to a single entry with 64k widths, so there would be no searching. Average case would be a much smaller, especially since this is often used for font subsets.
Constructor and Description |
---|
PDFGlyphWidthTable(java.util.List pdfwidths,
java.lang.Object defwidth)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
float |
getWidth(int cid)
Binary search the list and return the width
|