Class GlyphShape

    • Constructor Detail

      • GlyphShape

        public GlyphShape​(int renderModes,
                          char symbol,
                          Font.Glyph glyph,
                          float x,
                          float y)
        Creates a new GlyphShape
        Parameters:
        renderModes - Graph's Region render modes, see create(..).
        symbol - the represented character
        glyph - the Font.Glyph
        x - the intended unscaled X position of this Glyph, e.g. if part of a string - otherwise use zero.
        y - the intended unscaled Y position of this Glyph, e.g. if part of a string - otherwise use zero.
        See Also:
        processString(List, int, Font, String)
      • GlyphShape

        public GlyphShape​(int renderModes,
                          Font font,
                          char symbol,
                          float x,
                          float y)
        Creates a new GlyphShape
        Parameters:
        renderModes - Graph's Region render modes, see create(..).
        font - the Font to lookup the symbol's Font.Glyph
        symbol - the represented character
        x - the intended unscaled X position of this Glyph, e.g. if part of a string - otherwise use zero.
        y - the intended unscaled Y position of this Glyph, e.g. if part of a string - otherwise use zero.
    • Method Detail

      • getSymbol

        public char getSymbol()
        Returns the char symbol to be rendered.
      • getFont

        public Font getFont()
        Returns the Font used to render the text
      • getOrigPos

        public Vec3f getOrigPos()
        Returns the unscaled original position of this glyph, e.g. if part of a string, otherwise zero. Method borrows and returns the internal instance.
        See Also:
        processString(List, int, Font, String)
      • getOrigPos

        public Vec3f getOrigPos​(Vec3f s)
        Returns the unscaled original position of this glyph, e.g. if part of a string, otherwise zero.
        Parameters:
        s - Vec3f storage to be returned
        Returns:
        storage containing the unscaled original position
        See Also:
        processString(List, int, Font, String)
      • resetPos

        public void resetPos​(float scale)
        Resets this Shape's position to the scaled original position, see getOrigPos(float).
      • resetPosAndScale

        public void resetPosAndScale​(float scale)
        Resets this Shape's position to the scaled original position and set scale, see resetPos(float).
      • processString

        public static final AABBox processString​(List<GlyphShape> res,
                                                 int renderModes,
                                                 Font font,
                                                 String text)
        Process the given text resulting in a list of GlyphShapes with stored original position #getOrigX() and #getOrigY() each at font em-size [0..1].
        Parameters:
        res - storage for resulting GlyphShapes.
        renderModes - Graph's Region render modes, see create(..).
        font - Font used
        text - text to be represented
        Returns:
        the bounding box of the given string by taking each glyph's font em-sized [0..1] OutlineShape into account.
        See Also:
        #getOrigX(), #getOrigY()