Package io.github.humbleui.skija
Class FontMgr
- java.lang.Object
-
- io.github.humbleui.skija.impl.Native
-
- io.github.humbleui.skija.impl.Managed
-
- io.github.humbleui.skija.impl.RefCnt
-
- io.github.humbleui.skija.FontMgr
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
TypefaceFontProvider
public class FontMgr extends RefCnt
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFontMgr._DefaultHolder-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.RefCnt
RefCnt._FinalizerHolder
-
Nested classes/interfaces inherited from class io.github.humbleui.skija.impl.Managed
Managed.CleanerThunk
-
-
Field Summary
-
Fields inherited from class io.github.humbleui.skija.impl.Managed
_cleanable
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long_nDefault()static int_nGetFamiliesCount(long ptr)static java.lang.String_nGetFamilyName(long ptr, int index)static long_nMakeFromData(long ptr, long dataPtr, int ttcIndex)static long_nMakeStyleSet(long ptr, int index)static long_nMatchFamily(long ptr, java.lang.String familyName)static long_nMatchFamilyStyle(long ptr, java.lang.String familyName, int fontStyle)static long_nMatchFamilyStyleCharacter(long ptr, java.lang.String familyName, int fontStyle, java.lang.String[] bcp47, int character)static FontMgrgetDefault()Return the default fontmgr.intgetFamiliesCount()java.lang.StringgetFamilyName(int index)TypefacemakeFromData(Data data)Create a typeface for the specified data and TTC index (pass 0 for none) or null if the data is not recognized.TypefacemakeFromData(Data data, int ttcIndex)FontStyleSetmakeStyleSet(int index)@Nullable TypefacematchFamiliesStyle(java.lang.String[] families, FontStyle style)@Nullable TypefacematchFamiliesStyleCharacter(java.lang.String[] families, FontStyle style, @Nullable java.lang.String[] bcp47, int character)FontStyleSetmatchFamily(java.lang.String familyName)The caller must callManaged.close()on the returned object.@Nullable TypefacematchFamilyStyle(java.lang.String familyName, FontStyle style)Find the closest matching typeface to the specified familyName and style and return a ref to it.TypefacematchFamilyStyleCharacter(@Nullable java.lang.String familyName, FontStyle style, @Nullable java.lang.String[] bcp47, int character)Use the system fallback to find a typeface for the given character.-
Methods inherited from class io.github.humbleui.skija.impl.RefCnt
_nGetFinalizer, _nGetRefCount, getRefCount, toString
-
Methods inherited from class io.github.humbleui.skija.impl.Managed
_nInvokeFinalizer, close, isClosed
-
Methods inherited from class io.github.humbleui.skija.impl.Native
_nativeEquals, equals, getPtr, hashCode
-
-
-
-
Method Detail
-
getFamiliesCount
public int getFamiliesCount()
-
getFamilyName
public java.lang.String getFamilyName(int index)
-
makeStyleSet
public FontStyleSet makeStyleSet(int index)
-
matchFamily
public FontStyleSet matchFamily(java.lang.String familyName)
The caller must callManaged.close()on the returned object. Never returns null; will return an empty set if the name is not found. Passing null as the parameter will return the default system family. Note that most systems don't have a default system family, so passing null will often result in the empty set. It is possible that this will return a style set not accessible frommakeStyleSet(int)due to hidden or auto-activated fonts.
-
matchFamilyStyle
@Nullable public @Nullable Typeface matchFamilyStyle(java.lang.String familyName, FontStyle style)
Find the closest matching typeface to the specified familyName and style and return a ref to it. The caller must callManaged.close()on the returned object. Will return null if no 'good' match is found. Passing null as the parameter for `familyName` will return the default system font. It is possible that this will return a style set not accessible frommakeStyleSet(int)ormatchFamily(String)due to hidden or auto-activated fonts.
-
matchFamiliesStyle
@Nullable public @Nullable Typeface matchFamiliesStyle(java.lang.String[] families, FontStyle style)
-
matchFamilyStyleCharacter
public Typeface matchFamilyStyleCharacter(@Nullable @Nullable java.lang.String familyName, FontStyle style, @Nullable @Nullable java.lang.String[] bcp47, int character)
Use the system fallback to find a typeface for the given character. Note that bcp47 is a combination of ISO 639, 15924, and 3166-1 codes, so it is fine to just pass a ISO 639 here. Will return null if no family can be found for the character in the system fallback. Passing `null` as the parameter for `familyName` will return the default system font. bcp47[0] is the least significant fallback, bcp47[bcp47.length-1] is the most significant. If no specified bcp47 codes match, any font with the requested character will be matched.
-
matchFamiliesStyleCharacter
@Nullable public @Nullable Typeface matchFamiliesStyleCharacter(java.lang.String[] families, FontStyle style, @Nullable @Nullable java.lang.String[] bcp47, int character)
-
makeFromData
public Typeface makeFromData(Data data)
Create a typeface for the specified data and TTC index (pass 0 for none) or null if the data is not recognized. The caller must callManaged.close()on the returned object if it is not null.
-
getDefault
public static FontMgr getDefault()
Return the default fontmgr.
-
_nGetFamiliesCount
public static int _nGetFamiliesCount(long ptr)
-
_nGetFamilyName
public static java.lang.String _nGetFamilyName(long ptr, int index)
-
_nMakeStyleSet
public static long _nMakeStyleSet(long ptr, int index)
-
_nMatchFamily
public static long _nMatchFamily(long ptr, java.lang.String familyName)
-
_nMatchFamilyStyle
public static long _nMatchFamilyStyle(long ptr, java.lang.String familyName, int fontStyle)
-
_nMatchFamilyStyleCharacter
public static long _nMatchFamilyStyleCharacter(long ptr, java.lang.String familyName, int fontStyle, java.lang.String[] bcp47, int character)
-
_nMakeFromData
public static long _nMakeFromData(long ptr, long dataPtr, int ttcIndex)
-
_nDefault
public static long _nDefault()
-
-