resName = resName + "-" + primaryUUID.substring(9);
}
bds.getOutputStream().write(font.getSubsettedFont());
String folder = epub.getContentFolder() == null ? "" : epub.getContentFolder() + "/";
FontResource fontResource = epub.createFontResource(folder + "fonts/" + resName + ".otf", bds);
FontFaceRule face = styleResource.getStylesheet().createFontFace(fontResource);
face.set("font-family", new CSSQuotedString(entry.familyName));
switch (entry.weight) {
case FontPropertyConstants.WEIGHT_NORMAL:
face.set("font-weight", new CSSName("normal"));
break;
case FontPropertyConstants.WEIGHT_BOLD:
face.set("font-weight", new CSSName("bold"));
break;
default:
face.set("font-weight", new CSSNumber(new Integer(entry.weight)));
break;
}
switch (entry.style) {
case FontPropertyConstants.STYLE_ITALIC:
face.set("font-style", new CSSName("italic"));
break;
case FontPropertyConstants.STYLE_OBLIQUE:
face.set("font-style", new CSSName("oblique"));
break;
default:
face.set("font-style", new CSSName("normal"));
break;
}
} catch (Exception e) {
e.printStackTrace();