Class AtlassianRandomFontGenerator

java.lang.Object
com.atlassian.bamboo.captcha.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 Details

    • AtlassianRandomFontGenerator

      public AtlassianRandomFontGenerator()
  • Method Details

    • 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