Class FontFace

java.lang.Object
org.opencv.imgproc.FontFace

public class FontFace extends Object
Wrapper on top of a truetype/opentype/etc font, i.e. Freetype's FT_Face. The class is used to store the loaded fonts; the font can then be passed to the functions putText and getTextSize.
  • Field Details

    • nativeObj

      protected final long nativeObj
  • Constructor Details

    • FontFace

      protected FontFace(long addr)
    • FontFace

      public FontFace()
      loads default font
    • FontFace

      public FontFace(String fontPathOrName)
      loads font at the specified path or with specified name.
      Parameters:
      fontPathOrName - either path to the custom font or the name of embedded font: "sans", "italic" or "uni". Empty fontPathOrName means the default embedded font.
  • Method Details

    • getNativeObjAddr

      public long getNativeObjAddr()
    • __fromPtr__

      public static FontFace __fromPtr__(long addr)
    • set

      public boolean set(String fontPathOrName)
      loads new font face
      Parameters:
      fontPathOrName - automatically generated
      Returns:
      automatically generated
    • getName

      public String getName()
    • setInstance

      public boolean setInstance(MatOfInt params)
      sets the current variable font instance.
      Parameters:
      params - The list of pairs key1, value1, key2, value2, ..., e.g. myfont.setInstance({CV_FOURCC('w','g','h','t'), 400<<16, CV_FOURCC('s','l','n','t'), -(15<<16)}); Note that the parameter values are specified in 16.16 fixed-point format, that is, integer values need to be shifted by 16 (or multiplied by 65536).
      Returns:
      automatically generated
    • getInstance

      public boolean getInstance(MatOfInt params)