48 float anchorX,
float baselineY,
float width,
bool isWhitespace);
56 float getLeft() const noexcept {
return x; }
58 float getRight() const noexcept {
return x + w; }
70 void moveBy (
float deltaX,
float deltaY);
86 void createPath (
Path& path)
const;
89 bool hitTest (
float x,
float y)
const;
144 const PositionedGlyph* end()
const {
return glyphs.end(); }
158 void addLineOfText (
const Font& font,
168 void addCurtailedLineOfText (
const Font& font,
171 float maxWidthPixels,
187 void addJustifiedText (
const Font& font,
191 Justification horizontalLayout,
192 float leading = 0.0f);
213 void addFittedText (
const Font& font,
215 float x,
float y,
float width,
float height,
216 Justification layout,
217 int maximumLinesToUse,
218 float minimumHorizontalScale = 0.0f);
221 void addGlyphArrangement (
const GlyphArrangement&);
224 void addGlyph (
const PositionedGlyph&);
232 void draw (
const Graphics&)
const;
239 void draw (
const Graphics&, AffineTransform)
const;
244 void createPath (Path& path)
const;
249 int findGlyphIndexAt (
float x,
float y)
const;
261 Rectangle<float> getBoundingBox (
int startIndex,
int numGlyphs,
bool includeWhitespace)
const;
271 void moveRangeOfGlyphs (
int startIndex,
int numGlyphs,
272 float deltaX,
float deltaY);
280 void removeRangeOfGlyphs (
int startIndex,
int numGlyphs);
289 void stretchRangeOfGlyphs (
int startIndex,
int numGlyphs,
290 float horizontalScaleFactor);
300 void justifyGlyphs (
int startIndex,
int numGlyphs,
301 float x,
float y,
float width,
float height,
302 Justification justification);
307 Array<PositionedGlyph> glyphs;
309 int insertEllipsis (
const Font&,
float maxXPos,
int startIndex,
int endIndex);
310 int fitLineIntoSpace (
int start,
int numGlyphs,
float x,
float y,
float w,
float h,
const Font&,
311 Justification,
float minimumHorizontalScale);
312 void spreadOutLine (
int start,
int numGlyphs,
float targetWidth);
313 void splitLines (
const String&, Font,
int start,
float x,
float y,
float w,
float h,
int maxLines,
314 float lineWidth, Justification,
float minimumHorizontalScale);
315 void addLinesWithLineBreaks (
const String&,
const Font&,
float x,
float y,
float width,
float height, Justification);
316 void drawGlyphUnderline (
const Graphics&,
const PositionedGlyph&,
int, AffineTransform)
const;
Represents a particular font, including its size, style, etc.
float getDescent() const
Returns the amount that the font descends below its baseline, in pixels.
float getHeight() const noexcept
Returns the total height of this font, in pixels.
float getAscent() const
Returns the height of the font above its baseline, in pixels.
A set of glyphs, each with a position.
int getNumGlyphs() const noexcept
Returns the total number of glyphs in the arrangement.
~GlyphArrangement()=default
Destructor.
A graphics context, used for drawing a component or image.
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
A glyph from a particular font, with a particular size, style, typeface and position.
float getBaselineY() const noexcept
Returns the y position of the glyph's baseline.
juce_wchar getCharacter() const noexcept
Returns the character the glyph represents.
bool isWhitespace() const noexcept
Checks whether the glyph is actually empty.
float getRight() const noexcept
Returns the position of the glyph's right-hand edge.
float getBottom() const
Returns the y position of the bottom of the glyph.
float getTop() const
Returns the y position of the top of the glyph.
float getLeft() const noexcept
Returns the position of the glyph's left-hand edge.
Rectangle< float > getBounds() const
Returns the bounds of the glyph.
Manages a rectangle and allows geometric operations to be performed on it.
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.
wchar_t juce_wchar
A platform-independent 32-bit unicode character type.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...