Class AtlassianRandomFontGenerator

  • All Implemented Interfaces:
    com.octo.captcha.component.image.fontgenerator.FontGenerator

    public class AtlassianRandomFontGenerator
    extends Object
    implements com.octo.captcha.component.image.fontgenerator.FontGenerator
    • Constructor Detail

      • AtlassianRandomFontGenerator

        public AtlassianRandomFontGenerator()
    • Method Detail

      • getFont

        public Font getFont()
        Specified by:
        getFont in interface com.octo.captcha.component.image.fontgenerator.FontGenerator
        Returns:
        a random Font from the pool
      • getMinFontSize

        public int getMinFontSize()
        Specified by:
        getMinFontSize in interface com.octo.captcha.component.image.fontgenerator.FontGenerator
      • getMaxFontSize

        public int getMaxFontSize()
        Specified by:
        getMaxFontSize in interface com.octo.captcha.component.image.fontgenerator.FontGenerator
      • applyRandomStyle

        protected Font applyRandomStyle​(Font font)
      • getRandomFontsForCaptchas

        @NotNull
        protected @NotNull List<Font> getRandomFontsForCaptchas​(Iterable<Font> uncheckedFonts,
                                                                int fontsToReturn)
        Create list of fonts that are not blacklisted for captcha and can display all requiredCharacters. This method will not return more than fontsToReturn to avoid a problem of OS X - every font checked by canDisplay() remains open 'forever'.
        Parameters:
        uncheckedFonts - fonts to validate for captcha usage
        fontsToReturn - return at least that many fonts
        Returns:
        list of fonts
        See Also:
        REQUIRED_CHARACTERS