本文整理汇总了C++中juce::Graphics::setFont方法的典型用法代码示例。如果您正苦于以下问题:C++ Graphics::setFont方法的具体用法?C++ Graphics::setFont怎么用?C++ Graphics::setFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类juce::Graphics
的用法示例。
在下文中一共展示了Graphics::setFont方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
//==============================================================================
void LufsPluginEditor::paint (juce::Graphics& g)
{
DEBUGPLUGIN_output("LufsPluginEditor::paint");
g.fillAll( LUFS_COLOR_BACKGROUND );
juce::Font lufsFont( 36.f );
lufsFont.setBold(true);
g.setFont( lufsFont );
g.setColour( LUFS_COLOR_FONT );
int x = 10;
const int width = 120;
const int height = 60;
g.setColour( COLOR_LUFSTIME );
g.drawFittedText( juce::String( "LUFS" ), x, 10, width, 40, juce::Justification::centred, 1, 0.01f );
x += width;
juce::Font font( 18.f );
font.setBold(true);
g.setFont( font );
g.setColour( COLOR_MOMENTARY );
g.drawFittedText( juce::String( "Momentary" ), x, height, width, 20, juce::Justification::centred, 1, 0.01f );
x += width;
g.setColour( COLOR_SHORTTERM );
g.drawFittedText( juce::String( "Short term" ), x, height, width, 20, juce::Justification::centred, 1, 0.01f );
x += width;
g.setColour( COLOR_INTEGRATED );
g.drawFittedText( juce::String( "Integrated" ), x, height, width, 20, juce::Justification::centred, 1, 0.01f );
x += width;
g.setColour( COLOR_RANGE );
g.drawFittedText( juce::String( "Range" ), x, height, width, 20, juce::Justification::centred, 1, 0.01f );
}
示例2: paintListBoxItem
void InterfaceComponent::paintListBoxItem (const int rowNumber,
juce::Graphics& g,
const int width, const int height,
const bool isRowSelected)
{
if (isRowSelected)
{
g.fillAll (juce::Colours::white.darker());
g.setColour (juce::Colours::white.darker().contrasting());
}
else
{
g.setColour (fileListBox.findColour (juce::ListBox::textColourId));
}
g.setFont (height * 0.7f);
g.drawText (files[rowNumber],
5, 0, width, height,
juce::Justification::centredLeft, false);
const float h = (float) height;
const float w = (float) width;
const float offset = 5.0f;
const float thickness = 0.25f;
g.setColour (juce::Colours::lightgrey);
g.drawLine (offset, h - thickness,
w - (offset * 2.0f), h - thickness,
thickness);
}
示例3: drawLabel
void NTLookAndFeel::drawLabel(juce::Graphics &g, juce::Label &label){
g.fillAll (label.findColour (Label::backgroundColourId));
if (! label.isBeingEdited())
{
const float alpha = label.isEnabled() ? 1.0f : 0.5f;
const Font font (getLabelFont (label));
g.setColour (label.findColour (Label::textColourId).withMultipliedAlpha (alpha));
g.setFont (font);
Rectangle<int> textArea (label.getBorderSize().subtractedFrom (label.getLocalBounds()));
g.drawFittedText (label.getText(), textArea, label.getJustificationType(),
jmax (1, (int) (textArea.getHeight() / font.getHeight())),
label.getMinimumHorizontalScale());
g.setColour (label.findColour (Label::outlineColourId).withMultipliedAlpha (alpha));
}
else if (label.isEnabled())
{
g.setColour (label.findColour (Label::outlineColourId));
}
g.drawRect (label.getLocalBounds(),2);
}
示例4: paintListBoxItem
void StringListBoxModel::paintListBoxItem(const int rowNumber,
juce::Graphics &g,
const int width,
const int height,
const bool /*rowIsSelected*/)
{
if (rowNumber < getNumRows())
{
g.setColour(juce::Colours::black);
juce::Font font(height * 0.7f);
font.setHorizontalScale(0.9f);
g.setFont(font);
g.drawText(juce::String(items[rowNumber].c_str()), 4, 0, width - 6, height, juce::Justification::centredLeft);
}
}