Class FontFace


  • public class FontFace
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected long nativeObj  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        FontFace()
      loads default font
      protected FontFace​(long addr)  
        FontFace​(java.lang.String fontPathOrName)
      loads font at the specified path or with specified name.
    • Field Detail

      • nativeObj

        protected final long nativeObj
    • Constructor Detail

      • FontFace

        protected FontFace​(long addr)
      • FontFace

        public FontFace()
        loads default font
      • FontFace

        public FontFace​(java.lang.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 Detail

      • getNativeObjAddr

        public long getNativeObjAddr()
      • __fromPtr__

        public static FontFace __fromPtr__​(long addr)
      • set

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

        public java.lang.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)
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable