java.lang.Object
io.github.jwharm.cairobindings.Proxy
org.freedesktop.cairo.FontFace
org.freedesktop.cairo.FTFontFace
Provides a FontFace for FreeType.
The FreeType font backend is primarily used to render text on GNU/Linux systems, but can be used on other platforms too.
- Since:
- 1.0
-
Constructor Summary
ConstructorDescriptionFTFontFace
(MemorySegment address) Constructor used internally to instantiate a java FTFontFace object for a nativecairo_font_face
instance -
Method Summary
Modifier and TypeMethodDescriptionstatic FTFontFace
Creates a new font face for the FreeType font backend from a pre-opened FreeType face.SeeFTSynthesize
.void
setSynthesize
(Set<FTSynthesize> synthFlags) FreeType provides the ability to synthesize different glyphs from a base font, which is useful if you lack those glyphs from a true bold or oblique font.void
unsetSynthesize
(Set<FTSynthesize> synthFlags) SeeFTSynthesize
.Methods inherited from class org.freedesktop.cairo.FontFace
destroy, getFontType, getType, getUserData, setUserData, status
-
Constructor Details
-
FTFontFace
Constructor used internally to instantiate a java FTFontFace object for a nativecairo_font_face
instance- Parameters:
address
- the memory address of the nativecairo_font_face
instance
-
-
Method Details
-
create
Creates a new font face for the FreeType font backend from a pre-opened FreeType face. This font can then be used withContext.setFontFace(FontFace)
orFTScaledFont.create(FTFontFace, Matrix, Matrix, FontOptions)
. TheFTScaledFont
returned fromFTScaledFont.create()
is also for the FreeType backend and can be used with functions such asFTScaledFont.lockFace()
. Note that Cairo may keep a reference to the FT_Face alive in a font-cache and the exact lifetime of the reference depends highly upon the exact usage pattern and is subject to external factors. The Java bindings will callFT_Done_Face()
when the last reference to theFTFontFace
has been dropped (using aCleaner
).- Parameters:
ftFace
- A FreeType face object, already opened.loadFlags
- flags to pass toFT_Load_Glyph
when loading glyphs from the font. These flags are OR'ed together with the flags derived from theFontOptions
passed toScaledFont.create(FontFace, Matrix, Matrix, FontOptions)
, so only a few values such asFT_LOAD_VERTICAL_LAYOUT
, andFT_LOAD_FORCE_AUTOHINT
are useful. You should not pass any of the flags affecting the load target, such asFT_LOAD_TARGET_LIGHT
.- Returns:
- a newly created FTFontFace.
- Since:
- 1.0
-
getSynthesize
SeeFTSynthesize
.- Returns:
- the current set of synthesis options.
- Since:
- 1.12
-
setSynthesize
FreeType provides the ability to synthesize different glyphs from a base font, which is useful if you lack those glyphs from a true bold or oblique font. See alsoFTSynthesize
.- Parameters:
synthFlags
- the set of synthesis options to enable- Since:
- 1.12
-
unsetSynthesize
SeeFTSynthesize
.- Parameters:
synthFlags
- the set of synthesis options to disable- Since:
- 1.12
-