writeUint16(out, os2.getVersion()); writeSInt16(out, os2.getAverageCharWidth()); writeUint16(out, os2.getWeightClass()); writeUint16(out, os2.getWidthClass()); writeSInt16(out, os2.getFsType()); writeSInt16(out, os2.getSubscriptXSize()); writeSInt16(out, os2.getSubscriptYSize()); writeSInt16(out, os2.getSubscriptXOffset()); writeSInt16(out, os2.getSubscriptYOffset()); writeSInt16(out, os2.getSuperscriptXSize()); writeSInt16(out, os2.getSuperscriptYSize()); writeSInt16(out, os2.getSuperscriptXOffset()); writeSInt16(out, os2.getSuperscriptYOffset()); writeSInt16(out, os2.getStrikeoutSize()); writeSInt16(out, os2.getStrikeoutPosition()); writeSInt16(out, (short)os2.getFamilyClass()); out.write(os2.getPanose()); out.write(os2.getAchVendId().getBytes("US-ASCII")); writeUint16(out, os2.getFsSelection()); writeUint16(out, uniToGID.firstKey()); writeUint16(out, uniToGID.lastKey()); writeUint16(out, os2.getTypoAscender()); writeUint16(out, os2.getTypoDescender());
sFamilyClass = ttf.getOS2Windows().getFamilyClass(); usWeightClass = ttf.getOS2Windows().getWeightClass(); ulCodePageRange1 = (int)ttf.getOS2Windows().getCodePageRange1(); ulCodePageRange2 = (int)ttf.getOS2Windows().getCodePageRange2(); panose = ttf.getOS2Windows().getPanose();
ttf.getHorizontalHeader().getNumberOfHMetrics() == 1); int fsSelection = os2.getFsSelection(); fd.setItalic(((fsSelection & (ITALIC | OBLIQUE)) != 0)); switch (os2.getFamilyClass()) fd.setFontWeight(os2.getWeightClass()); if (os2.getVersion() >= 1.2) fd.setCapHeight(os2.getCapHeight() * scaling); fd.setXHeight(os2.getHeight() * scaling); fd.setCapHeight((os2.getTypoAscender() + os2.getTypoDescender()) * scaling); fd.setXHeight(os2.getTypoAscender() / 2.0f * scaling);
/** * Returns true if the fsType in the OS/2 table permits subsetting. */ private boolean isSubsettingPermitted(TrueTypeFont ttf) throws IOException { if (ttf.getOS2Windows() != null) { int fsType = ttf.getOS2Windows().getFsType(); if ((fsType & OS2WindowsMetricsTable.FSTYPE_NO_SUBSETTING) == OS2WindowsMetricsTable.FSTYPE_NO_SUBSETTING) { return false; } } return true; }
break; case OS2WindowsMetricsTable.TAG: table = new OS2WindowsMetricsTable(font); break; case PostScriptTable.TAG:
ttf.getHorizontalHeader().getNumberOfHMetrics() == 1); int fsSelection = os2.getFsSelection(); fd.setItalic(((fsSelection & (ITALIC | OBLIQUE)) != 0)); switch (os2.getFamilyClass()) fd.setFontWeight(os2.getWeightClass()); if (os2.getVersion() >= 1.2) fd.setCapHeight(os2.getCapHeight() * scaling); fd.setXHeight(os2.getHeight() * scaling); fd.setCapHeight((os2.getTypoAscender() + os2.getTypoDescender()) * scaling); fd.setXHeight(os2.getTypoAscender() / 2.0f * scaling);
sFamilyClass = ttf.getOS2Windows().getFamilyClass(); usWeightClass = ttf.getOS2Windows().getWeightClass(); ulCodePageRange1 = (int)ttf.getOS2Windows().getCodePageRange1(); ulCodePageRange2 = (int)ttf.getOS2Windows().getCodePageRange2(); panose = ttf.getOS2Windows().getPanose();
/** * Returns true if the fsType in the OS/2 table permits embedding. */ private boolean isEmbeddingPermitted(TrueTypeFont ttf) throws IOException { if (ttf.getOS2Windows() != null) { int fsType = ttf.getOS2Windows().getFsType(); int exclusive = fsType & 0x8; // bits 0-3 are a set of exclusive bits if ((exclusive & OS2WindowsMetricsTable.FSTYPE_RESTRICTED) == OS2WindowsMetricsTable.FSTYPE_RESTRICTED) { // restricted License embedding return false; } else if ((exclusive & OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) == OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) { // bitmap embedding only return false; } } return true; }
table = new OS2WindowsMetricsTable(font);
writeUint16(out, os2.getVersion()); writeSInt16(out, os2.getAverageCharWidth()); writeUint16(out, os2.getWeightClass()); writeUint16(out, os2.getWidthClass()); writeSInt16(out, os2.getFsType()); writeSInt16(out, os2.getSubscriptXSize()); writeSInt16(out, os2.getSubscriptYSize()); writeSInt16(out, os2.getSubscriptXOffset()); writeSInt16(out, os2.getSubscriptYOffset()); writeSInt16(out, os2.getSuperscriptXSize()); writeSInt16(out, os2.getSuperscriptYSize()); writeSInt16(out, os2.getSuperscriptXOffset()); writeSInt16(out, os2.getSuperscriptYOffset()); writeSInt16(out, os2.getStrikeoutSize()); writeSInt16(out, os2.getStrikeoutPosition()); writeSInt16(out, (short)os2.getFamilyClass()); out.write(os2.getPanose()); out.write(os2.getAchVendId().getBytes("US-ASCII")); writeUint16(out, os2.getFsSelection()); writeUint16(out, uniToGID.firstKey()); writeUint16(out, uniToGID.lastKey()); writeUint16(out, os2.getTypoAscender()); writeUint16(out, os2.getTypoDescender());
ttf.getHorizontalHeader().getNumberOfHMetrics() == 1); int fsSelection = os2.getFsSelection(); fd.setItalic(((fsSelection & (ITALIC | OBLIQUE)) != 0)); switch (os2.getFamilyClass()) fd.setFontWeight(os2.getWeightClass()); if (os2.getVersion() >= 1.2) fd.setCapHeight(os2.getCapHeight() * scaling); fd.setXHeight(os2.getHeight() * scaling); fd.setCapHeight((os2.getTypoAscender() + os2.getTypoDescender()) * scaling); fd.setXHeight(os2.getTypoAscender() / 2.0f * scaling);
sFamilyClass = ttf.getOS2Windows().getFamilyClass(); usWeightClass = ttf.getOS2Windows().getWeightClass(); ulCodePageRange1 = (int)ttf.getOS2Windows().getCodePageRange1(); ulCodePageRange2 = (int)ttf.getOS2Windows().getCodePageRange2(); panose = ttf.getOS2Windows().getPanose();
/** * Returns true if the fsType in the OS/2 table permits subsetting. */ private boolean isSubsettingPermitted(TrueTypeFont ttf) throws IOException { if (ttf.getOS2Windows() != null) { int fsType = ttf.getOS2Windows().getFsType(); if ((fsType & OS2WindowsMetricsTable.FSTYPE_NO_SUBSETTING) == OS2WindowsMetricsTable.FSTYPE_NO_SUBSETTING) { return false; } } return true; }
break; case OS2WindowsMetricsTable.TAG: table = new OS2WindowsMetricsTable(font); break; case PostScriptTable.TAG:
writeUint16(out, os2.getVersion()); writeSInt16(out, os2.getAverageCharWidth()); writeUint16(out, os2.getWeightClass()); writeUint16(out, os2.getWidthClass()); writeSInt16(out, os2.getFsType()); writeSInt16(out, os2.getSubscriptXSize()); writeSInt16(out, os2.getSubscriptYSize()); writeSInt16(out, os2.getSubscriptXOffset()); writeSInt16(out, os2.getSubscriptYOffset()); writeSInt16(out, os2.getSuperscriptXSize()); writeSInt16(out, os2.getSuperscriptYSize()); writeSInt16(out, os2.getSuperscriptXOffset()); writeSInt16(out, os2.getSuperscriptYOffset()); writeSInt16(out, os2.getStrikeoutSize()); writeSInt16(out, os2.getStrikeoutPosition()); writeSInt16(out, (short)os2.getFamilyClass()); out.write(os2.getPanose()); out.write(os2.getAchVendId().getBytes("US-ASCII")); writeUint16(out, os2.getFsSelection()); writeUint16(out, uniToGID.firstKey()); writeUint16(out, uniToGID.lastKey()); writeUint16(out, os2.getTypoAscender()); writeUint16(out, os2.getTypoDescender());
/** * Returns true if the fsType in the OS/2 table permits subsetting. */ private boolean isSubsettingPermitted(TrueTypeFont ttf) throws IOException { if (ttf.getOS2Windows() != null) { int fsType = ttf.getOS2Windows().getFsType(); if ((fsType & OS2WindowsMetricsTable.FSTYPE_NO_SUBSETTING) == OS2WindowsMetricsTable.FSTYPE_NO_SUBSETTING) { return false; } } return true; }
/** * Returns true if the fsType in the OS/2 table permits embedding. */ private boolean isEmbeddingPermitted(TrueTypeFont ttf) throws IOException { if (ttf.getOS2Windows() != null) { int fsType = ttf.getOS2Windows().getFsType(); int exclusive = fsType & 0x8; // bits 0-3 are a set of exclusive bits if ((exclusive & OS2WindowsMetricsTable.FSTYPE_RESTRICTED) == OS2WindowsMetricsTable.FSTYPE_RESTRICTED) { // restricted License embedding return false; } else if ((exclusive & OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) == OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) { // bitmap embedding only return false; } } return true; }
/** * Returns true if the fsType in the OS/2 table permits embedding. */ private boolean isEmbeddingPermitted(TrueTypeFont ttf) throws IOException { if (ttf.getOS2Windows() != null) { int fsType = ttf.getOS2Windows().getFsType(); int exclusive = fsType & 0x8; // bits 0-3 are a set of exclusive bits if ((exclusive & OS2WindowsMetricsTable.FSTYPE_RESTRICTED) == OS2WindowsMetricsTable.FSTYPE_RESTRICTED) { // restricted License embedding return false; } else if ((exclusive & OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) == OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) { // bitmap embedding only return false; } } return true; }