//============================================================================== void Font::setHeight (float newHeight) throw() { newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); if (font->height != newHeight) { dupeInternalIfShared(); font->height = newHeight; } }
void Font::setTypefaceFamily (const String& family) { if (family != font->typefaceFamily) { dupeInternalIfShared(); font->typefaceFamily = family; font->typeface = nullptr; font->ascent = 0; } }
void Font::setStyleFlags (const int newFlags) throw() { if (font->styleFlags != newFlags) { dupeInternalIfShared(); font->styleFlags = newFlags; font->typeface = 0; font->ascent = 0; } }
void Font::setTypefaceStyle (const String& typefaceStyle) { if (typefaceStyle != font->typefaceStyle) { dupeInternalIfShared(); font->typefaceStyle = typefaceStyle; font->typeface = nullptr; font->ascent = 0; } }
void Font::setHeight (float newHeight) { newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { dupeInternalIfShared(); font->height = newHeight; } }
void Font::setTypefaceName (const String& faceName) throw() { if (faceName != font->typefaceName) { dupeInternalIfShared(); font->typefaceName = faceName; font->typeface = 0; font->ascent = 0; } }
void Font::setHeightWithoutChangingWidth (float newHeight) throw() { newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); if (font->height != newHeight) { dupeInternalIfShared(); font->horizontalScale *= (font->height / newHeight); font->height = newHeight; } }
void Font::setHeight (float newHeight) { newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { dupeInternalIfShared(); font->height = newHeight; checkTypefaceSuitability(); } }
void Font::setStyleFlags (const int newFlags) { if (getStyleFlags() != newFlags) { dupeInternalIfShared(); font->typefaceStyle = FontStyleHelpers::getStyleName (newFlags); font->underline = (newFlags & underlined) != 0; font->typeface = nullptr; font->ascent = 0; } }
void Font::setHeightWithoutChangingWidth (float newHeight) { newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight) { dupeInternalIfShared(); font->horizontalScale *= (font->height / newHeight); font->height = newHeight; } }
void Font::setTypefaceName (const String& faceName) { if (faceName != font->typefaceName) { jassert (faceName.isNotEmpty()); dupeInternalIfShared(); font->typefaceName = faceName; font->typeface = nullptr; font->ascent = 0; } }
void Font::setStyleFlags (const int newFlags) { if (getStyleFlags() != newFlags) { dupeInternalIfShared(); if ((newFlags & underlined) == underlined) font->underline = true; if (newFlags == plain || newFlags == underlined) font->typefaceStyle = "Regular"; if (((newFlags & bold) == bold) && ((newFlags & italic) != italic)) font->typefaceStyle = "Bold"; if (((newFlags & bold) != bold) && ((newFlags & italic) == italic)) font->typefaceStyle = "Italic"; if ((newFlags & (bold | italic)) == (bold | italic)) font->typefaceStyle = "Bold Italic"; font->typeface = nullptr; font->ascent = 0; } }
void Font::setSizeAndStyle (float newHeight, const float newHorizontalScale, const float newKerningAmount) { newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight || font->horizontalScale != newHorizontalScale || font->kerning != newKerningAmount) { dupeInternalIfShared(); font->height = newHeight; font->horizontalScale = newHorizontalScale; font->kerning = newKerningAmount; } }
void Font::setSizeAndStyle (float newHeight, const int newStyleFlags, const float newHorizontalScale, const float newKerningAmount) throw() { newHeight = jlimit (minFontHeight, maxFontHeight, newHeight); if (font->height != newHeight || font->horizontalScale != newHorizontalScale || font->kerning != newKerningAmount) { dupeInternalIfShared(); font->height = newHeight; font->horizontalScale = newHorizontalScale; font->kerning = newKerningAmount; } setStyleFlags (newStyleFlags); }
void Font::setSizeAndStyle (float newHeight, const String& newStyle, const float newHorizontalScale, const float newKerningAmount) { newHeight = FontValues::limitFontHeight (newHeight); if (font->height != newHeight || font->horizontalScale != newHorizontalScale || font->kerning != newKerningAmount) { dupeInternalIfShared(); font->height = newHeight; font->horizontalScale = newHorizontalScale; font->kerning = newKerningAmount; checkTypefaceSuitability(); } setTypefaceStyle (newStyle); }
void Font::setExtraKerningFactor (const float extraKerning) { dupeInternalIfShared(); font->kerning = extraKerning; }
void Font::setHorizontalScale (const float scaleFactor) { dupeInternalIfShared(); font->horizontalScale = scaleFactor; }
void Font::setHorizontalScale (const float scaleFactor) { dupeInternalIfShared(); font->horizontalScale = scaleFactor; checkTypefaceSuitability(); }
void Font::setExtraKerningFactor (const float extraKerning) { dupeInternalIfShared(); font->kerning = extraKerning; checkTypefaceSuitability(); }
void Font::setUnderline (const bool shouldBeUnderlined) { dupeInternalIfShared(); font->underline = shouldBeUnderlined; checkTypefaceSuitability(); }