65 Font (
float fontHeight,
int styleFlags = plain);
76 Font (
const String& typefaceName,
float fontHeight,
int styleFlags);
84 Font (
const String& typefaceName,
const String& typefaceStyle,
float fontHeight);
104 Font& operator= (
Font&& other)
noexcept;
107 Font& operator= (
const Font& other)
noexcept;
109 bool operator== (
const Font& other)
const noexcept;
110 bool operator!= (
const Font& other)
const noexcept;
128 void setTypefaceName (const
String& faceName);
141 String getTypefaceName() const noexcept;
147 String getTypefaceStyle() const noexcept;
152 void setTypefaceStyle (const
String& newStyle);
157 [[nodiscard]]
Font withTypefaceStyle (const
String& newStyle) const;
173 static const
String& getDefaultSansSerifFontName();
182 static const
String& getDefaultSerifFontName();
191 static const
String& getDefaultMonospacedFontName();
200 static const
String& getDefaultStyle();
203 static
Typeface::Ptr getDefaultTypefaceForFont (const
Font& font);
207 [[nodiscard]]
Font withHeight (
float height) const;
210 [[nodiscard]]
Font withPointHeight (
float heightInPoints) const;
215 void setHeight (
float newHeight);
220 void setHeightWithoutChangingWidth (
float newHeight);
228 float getHeight() const noexcept;
236 float getHeightInPoints() const;
242 float getAscent() const;
248 float getAscentInPoints() const;
254 float getDescent() const;
260 float getDescentInPoints() const;
268 int getStyleFlags() const noexcept;
274 [[nodiscard]]
Font withStyle (
int styleFlags) const;
280 void setStyleFlags (
int newFlags);
284 void setBold (
bool shouldBeBold);
289 [[nodiscard]]
Font boldened() const;
292 bool isBold() const noexcept;
295 void setItalic (
bool shouldBeItalic);
297 [[nodiscard]]
Font italicised() const;
299 bool isItalic() const noexcept;
302 void setUnderline (
bool shouldBeUnderlined);
304 bool isUnderlined() const noexcept;
313 float getHorizontalScale() const noexcept;
320 [[nodiscard]]
Font withHorizontalScale (
float scaleFactor) const;
326 void setHorizontalScale (
float scaleFactor);
332 static
float getDefaultMinimumHorizontalScaleFactor() noexcept;
338 static
void setDefaultMinimumHorizontalScaleFactor (
float newMinimumScaleFactor) noexcept;
348 float getExtraKerningFactor() const noexcept;
356 [[nodiscard]]
Font withExtraKerningFactor (
float extraKerning) const;
364 void setExtraKerningFactor (
float extraKerning);
368 void setSizeAndStyle (
float newHeight,
370 float newHorizontalScale,
371 float newKerningAmount);
374 void setSizeAndStyle (
float newHeight,
376 float newHorizontalScale,
377 float newKerningAmount);
383 int getStringWidth (const
String& text) const;
388 float getStringWidthFloat (const
String& text) const;
395 void getGlyphPositions (const
String& text,
Array<
int>& glyphs,
Array<
float>& xOffsets) const;
404 [[deprecated (
"This method is unsafe, use getTypefacePtr() instead.")]]
442 static const String& getFallbackFontName();
447 static void setFallbackFontName (
const String& name);
452 static const String& getFallbackFontStyle();
457 static void setFallbackFontStyle (
const String& style);
470 static Font fromString (
const String& fontDescription);
474 static bool compare (
const Font&,
const Font&)
noexcept;
476 void dupeInternalIfShared();
477 void checkTypefaceSuitability();
478 float getHeightToPointsFactor()
const;