| Method from org.apache.fop.render.PrintRenderer Detail: |
public void addFontList(List fontInfoList) {
if (this.fontList == null) {
setFontList(fontInfoList);
} else {
this.fontList.addAll(fontInfoList);
}
}
adds a font list to current list of fonts |
protected RendererContext createRendererContext(int x,
int y,
int width,
int height,
Map foreignAttributes) {
RendererContext context;
context = new RendererContext(this, getMimeType());
context.setUserAgent(userAgent);
context.setProperty(RendererContextConstants.WIDTH,
new Integer(width));
context.setProperty(RendererContextConstants.HEIGHT,
new Integer(height));
context.setProperty(RendererContextConstants.XPOS,
new Integer(x));
context.setProperty(RendererContextConstants.YPOS,
new Integer(y));
context.setProperty(RendererContextConstants.PAGE_VIEWPORT,
getCurrentPageViewport());
if (foreignAttributes != null) {
context.setProperty(RendererContextConstants.FOREIGN_ATTRIBUTES, foreignAttributes);
}
return context;
}
Creates a RendererContext for an image. |
protected Font getFontFromArea(Area area) {
FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
int size = ((Integer)area.getTrait(Trait.FONT_SIZE)).intValue();
return fontInfo.getFontInstance(triplet, size);
}
Returns a Font object constructed based on the font traits in an area |
public FontResolver getFontResolver() {
if (this.fontResolver == null) {
this.fontResolver = new DefaultFontResolver(super.userAgent);
}
return this.fontResolver;
}
|
protected String getInternalFontNameForArea(Area area) {
FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
return fontInfo.getInternalFontKey(triplet);
}
Returns the internal font key for a font triplet coming from the area tree |
public static Color lightenColor(Color col,
float factor) {
// TODO: This function converts the color into the sRGB namespace.
// This should be avoided if possible.
float[] cols = new float[4];
cols = col.getRGBComponents(cols);
if (factor > 0) {
cols[0] += (1.0 - cols[0]) * factor;
cols[1] += (1.0 - cols[1]) * factor;
cols[2] += (1.0 - cols[2]) * factor;
} else {
cols[0] -= cols[0] * -factor;
cols[1] -= cols[1] * -factor;
cols[2] -= cols[2] * -factor;
}
return new Color(cols[0], cols[1], cols[2], cols[3]);
}
Lightens up a color for groove, ridge, inset and outset border effects. |
public void renderDocument(Document doc,
String ns,
Rectangle2D pos,
Map foreignAttributes) {
int x = currentIPPosition + (int) pos.getX();
int y = currentBPPosition + (int) pos.getY();
int width = (int)pos.getWidth();
int height = (int)pos.getHeight();
RendererContext context = createRendererContext(x, y, width, height, foreignAttributes);
renderXML(context, doc, ns);
}
Renders an XML document (SVG for example). |
public void setFontList(List fontList) {
this.fontList = fontList;
}
|
public void setupFontInfo(FontInfo inFontInfo) {
this.fontInfo = inFontInfo;
FontSetup.setup(fontInfo, fontList, fontResolver,
userAgent.getFactory().isBase14KerningEnabled());
}
|