Package org.opencv.imgproc
Class FontFace
- java.lang.Object
-
- org.opencv.imgproc.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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FontFace
__fromPtr__(long addr)
protected void
finalize()
boolean
getInstance(MatOfInt params)
java.lang.String
getName()
long
getNativeObjAddr()
boolean
set(java.lang.String fontPathOrName)
loads new font faceboolean
setInstance(MatOfInt params)
sets the current variable font instance.
-
-
-
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 classjava.lang.Object
- Throws:
java.lang.Throwable
-
-