numVMetrics = vHeader.getNumberOfVMetrics(); int numGlyphs = ttf.getNumberOfGlyphs();
private boolean buildVerticalHeader(COSDictionary cidFont) throws IOException { VerticalHeaderTable vhea = ttf.getVerticalHeader(); if (vhea == null) { LOG.warn("Font to be subset is set to vertical, but has no 'vhea' table"); return false; } float scaling = 1000f / ttf.getHeader().getUnitsPerEm(); long v = Math.round(vhea.getAscender() * scaling); long w1 = Math.round(-vhea.getAdvanceHeightMax() * scaling); if (v != 880 || w1 != -1000) { COSArray cosDw2 = new COSArray(); cosDw2.add(COSInteger.get(v)); cosDw2.add(COSInteger.get(w1)); cidFont.setItem(COSName.DW2, cosDw2); } return true; }
break; case VerticalHeaderTable.TAG: table = new VerticalHeaderTable(font); break; case VerticalMetricsTable.TAG:
table = new VerticalHeaderTable(font);
HorizontalMetricsTable hmtx = ttf.getHorizontalMetrics(); long v_y = Math.round(vhea.getAscender() * scaling); long w1 = Math.round(-vhea.getAdvanceHeightMax() * scaling);
numVMetrics = vHeader.getNumberOfVMetrics(); int numGlyphs = ttf.getNumberOfGlyphs();
break; case VerticalHeaderTable.TAG: table = new VerticalHeaderTable(font); break; case VerticalMetricsTable.TAG:
private boolean buildVerticalHeader(COSDictionary cidFont) throws IOException { VerticalHeaderTable vhea = ttf.getVerticalHeader(); if (vhea == null) { LOG.warn("Font to be subset is set to vertical, but has no 'vhea' table"); return false; } float scaling = 1000f / ttf.getHeader().getUnitsPerEm(); long v = Math.round(vhea.getAscender() * scaling); long w1 = Math.round(-vhea.getAdvanceHeightMax() * scaling); if (v != 880 || w1 != -1000) { COSArray cosDw2 = new COSArray(); cosDw2.add(COSInteger.get(v)); cosDw2.add(COSInteger.get(w1)); cidFont.setItem(COSName.DW2, cosDw2); } return true; }
numVMetrics = vHeader.getNumberOfVMetrics(); int numGlyphs = ttf.getNumberOfGlyphs();
HorizontalMetricsTable hmtx = ttf.getHorizontalMetrics(); long v_y = Math.round(vhea.getAscender() * scaling); long w1 = Math.round(-vhea.getAdvanceHeightMax() * scaling);