}
}
public void importFontFaces(List fontFaces) {
for (Iterator i = fontFaces.iterator(); i.hasNext(); ) {
FontFaceRule rule = (FontFaceRule)i.next();
CalculatedStyle style = rule.getCalculatedStyle();
FSDerivedValue src = style.valueByName(CSSName.SRC);
if (src == IdentValue.NONE) {
continue;
}
byte[] font1 = _sharedContext.getUac().getBinaryResource(src.asString());
if (font1 == null) {
XRLog.exception("Could not load font " + src.asString());
continue;
}
byte[] font2 = null;
FSDerivedValue metricsSrc = style.valueByName(CSSName.FS_FONT_METRIC_SRC);
if (metricsSrc != IdentValue.NONE) {
font2 = _sharedContext.getUac().getBinaryResource(metricsSrc.asString());
if (font2 == null) {
XRLog.exception("Could not load font metric data " + src.asString());
continue;
}
}
if (font2 != null) {
byte[] t = font1;
font1 = font2;
font2 = t;
}
boolean embedded = style.isIdent(CSSName.FS_PDF_FONT_EMBED, IdentValue.EMBED);
String encoding = style.getStringProperty(CSSName.FS_PDF_FONT_ENCODING);
String fontFamily = null;
if (rule.hasFontFamily()) {
fontFamily = style.valueByName(CSSName.FONT_FAMILY).asString();
}
try {
addFontFaceFont(fontFamily, src.asString(), encoding, embedded, font1, font2);
} catch (DocumentException e) {