LMMS
Loading...
Searching...
No Matches
juce::PositionedGlyph Class Referencefinal

#include <juce_GlyphArrangement.h>

Public Member Functions

 PositionedGlyph () noexcept
 PositionedGlyph (const Font &font, juce_wchar character, int glyphNumber, float anchorX, float baselineY, float width, bool isWhitespace)
juce_wchar getCharacter () const noexcept
bool isWhitespace () const noexcept
float getLeft () const noexcept
float getRight () const noexcept
float getBaselineY () const noexcept
float getTop () const
float getBottom () const
Rectangle< float > getBounds () const
void moveBy (float deltaX, float deltaY)
void draw (Graphics &g) const
void draw (Graphics &g, AffineTransform transform) const
void createPath (Path &path) const
bool hitTest (float x, float y) const

Private Attributes

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

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

@tags{Graphics}

Constructor & Destructor Documentation

◆ PositionedGlyph() [1/2]

juce::PositionedGlyph::PositionedGlyph ( )
noexcept

◆ PositionedGlyph() [2/2]

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

Member Function Documentation

◆ createPath()

void juce::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 juce::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 juce::PositionedGlyph::draw ( Graphics & g,
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 juce::PositionedGlyph::getBaselineY ( ) const
inlinenoexcept

Returns the y position of the glyph's baseline.

◆ getBottom()

float juce::PositionedGlyph::getBottom ( ) const
inline

Returns the y position of the bottom of the glyph.

◆ getBounds()

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

Returns the bounds of the glyph.

◆ getCharacter()

juce_wchar juce::PositionedGlyph::getCharacter ( ) const
inlinenoexcept

Returns the character the glyph represents.

◆ getLeft()

float juce::PositionedGlyph::getLeft ( ) const
inlinenoexcept

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

◆ getRight()

float juce::PositionedGlyph::getRight ( ) const
inlinenoexcept

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

◆ getTop()

float juce::PositionedGlyph::getTop ( ) const
inline

Returns the y position of the top of the glyph.

◆ hitTest()

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

Checks to see if a point lies within this glyph.

◆ isWhitespace()

bool juce::PositionedGlyph::isWhitespace ( ) const
inlinenoexcept

Checks whether the glyph is actually empty.

◆ moveBy()

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

Shifts the glyph's position by a relative amount.

◆ GlyphArrangement

friend class GlyphArrangement
friend

Member Data Documentation

◆ character

juce_wchar juce::PositionedGlyph::character
private

◆ font

Font juce::PositionedGlyph::font
private

◆ glyph

int juce::PositionedGlyph::glyph
private

◆ w

float juce::PositionedGlyph::w
private

◆ whitespace

bool juce::PositionedGlyph::whitespace
private

◆ x

float juce::PositionedGlyph::x
private

◆ y

float juce::PositionedGlyph::y
private

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