protected FontEncoding() { unicodeToCode = new IntHashtable(256); codeToUnicode = ArrayUtil.fillWithValue(new int[256], -1); unicodeDifferences = new IntHashtable(256); fontSpecific = false; }
protected FontEncoding() { unicodeToCode = new IntHashtable(256); codeToUnicode = ArrayUtil.fillWithValue(new int[256], -1); unicodeDifferences = new IntHashtable(256); fontSpecific = false; }
private static IntHashtable createMetric(String s) { IntHashtable h = new IntHashtable(); StringTokenizer tk = new StringTokenizer(s); while (tk.hasMoreTokens()) { int n1 = Integer.parseInt(tk.nextToken()); h.put(n1, Integer.parseInt(tk.nextToken())); } return h; } }
public GsubLookupType1(OpenTypeFontTableReader openReader, int lookupFlag, int[] subTableLocations) throws java.io.IOException { super(openReader, lookupFlag, subTableLocations); substMap = new IntHashtable(); readSubTables(); }
private static IntHashtable createMetric(String s) { IntHashtable h = new IntHashtable(); StringTokenizer tk = new StringTokenizer(s); while (tk.hasMoreTokens()) { int n1 = Integer.parseInt(tk.nextToken()); h.put(n1, Integer.parseInt(tk.nextToken())); } return h; } }
public GsubLookupType1(OpenTypeFontTableReader openReader, int lookupFlag, int[] subTableLocations) throws java.io.IOException { super(openReader, lookupFlag, subTableLocations); substMap = new IntHashtable(); readSubTables(); }
public IntHashtable getReversMap() { IntHashtable code2cid = new IntHashtable(map.size()); for (int cid : map.keySet()) { byte[] bytes = map.get(cid); int byteCode = 0; for (byte b: bytes) { byteCode <<= 8; byteCode += b & 0xff; } code2cid.put(byteCode, cid); } return code2cid; }
private static IntHashtable createMetric(String s) { IntHashtable h = new IntHashtable(); StringTokenizer tk = new StringTokenizer(s); while (tk.hasMoreTokens()) { int n1 = Integer.parseInt(tk.nextToken()); h.put(n1, Integer.parseInt(tk.nextToken())); } return h; }
private static IntHashtable createMetric(String s) { IntHashtable h = new IntHashtable(); StringTokenizer tk = new StringTokenizer(s); while (tk.hasMoreTokens()) { int n1 = Integer.parseInt(tk.nextToken()); h.put(n1, Integer.parseInt(tk.nextToken())); } return h; }
public IntHashtable getReversMap() { IntHashtable code2cid = new IntHashtable(map.size()); for (int cid : map.keySet()) { byte[] bytes = map.get(cid); int byteCode = 0; for (byte b: bytes) { byteCode <<= 8; byteCode += b & 0xff; } code2cid.put(byteCode, cid); } return code2cid; }
@Override public Object clone() throws CloneNotSupportedException { try { IntHashtable t = new IntHashtable(this); t.table = new Entry[table.length]; for (int i = table.length ; i-- > 0 ; ) { t.table[i] = table[i] != null ? (Entry)table[i].clone() : null; } return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } } }
public IntHashtable createDirectMapping() { IntHashtable result = new IntHashtable(); for (Map.Entry<Integer, char[]> entry : byteMappings.entrySet()) { if (entry.getValue().length == 1) { result.put((int) entry.getKey(), convertToInt(entry.getValue())); } } return result; }
@Override public Object clone() throws CloneNotSupportedException { try { IntHashtable t = new IntHashtable(this); t.table = new Entry[table.length]; for (int i = table.length ; i-- > 0 ; ) { t.table[i] = table[i] != null ? (Entry)table[i].clone() : null; } return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } } }
public IntHashtable createDirectMapping() { IntHashtable result = new IntHashtable(); for (Map.Entry<Integer, char[]> entry : byteMappings.entrySet()) { if (entry.getValue().length == 1) { result.put((int) entry.getKey(), convertToInt(entry.getValue())); } } return result; }
public List<OpenTableLookup> getLookups(FeatureRecord[] features) { IntHashtable hash = new IntHashtable(); for (FeatureRecord rec : features) { for (int idx : rec.lookups) { hash.put(idx, 1); } } List<OpenTableLookup> ret = new ArrayList<>(); for (int idx : hash.toOrderedKeys()) { ret.add(lookupList.get(idx)); } return ret; }
public List<OpenTableLookup> getLookups(FeatureRecord[] features) { IntHashtable hash = new IntHashtable(); for (FeatureRecord rec : features) { for (int idx : rec.lookups) { hash.put(idx, 1); } } List<OpenTableLookup> ret = new ArrayList<>(); for (int idx : hash.toOrderedKeys()) { ret.add(lookupList.get(idx)); } return ret; }
int table_location[]; table_location = tables.get("kern"); IntHashtable kerning = new IntHashtable(); if (table_location == null) { return kerning;
int table_location[]; table_location = tables.get("kern"); IntHashtable kerning = new IntHashtable(); if (table_location == null) { return kerning;
private static void fillDifferences(DocFontEncoding fontEncoding, PdfArray diffs, CMapToUnicode toUnicode) { IntHashtable byte2uni = toUnicode != null ? toUnicode.createDirectMapping() : new IntHashtable(); if (diffs != null) { int currentNumber = 0;
static IntHashtable convertCompositeWidthsArray(PdfArray widthsArray) { IntHashtable res = new IntHashtable(); if (widthsArray == null) { return res; } for (int k = 0; k < widthsArray.size(); ++k) { int c1 = widthsArray.getAsNumber(k).intValue(); PdfObject obj = widthsArray.get(++k); if (obj.isArray()) { PdfArray subWidths = (PdfArray)obj; for (int j = 0; j < subWidths.size(); ++j) { int c2 = subWidths.getAsNumber(j).intValue(); res.put(c1++, c2); } } else { int c2 = ((PdfNumber)obj).intValue(); int w = widthsArray.getAsNumber(++k).intValue(); for (; c1 <= c2; ++c1) { res.put(c1, w); } } } return res; } }