Example #1
0
    void updatePreviewBoxText()
    {
        Font font (fonts [listBox->getSelectedRow()]);

        font.setHeight ((float) sizeSlider.getValue());
        font.setExtraKerningFactor ((float) kerningSlider.getValue());
        font.setHorizontalScale ((float) horizontalScaleSlider.getValue());

        updateStylesList (font);
        font.setTypefaceStyle (fontStylesComboBox.getText());

        textBox.applyFontToAllText (font);
    }
Example #2
0
    void refreshPreviewBoxFont()
    {
        const bool bold = boldToggle.getToggleState();
        const bool italic = italicToggle.getToggleState();
        const bool useStyle = ! (bold || italic);

        Font font (fonts [listBox.getSelectedRow()]);

        font = font.withPointHeight ((float) heightSlider.getValue())
                   .withExtraKerningFactor ((float) kerningSlider.getValue())
                   .withHorizontalScale ((float) scaleSlider.getValue());

        if (bold)    font = font.boldened();
        if (italic)  font = font.italicised();

        updateStylesList (font);

        styleBox.setEnabled (useStyle);

        if (useStyle)
            font = font.withTypefaceStyle (styleBox.getText());

        demoTextBox.applyFontToAllText (font);
    }