JUCE  v5.1.1-3-g1a0b28c73
JUCE API
PositionedGlyph Class Reference

A glyph from a particular font, with a particular size, style, typeface and position. More...

#include <juce_GlyphArrangement.h>

Collaboration diagram for PositionedGlyph:

Public Member Functions

 PositionedGlyph () noexcept
 
 PositionedGlyph (const Font &font, juce_wchar character, int glyphNumber, float anchorX, float baselineY, float width, bool isWhitespace)
 
 PositionedGlyph (const PositionedGlyph &)
 
 PositionedGlyph (PositionedGlyph &&) noexcept
 Move constructor. More...
 
 ~PositionedGlyph ()
 
void createPath (Path &path) const
 Returns the path for this glyph. More...
 
void draw (Graphics &g) const
 Draws the glyph into a graphics context. More...
 
void draw (Graphics &g, const AffineTransform &transform) const
 Draws the glyph into a graphics context, with an extra transform applied to it. More...
 
float getBaselineY () const noexcept
 Returns the y position of the glyph's baseline. More...
 
float getBottom () const
 Returns the y position of the bottom of the glyph. More...
 
Rectangle< float > getBounds () const
 Returns the bounds of the glyph. More...
 
juce_wchar getCharacter () const noexcept
 Returns the character the glyph represents. More...
 
float getLeft () const noexcept
 Returns the position of the glyph's left-hand edge. More...
 
float getRight () const noexcept
 Returns the position of the glyph's right-hand edge. More...
 
float getTop () const
 Returns the y position of the top of the glyph. More...
 
bool hitTest (float x, float y) const
 Checks to see if a point lies within this glyph. More...
 
bool isWhitespace () const noexcept
 Checks whether the glyph is actually empty. More...
 
void moveBy (float deltaX, float deltaY)
 Shifts the glyph's position by a relative amount. More...
 
PositionedGlyphoperator= (const PositionedGlyph &)
 
PositionedGlyphoperator= (PositionedGlyph &&) noexcept
 Move assignment operator. More...
 

Private Attributes

juce_wchar character
 
Font font
 
int glyph
 
float w
 
bool whitespace
 
float x
 
float y
 

Friends

class GlyphArrangement
 

Detailed Description

A glyph from a particular font, with a particular size, style, typeface and position.

You should rarely need to use this class directly - for most purposes, the GlyphArrangement class will do what you need for text layout.

See also
GlyphArrangement, Font

Constructor & Destructor Documentation

◆ PositionedGlyph() [1/4]

PositionedGlyph::PositionedGlyph ( )
noexcept

◆ PositionedGlyph() [2/4]

PositionedGlyph::PositionedGlyph ( const Font font,
juce_wchar  character,
int  glyphNumber,
float  anchorX,
float  baselineY,
float  width,
bool  isWhitespace 
)

◆ PositionedGlyph() [3/4]

PositionedGlyph::PositionedGlyph ( const PositionedGlyph )

◆ PositionedGlyph() [4/4]

PositionedGlyph::PositionedGlyph ( PositionedGlyph &&  )
noexcept

Move constructor.

◆ ~PositionedGlyph()

PositionedGlyph::~PositionedGlyph ( )

Member Function Documentation

◆ createPath()

void PositionedGlyph::createPath ( Path path) const

Returns the path for this glyph.

Parameters
paththe glyph's outline will be appended to this path

◆ draw() [1/2]

void PositionedGlyph::draw ( Graphics g) const

Draws the glyph into a graphics context.

(Note that this may change the context's currently selected font).

◆ draw() [2/2]

void PositionedGlyph::draw ( Graphics g,
const AffineTransform transform 
) const

Draws the glyph into a graphics context, with an extra transform applied to it.

(Note that this may change the context's currently selected font).

◆ getBaselineY()

float PositionedGlyph::getBaselineY ( ) const
inlinenoexcept

Returns the y position of the glyph's baseline.

◆ getBottom()

float PositionedGlyph::getBottom ( ) const
inline

Returns the y position of the bottom of the glyph.

References Font::getDescent().

◆ getBounds()

Rectangle<float> PositionedGlyph::getBounds ( ) const
inline

Returns the bounds of the glyph.

References Font::getHeight().

◆ getCharacter()

juce_wchar PositionedGlyph::getCharacter ( ) const
inlinenoexcept

Returns the character the glyph represents.

◆ getLeft()

float PositionedGlyph::getLeft ( ) const
inlinenoexcept

Returns the position of the glyph's left-hand edge.

◆ getRight()

float PositionedGlyph::getRight ( ) const
inlinenoexcept

Returns the position of the glyph's right-hand edge.

◆ getTop()

float PositionedGlyph::getTop ( ) const
inline

Returns the y position of the top of the glyph.

References Font::getAscent().

◆ hitTest()

bool PositionedGlyph::hitTest ( float  x,
float  y 
) const

Checks to see if a point lies within this glyph.

◆ isWhitespace()

bool PositionedGlyph::isWhitespace ( ) const
inlinenoexcept

Checks whether the glyph is actually empty.

◆ moveBy()

void PositionedGlyph::moveBy ( float  deltaX,
float  deltaY 
)

Shifts the glyph's position by a relative amount.

◆ operator=() [1/2]

PositionedGlyph& PositionedGlyph::operator= ( const PositionedGlyph )

◆ operator=() [2/2]

PositionedGlyph& PositionedGlyph::operator= ( PositionedGlyph &&  )
noexcept

Move assignment operator.

Friends And Related Function Documentation

◆ GlyphArrangement

friend class GlyphArrangement
friend

Member Data Documentation

◆ character

juce_wchar PositionedGlyph::character
private

◆ font

Font PositionedGlyph::font
private

◆ glyph

int PositionedGlyph::glyph
private

◆ w

float PositionedGlyph::w
private

◆ whitespace

bool PositionedGlyph::whitespace
private

◆ x

float PositionedGlyph::x
private

◆ y

float PositionedGlyph::y
private

The documentation for this class was generated from the following file: