Class PDF16RichTextFormatter

    • Method Detail

      • getFormatterInstance

        public static PDF16RichTextFormatter getFormatterInstance​(CSS20FontSet fontSet)
        Create a PDF16RichTextFormatter for formatting text.

        Concurrency

        The PDF16RichTextFormatter instance that is returned from this method is not in general thread safe.
        Parameters:
        fontSet - A CSS20FontSet that has had all fonts and fallbacks fonts that are relevant to the caller added.
        Returns:
        A PDF16RichTextFormatter to be used for formatting text
      • getFontSetInstance

        public static CSS20FontSet getFontSetInstance()
        Create a CSS20FontSet for use with a PDF16RichTextFormatter. The returned CSS20FontSet is intended to be shared among thread and documents. Optimal performance will be achieved by sharing them in this way.

        Concurrency

        The instance implementing the CSS20FontSet interface that is returned from this method offers some tighter thread safety guarantees than that guaranteed by the CSS20FontSet interface. It is safe to use the CSS20FontSet object for font resolution from multiple threads at one time as long as the methods which change the state of the CSS20FontSet object are not called at any time that the PDF16RichTextFormatter objects to which it has been given may be using it for font resolution. There is no mechanism within CSSPPDF16Formatter or CSS20FontSet to guarantee that this doesn't occur. A client program can guarantee this by modifying the CSS20FontSet object fully before giving it to one or more PDF16RichTextFormatter objects in one or more threads. A client program could also use some synchronization constructs of its own to guarantee this. This means that the addFont(), setFallbackFonts(), setGenericFont(), and setResolutionPriority() methods can not be called while there is any chance that the CSS20FontSet object may be being used for font resolution. It is also safe to copy this CSS20FontSet object except when it is possible that it may be being modified. It is again the responsibility of the client to ensure that this doesn't happen.
        Returns:
        An empty CSS20FontSet that can be used with a PDF16RichTextFormatter
      • getFontSetInstance

        public static CSS20FontSet getFontSetInstance​(FamilyNameNormalizer normalizer)
        Create a CSS20FontSet for use with a PDF16RichTextFormatter. This method allows a client to specify a FamilyNameNormalizer object that is used to modify the font family name of every Font object added to the CSS20FontSet. It is also used to modify the font names inside of any search request.

        Concurrency

        The instance implementing the CSS20FontSet interface that is returned from this method offers some tighter thread safety guarantees than that guaranteed by the CSS20FontSet interface. It is safe to use the CSS20FontSet object for font resolution from multiple threads at one time as long as the methods which change the state of the CSS20FontSet object are not called at any time that the PDF16RichTextFormatter objects to which it has been given may be using it for font resolution. There is no mechanism within CSSPPDF16Formatter or CSS20FontSet to guarantee that this doesn't occur. A client program can guarantee this by modifying the CSS20FontSet object fully before giving it to one or more PDF16RichTextFormatter objects in one or more threads. A client program could also use some synchronization constructs of its own to guarantee this. This means that the addFont(), setFallbackFonts(), setGenericFont(), and setResolutionPriority() methods can not be called while there is any chance that the CSS20FontSet object may be being used for font resolution. It is also safe to copy this CSS20FontSet object except when it is possible that it may be being modified. It is again the responsibility of the client to ensure that this doesn't happen.
        Parameters:
        normalizer - A FamilyNameNormalizer used for adjusting font family names.
        Returns:
        An empty CSS20FontSet that can be used with a PDF16RichTextFormatter
      • getFontSetInstance

        public static CSS20FontSet getFontSetInstance​(CSS20FontSet original)
        Create a copy of a CSS20FontSet for use with a PDF16RichTextFormatter.

        Concurrency

        The instance implementing the CSS20FontSet interface that is returned from this method offers some tighter thread safety guarantees than that guaranteed by the CSS20FontSet interface. It is safe to use the CSS20FontSet object for font resolution from multiple threads at one time as long as the methods which change the state of the CSS20FontSet object are not called at any time that the PDF16RichTextFormatter objects to which it has been given may be using it for font resolution. There is no mechanism within CSSPPDF16Formatter or CSS20FontSet to guarantee that this doesn't occur. A client program can guarantee this by modifying the CSS20FontSet object fully before giving it to one or more PDF16RichTextFormatter objects in one or more threads. A client program could also use some synchronization constructs of its own to guarantee this. This means that the addFont(), setFallbackFonts(), setGenericFont(), and setResolutionPriority() methods can not be called while there is any chance that the CSS20FontSet object may be being used for font resolution. It is also safe to copy this CSS20FontSet object except when it is possible that it may be being modified. It is again the responsibility of the client to ensure that this doesn't happen.
        Parameters:
        original - the CSS20FontSet to copy
        Returns:
        A copy of a CSS20FontSet that can be used with a PDF16RichTextFormatter