Class Shaper

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Shaper
    extends Managed
    Shapes text using HarfBuzz and places the shaped text into a client-managed buffer.
    • Constructor Detail

      • Shaper

        @Internal
        public Shaper​(long ptr)
    • Method Detail

      • makePrimitive

        @NotNull
        @Contract("-> new")
        public static @NotNull Shaper makePrimitive()
      • makeShaperDrivenWrapper

        @NotNull
        @Contract("-> new")
        public static @NotNull Shaper makeShaperDrivenWrapper()
      • makeShaperDrivenWrapper

        @NotNull
        @Contract("_ -> new")
        public static @NotNull Shaper makeShaperDrivenWrapper​(@Nullable
                                                              @Nullable FontMgr fontMgr)
      • makeShapeThenWrap

        @NotNull
        @Contract("-> new")
        public static @NotNull Shaper makeShapeThenWrap()
      • makeShapeThenWrap

        @NotNull
        @Contract("_ -> new")
        public static @NotNull Shaper makeShapeThenWrap​(@Nullable
                                                        @Nullable FontMgr fontMgr)
      • makeShapeDontWrapOrReorder

        @NotNull
        @Contract("-> new")
        public static @NotNull Shaper makeShapeDontWrapOrReorder()
      • makeShapeDontWrapOrReorder

        @NotNull
        @Contract("_ -> new")
        public static @NotNull Shaper makeShapeDontWrapOrReorder​(@Nullable
                                                                 @Nullable FontMgr fontMgr)
      • makeCoreText

        @NotNull
        @Contract("-> new")
        public static @NotNull Shaper makeCoreText()

        Only works on macOS

        WARN broken in m87 https://bugs.chromium.org/p/skia/issues/detail?id=10897

        Returns:
        Shaper on macOS, throws UnsupportedOperationException elsewhere
      • make

        @NotNull
        @Contract("-> new")
        public static @NotNull Shaper make()
      • make

        @NotNull
        @Contract("_ -> new")
        public static @NotNull Shaper make​(@Nullable
                                           @Nullable FontMgr fontMgr)
      • shape

        @Nullable
        @Contract("_, _ -> new")
        public @Nullable TextBlob shape​(java.lang.String text,
                                        Font font)
      • shape

        @Nullable
        @Contract("_, _, _ -> new")
        public @Nullable TextBlob shape​(java.lang.String text,
                                        Font font,
                                        float width)
      • shape

        @Nullable
        @Contract("_, _, _, _ -> new")
        public @Nullable TextBlob shape​(java.lang.String text,
                                        Font font,
                                        float width,
                                        @NotNull
                                        @NotNull io.github.humbleui.types.Point offset)
      • shape

        @Nullable
        @Contract("_, _, _, _, _ -> new")
        public @Nullable TextBlob shape​(java.lang.String text,
                                        @NotNull
                                        @NotNull Font font,
                                        @NotNull
                                        @NotNull ShapingOptions opts,
                                        float width,
                                        @NotNull
                                        @NotNull io.github.humbleui.types.Point offset)
      • shapeLine

        @NotNull
        @Contract("_, _, _ -> new")
        public @NotNull TextLine shapeLine​(java.lang.String text,
                                           @NotNull
                                           @NotNull Font font,
                                           @NotNull
                                           @NotNull ShapingOptions opts)
      • shapeLine

        @NotNull
        @Contract("_, _, _ -> new")
        public @NotNull TextLine shapeLine​(java.lang.String text,
                                           Font font)
      • shape

        @NotNull
        @Contract("_, _, _, _, _ -> this")
        public @NotNull Shaper shape​(java.lang.String text,
                                     Font font,
                                     @NotNull
                                     @NotNull ShapingOptions opts,
                                     float width,
                                     RunHandler runHandler)
      • shape

        @NotNull
        @Contract("_, _, _, _, _, _, _ -> this")
        public @NotNull Shaper shape​(@NotNull
                                     @NotNull java.lang.String text,
                                     @NotNull
                                     @NotNull java.util.Iterator<FontRun> fontIter,
                                     @NotNull
                                     @NotNull java.util.Iterator<BidiRun> bidiIter,
                                     @NotNull
                                     @NotNull java.util.Iterator<ScriptRun> scriptIter,
                                     @NotNull
                                     @NotNull java.util.Iterator<LanguageRun> langIter,
                                     @NotNull
                                     @NotNull ShapingOptions opts,
                                     float width,
                                     @NotNull
                                     @NotNull RunHandler runHandler)
      • shape

        @NotNull
        @Contract("_, _, _, _, _, _, _ -> this")
        public @NotNull Shaper shape​(@NotNull
                                     @NotNull ManagedString textUtf8,
                                     @NotNull
                                     @NotNull java.util.Iterator<FontRun> fontIter,
                                     @NotNull
                                     @NotNull java.util.Iterator<BidiRun> bidiIter,
                                     @NotNull
                                     @NotNull java.util.Iterator<ScriptRun> scriptIter,
                                     @NotNull
                                     @NotNull java.util.Iterator<LanguageRun> langIter,
                                     @NotNull
                                     @NotNull ShapingOptions opts,
                                     float width,
                                     @NotNull
                                     @NotNull RunHandler runHandler)
      • _nGetFinalizer

        public static long _nGetFinalizer()
      • _nMakePrimitive

        public static long _nMakePrimitive()
      • _nMakeShaperDrivenWrapper

        public static long _nMakeShaperDrivenWrapper​(long fontMgrPtr)
      • _nMakeShapeThenWrap

        public static long _nMakeShapeThenWrap​(long fontMgrPtr)
      • _nMakeShapeDontWrapOrReorder

        public static long _nMakeShapeDontWrapOrReorder​(long fontMgrPtr)
      • _nMakeCoreText

        public static long _nMakeCoreText()
      • _nMake

        public static long _nMake​(long fontMgrPtr)
      • _nShapeBlob

        public static long _nShapeBlob​(long ptr,
                                       java.lang.String text,
                                       long fontPtr,
                                       ShapingOptions opts,
                                       float width,
                                       float offsetX,
                                       float offsetY)
      • _nShapeLine

        public static long _nShapeLine​(long ptr,
                                       java.lang.String text,
                                       long fontPtr,
                                       ShapingOptions opts)
      • _nShape

        public static void _nShape​(long ptr,
                                   long textPtr,
                                   java.util.Iterator<FontRun> fontIter,
                                   java.util.Iterator<BidiRun> bidiIter,
                                   java.util.Iterator<ScriptRun> scriptIter,
                                   java.util.Iterator<LanguageRun> langIter,
                                   ShapingOptions opts,
                                   float width,
                                   RunHandler runHandler)