void CtrlrLuaMethodEditorTabsLF::createTabTextLayout (const TabBarButton& button, float length, float depth, Colour colour, TextLayout& textLayout) { Font font (12.0f); font.setUnderline (button.hasKeyboardFocus (false)); AttributedString s; s.setJustification (Justification::centred); s.append (button.getButtonText().trim(), font, colour); textLayout.createLayout (s, length); }
void AttributedString::draw (Graphics& g, const Rectangle<float>& area) const { if (text.isNotEmpty() && g.clipRegionIntersects (area.getSmallestIntegerContainer())) { if (! g.getInternalContext()->drawTextLayout (*this, area)) { TextLayout layout; layout.createLayout (*this, area.getWidth()); layout.draw (g, area); } } }
void LookAndFeel_E1::createTabTextLayout (const TabBarButton& button, float length, float depth, Colour colour, TextLayout& textLayout) { Font font (depth * 0.5f); font.setUnderline (button.hasKeyboardFocus (false)); AttributedString s; s.setJustification (Justification::centred); s.append (button.getButtonText().trim(), font, colour); textLayout.createLayout (s, length); }