void Font::setSizeAndStyle (float newHeight, const int newStyleFlags, 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; } setStyleFlags (newStyleFlags); }
void Font::setItalic (const bool shouldBeItalic) { const int flags = getStyleFlags(); setStyleFlags (shouldBeItalic ? (flags | italic) : (flags & ~italic)); }
void Font::setBold (const bool shouldBeBold) { const int flags = getStyleFlags(); setStyleFlags (shouldBeBold ? (flags | bold) : (flags & ~bold)); }
void Font::setUnderline (const bool shouldBeUnderlined) throw() { setStyleFlags (shouldBeUnderlined ? (font->styleFlags | underlined) : (font->styleFlags & ~underlined)); }
void Font::setItalic (const bool shouldBeItalic) throw() { setStyleFlags (shouldBeItalic ? (font->styleFlags | italic) : (font->styleFlags & ~italic)); }
void Font::setBold (const bool shouldBeBold) throw() { setStyleFlags (shouldBeBold ? (font->styleFlags | bold) : (font->styleFlags & ~bold)); }
void Font::setItalic (const bool shouldBeItalic) { setStyleFlags (shouldBeItalic ? (getStyleFlags() | italic) : (getStyleFlags() & ~italic)); }
void Font::setBold (const bool shouldBeBold) { setStyleFlags (shouldBeBold ? (getStyleFlags() | bold) : (getStyleFlags() & ~bold)); }
Font::Font (const String& typefaceName, const float fontHeight, const int styleFlags) : font (new SharedFontInternal (typefaceName, Font::getDefaultStyle(), FontValues::limitFontHeight (fontHeight))) { setStyleFlags(styleFlags); }