Class JRTextMeasurerUtil

    • Field Detail

      • PROPERTY_TEXT_MEASURER_FACTORY

        public static final String PROPERTY_TEXT_MEASURER_FACTORY
        Property that specifies a text measurer factory.

        This property can either hold the name of a text measurer factory class, e.g.

         net.sf.jasperreports.text.measurer.factory=org.me.MyTextMeasurerFactory
         
        or hold an alias of a text measurer factory class property, e.g.
         net.sf.jasperreports.text.measurer.factory=myTextMeasurer
         ...
         net.sf.jasperreports.text.measurer.factory.myTextMeasurer=org.me.MyTextMeasurerFactory
         

        See Also:
        JRTextMeasurerFactory, Constant Field Values
    • Method Detail

      • createTextMeasurer

        public JRTextMeasurer createTextMeasurer​(JRCommonText text)
        Creates a text measurer for a text object.

        If the text object is an instance of JRPropertiesHolder, its properties are used when determining the text measurer factory.

        Parameters:
        text - the text object
        Returns:
        a text measurer for the text object
      • createTextMeasurer

        public JRTextMeasurer createTextMeasurer​(JRCommonText text,
                                                 JRPropertiesHolder propertiesHolder)
        Creates a text measurer for a text object.
        Parameters:
        text - the text object
        propertiesHolder - the properties to use for determining the text measurer factory; can be null
        Returns:
        a text measurer for the text object
      • getFactory

        public JRTextMeasurerFactory getFactory​(JRPropertiesHolder propertiesHolder)
        Returns the text measurer factory given a set of properties.
        Parameters:
        propertiesHolder - the properties holder
        Returns:
        the text measurer factory
      • measureTextElement

        public void measureTextElement​(JRPrintText printText)