Example usage for com.itextpdf.text Chunk setSkew

List of usage examples for com.itextpdf.text Chunk setSkew

Introduction

In this page you can find the example usage for com.itextpdf.text Chunk setSkew.

Prototype

public Chunk setSkew(float alpha, float beta) 

Source Link

Document

Skews the text to simulate italic and other effects.

Usage

From source file:com.masscustsoft.service.ToPdf.java

License:Open Source License

private void applyFont(Chunk ch, Map it)
        throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    ch.getFont().setSize(getSize(it));// www .j  av a  2s .  c  o m
    ch.getFont().setStyle(getStyle(it));
    ch.getFont().setColor(getColor(it, "color"));
    MapUtil.setIfFloat(it, "textRise", ch);
    Float skewAlpha = MapUtil.getFloat(it, "skewAlpha", null);
    Float skewBeta = MapUtil.getFloat(it, "skewBeta", null);
    if (skewAlpha != null && skewBeta != null)
        ch.setSkew(skewAlpha.floatValue(), skewBeta.floatValue());
    MapUtil.setIfStr(it, "localDestination", ch);
    MapUtil.setIfStr(it, "localGoto", ch);
}

From source file:com.vectorprint.report.itext.style.stylers.Skew.java

License:Open Source License

private void skewChunk(Chunk c) {
    float[] skew = getValue(SKEW, float[].class);
    if (skew[0] != 0 || skew[1] != 0) {
        c.setSkew(skew[0], skew[1]);
    }/* ww w .  j  av a  2  s  .co m*/
}

From source file:se.billes.pdf.renderer.model.text.Phrase.java

License:Open Source License

public void onRender(com.itextpdf.text.Paragraph paragraph) {
    Font font = new Font(getBaseFont(), getFontSize());
    font.setColor(getBaseColor());//from  ww  w  . ja v  a  2  s  .  c o  m
    if (getStyle() != null)
        font.setStyle(getStyle());
    String text = getText();
    if (text.length() == 0)
        text = " ";
    text = text.replace(">", ">");
    text = text.replace("&lt;", "<");

    Chunk chunk = new Chunk(text, font);
    if (getParagraph().getHyphenationAuto() != null) {
        chunk.setHyphenation(getParagraph().getHyphenationAuto());
    }
    chunk.setTextRise(getTextRise());
    chunk.setSkew(getSkewAlpha(), getSkewBeta());
    paragraph.add(chunk);
}