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

## 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

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

- juce_graphics/fonts/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
| Returns the character the glyph represents.
bool | isWhitespace () const noexcept
| Checks whether the glyph is actually empty.
float | getLeft () const noexcept
| Returns the position of the glyph's left-hand edge.
float | getRight () const noexcept
| Returns the position of the glyph's right-hand edge.
float | getBaselineY () const noexcept
| Returns the y position of the glyph's baseline.
float | getTop () const
| Returns the y position of the top of the glyph.
float | getBottom () const
| Returns the y position of the bottom of the glyph.
Rectangle< float > | getBounds () const
| Returns the bounds of the glyph.
int | getGlyphIndex () const
| Returns the typeface glyph index for the glyph.
void | moveBy (float deltaX, float deltaY)
| Shifts the glyph's position by a relative amount.
void | draw (Graphics &g) const
| Draws the glyph into a graphics context.
void | draw (Graphics &g, AffineTransform transform) const
| Draws the glyph into a graphics context, with an extra transform applied to it.
void | createPath (Path &path) const
| Returns the path for this glyph.
bool | hitTest (float x, float y) const
| Checks to see if a point lies within this glyph.

## Constructors and Destructors

## PositionedGlyph() [1/2]

juce::PositionedGlyph::PositionedGlyph | ( |  | ) |

noexcept

Referenced by PositionedGlyph().

## PositionedGlyph() [2/2]

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

References isWhitespace(), and PositionedGlyph().

## Member Functions

## getCharacter()

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

inline noexcept

Returns the character the glyph represents.

References getCharacter().

Referenced by getCharacter().

## isWhitespace()

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

inline noexcept

Checks whether the glyph is actually empty.

Referenced by PositionedGlyph().

## getLeft()

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

inline noexcept

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

## getRight()

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

inline noexcept

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

## getBaselineY()

float juce::PositionedGlyph::getBaselineY | ( |  | ) | const

inline noexcept

Returns the y position of the glyph's baseline.

## getTop()

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

inline

Returns the y position of the top of the glyph.

Referenced by getBounds().

## 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.

References getTop().

## getGlyphIndex()

int juce::PositionedGlyph::getGlyphIndex | ( |  | ) | const

inline

Returns the typeface glyph index for the glyph.

## moveBy()

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

Shifts the glyph's position by a relative amount.

## 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).

## createPath()

void juce::PositionedGlyph::createPath | ( | Path & | path | ) | const

Returns the path for this glyph.

Parameters

  path | the glyph's outline will be appended to this path

## hitTest()

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

Checks to see if a point lies within this glyph.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited