Class Text

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.Text
All Implemented Interfaces:
Container<com.github.weisj.jsvg.nodes.text.TextSegment>, HasClip, HasContext, HasContext.ByDelegate, HasFillRule, HasFilter, HasFontContext, HasFontRenderContext, HasGeometryContext, HasGeometryContext.ByDelegate, HasPaintContext, HasShape, HasVectorEffects, Renderable, Transformable, SVGNode, com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment

@ElementCategories({Graphic,TextContent}) @PermittedContent(categories={Animation,Descriptive,TextContentChild}, anyOf=Anchor.class, charData=true) public final class Text extends BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment> implements HasGeometryContext.ByDelegate
  • Field Details

  • Constructor Details

    • Text

      public Text()
  • Method Details

    • tagName

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

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

      @NotNull public @NotNull HasGeometryContext geometryContextDelegate()
      Specified by:
      geometryContextDelegate in interface HasGeometryContext.ByDelegate
    • untransformedElementShape

      @NotNull public @NotNull Shape untransformedElementShape(@NotNull @NotNull RenderContext context)
    • render

      public void render(@NotNull @NotNull RenderContext context, @NotNull @NotNull Output output)
    • createLocalCursor

      protected com.github.weisj.jsvg.nodes.text.GlyphCursor createLocalCursor(@NotNull @NotNull RenderContext context, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current)
    • cleanUpLocalCursor

      protected void cleanUpLocalCursor(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor local)
    • 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
    • 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.
    • doAdd

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

      public final void addContent(char[] content)
      Specified by:
      addContent in interface SVGNode
      Overrides:
      addContent in class AbstractSVGNode
    • children

      public List<? extends @NotNull 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<com.github.weisj.jsvg.nodes.text.TextSegment>
      Returns:
      the list of children.
    • renderSegment

      protected final void renderSegment(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context, @NotNull @NotNull Output output)
    • 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
    • hasFixedLength

      public boolean hasFixedLength()
      Specified by:
      hasFixedLength 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
    • prepareSegmentForRendering

      public void prepareSegmentForRendering(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context)
      Specified by:
      prepareSegmentForRendering 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 Path2D textShape, @NotNull @NotNull RenderContext context)
      Specified by:
      appendTextShape in interface com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
    • untransformedElementBounds

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

      public boolean isVisible(@NotNull @NotNull RenderContext context)
      Specified by:
      isVisible in interface Renderable