Tabnine Logo
Chunk.setTextRise
Code IndexAdd Tabnine to your IDE (free)

How to use
setTextRise
method
in
com.itextpdf.text.Chunk

Best Java code snippets using com.itextpdf.text.Chunk.setTextRise (Showing top 5 results out of 315)

origin: stackoverflow.com

 public Chunk addSuperscript(String text) {
 float leading = determineCurrentLeading();
 Font f = determineCurrentFont();
 Font supFont = new Font(f);
 supFont.setSize(f.getSize() / 2f);
 Chunk c = new Chunk(text, supFont);
 c.setTextRise(leading / 2f);
 return c;
}
origin: stackoverflow.com

 Paragraph p = new Paragraph();
Chunk smallChunk = new Chunk("small middle", BLUE);
smallChunk.setTextRise( (15 - 6) / 2);
p.add(smallChunk);
p.add(new Chunk("big middle", RED));
origin: stackoverflow.com

chunk.setTextRise(8);
origin: com.itextpdf/itextpdf

/**
 * Creates an iText Chunk
 * @param content the content of the Chunk
 * @param chain the hierarchy chain
 * @return a Chunk
 */
public Chunk createChunk(final String content, final ChainedProperties chain) {
  Font font = getFont(chain);
  Chunk ck = new Chunk(content, font);
  if (chain.hasProperty(HtmlTags.SUB))
    ck.setTextRise(-font.getSize() / 2);
  else if (chain.hasProperty(HtmlTags.SUP))
    ck.setTextRise(font.getSize() / 2);
  ck.setHyphenation(getHyphenation(chain));
  return ck;
}
origin: com.itextpdf/itextg

/**
 * Creates an iText Chunk
 * @param content the content of the Chunk
 * @param chain the hierarchy chain
 * @return a Chunk
 */
public Chunk createChunk(final String content, final ChainedProperties chain) {
  Font font = getFont(chain);
  Chunk ck = new Chunk(content, font);
  if (chain.hasProperty(HtmlTags.SUB))
    ck.setTextRise(-font.getSize() / 2);
  else if (chain.hasProperty(HtmlTags.SUP))
    ck.setTextRise(font.getSize() / 2);
  ck.setHyphenation(getHyphenation(chain));
  return ck;
}
com.itextpdf.textChunksetTextRise

Javadoc

Sets the text displacement relative to the baseline. Positive values rise the text, negative values lower the text.

It can be used to implement sub/superscript.

Popular methods of Chunk

  • <init>
    Constructs a chunk of text with a certain content and a certain Font.
  • setBackground
    Sets the color and the size of the background Chunk.
  • getContent
    Returns the content of this Chunk.
  • getWidthPoint
    Gets the width of the Chunk in points.
  • setGenericTag
    Sets the generic tag Chunk. The text for this tag can be retrieved with PdfPageEvent.
  • getFont
    Gets the font of this Chunk.
  • setFont
    Sets the font of this Chunk.
  • setLocalDestination
    Sets a local destination for this Chunk.
  • append
    appends some text to this Chunk.
  • createTabspace
  • createWhitespace
  • getAccessibleAttribute
  • createWhitespace,
  • getAccessibleAttribute,
  • getAccessibleAttributes,
  • getAttributes,
  • getHorizontalScaling,
  • getHyphenation,
  • getId,
  • getImage,
  • getRole

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • getApplicationContext (Context)
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JTable (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now