Class TextSpan

java.lang.Object
com.github.weisj.jsvg.nodes.AbstractSVGNode
com.github.weisj.jsvg.nodes.container.BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
com.github.weisj.jsvg.nodes.text.TextSpan
All Implemented Interfaces:
Container<com.github.weisj.jsvg.nodes.text.TextSegment>, HasContext, HasContext.ByDelegate, HasFontContext, HasFontRenderContext, HasPaintContext, HasShape, HasVectorEffects, SVGNode, CursorContext, com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment

@ElementCategories({TextContent,TextContentChild}) @PermittedContent(categories=Descriptive, anyOf={Anchor.class,TextSpan.class,Animate.class,AnimateTransform.class,Set.class}, charData=true) public final class TextSpan extends BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment> implements com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
  • Field Details

    • TAG

      public static final String TAG
      See Also:
    • x

      protected Length[] x
    • y

      protected Length[] y
    • dx

      protected Length[] dx
    • dy

      protected Length[] dy
    • rotate

      protected float[] rotate
    • children

      protected final List<com.github.weisj.jsvg.nodes.text.TextSegment> children
    • isVisible

      protected boolean isVisible
    • fontSpec

      protected AttributeFontSpec fontSpec
    • lengthAdjust

      protected LengthAdjust lengthAdjust
    • textLength

      protected Length textLength
  • Constructor Details

    • TextSpan

      public TextSpan()
  • Method Details

    • tagName

      @NotNull public @NotNull String tagName()
      Specified by:
      tagName in interface SVGNode
    • doAdd

      protected void doAdd(@NotNull @NotNull SVGNode node)
      Specified by:
      doAdd in class BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
    • addContent

      public void addContent(@NotNull TextContent.Segment content)
      Specified by:
      addContent in interface SVGNode
    • acceptChild

      protected boolean acceptChild(@Nullable @Nullable String id, @NotNull @NotNull SVGNode node)
      Description copied from class: BaseContainerNode
      Determine whether the container accepts this SVGNode as a child. By default, this will always report true but subclasses may choose to reject certain types of nodes.
      Overrides:
      acceptChild in class BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
      Parameters:
      id - the id of the node
      node - the node itself
      Returns:
      whether the node can be inserted as a child.
    • prepareSegmentForRendering

      public void prepareSegmentForRendering(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context, @NotNull @NotNull TextOutput textOutput)
      Specified by:
      prepareSegmentForRendering in interface com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
    • renderSegmentWithoutLayout

      public void renderSegmentWithoutLayout(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context, @NotNull @NotNull Output output)
      Specified by:
      renderSegmentWithoutLayout in interface com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
    • computeTextMetrics

      @NotNull public @NotNull TextMetrics computeTextMetrics(@NotNull @NotNull RenderContext context, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment.UseTextLengthForCalculation flag)
      Specified by:
      computeTextMetrics in interface com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
    • appendTextShape

      public void appendTextShape(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.MutableGlyphRun glyphRun, @NotNull @NotNull RenderContext context)
      Specified by:
      appendTextShape in interface com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
    • isSegmentVisible

      public boolean isSegmentVisible(@NotNull @NotNull RenderContext currentContext)
    • build

      @MustBeInvokedByOverriders public void build(@NotNull @NotNull AttributeNode attributeNode)
      Specified by:
      build in interface SVGNode
    • createLocalCursor

      @NotNull public @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor createLocalCursor(boolean isInitial, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current)
      Specified by:
      createLocalCursor in interface CursorContext
    • cleanUpLocalCursor

      public void cleanUpLocalCursor(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor local)
      Specified by:
      cleanUpLocalCursor in interface CursorContext
    • vectorEffects

      @NotNull public @NotNull Set<VectorEffect> vectorEffects()
      Specified by:
      vectorEffects in interface HasVectorEffects
    • contextDelegate

      @NotNull public @NotNull HasContext contextDelegate()
      Specified by:
      contextDelegate in interface HasContext.ByDelegate
    • children

      public List<? extends com.github.weisj.jsvg.nodes.text.TextSegment> children()
      Description copied from interface: Container
      Return all children of this container. Note that the return type of this function internationally contains a wild card to make it a compilation error trying to modify it.
      Specified by:
      children in interface Container<T>
      Returns:
      the list of children.
    • isVisible

      public boolean isVisible(@NotNull @NotNull RenderContext context)
    • textAnchor

      public final TextAnchor textAnchor(@NotNull @NotNull RenderContext context)
    • untransformedElementShape

      @NotNull public final @NotNull Shape untransformedElementShape(@NotNull @NotNull RenderContext context, @NotNull @NotNull HasShape.Box box)
      Specified by:
      untransformedElementShape in interface HasShape
    • untransformedElementBounds

      @NotNull public @NotNull Rectangle2D untransformedElementBounds(@NotNull @NotNull RenderContext context, HasShape.Box box)
      Specified by:
      untransformedElementBounds in interface HasShape