Package com.itextpdf.tool.xml.css.apply
Class ChunkCssApplier
java.lang.Object
com.itextpdf.tool.xml.css.apply.ChunkCssApplier
- All Implemented Interfaces:
CssApplier<Chunk>
Applies CSS Rules to Chunks
-
Field Summary
FieldsModifier and TypeFieldDescriptionFF4 and IE8 provide normal text and bold text.protected FontProvider
protected final CssUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(Chunk c, Tag t, MarginMemory mm, PageSizeContainable psc, HtmlPipelineContext ctx) Styles an elementvoid
copyChunkStyles
(Chunk source, Chunk target) Method used for copying styles from one chunk to another.float
Method used for retrieving the widest word of a chunk of text.protected boolean
isBoldValue
(String value) void
setFontProvider
(FontProvider fontProvider)
-
Field Details
-
BOLD
FF4 and IE8 provide normal text and bold text. All other values are translated to one of these 2 styles
100 - 500 and "lighter" = normal.
600 - 900 and "bolder" = bold. -
utils
-
fontProvider
-
-
Constructor Details
-
ChunkCssApplier
public ChunkCssApplier() -
ChunkCssApplier
-
-
Method Details
-
apply
-
apply
public Chunk apply(Chunk c, Tag t, MarginMemory mm, PageSizeContainable psc, HtmlPipelineContext ctx) Description copied from interface:CssApplier
Styles an element- Specified by:
apply
in interfaceCssApplier<Chunk>
- Parameters:
c
- the Chunk to apply CSS to.t
- the tag containing the chunk datamm
- the MarginMemorypsc
- the PageSizeContainablectx
- the HtmlPipelineContext- Returns:
- the styled chunk
-
applyFontStyles
-
getWidestWord
Method used for retrieving the widest word of a chunk of text. All styles of the chunk will be taken into account when calculating the width of the words.- Parameters:
c
- chunk of which the widest word is required.- Returns:
- float containing the width of the widest word.
-
copyChunkStyles
Method used for copying styles from one chunk to another. Could be deprecated if the content of a chunk can be overwritten.- Parameters:
source
- chunk which contains the required styles.target
- chunk which needs the required styles.
-
getFontProvider
-
setFontProvider
-
isBoldValue
-