Function fltk::app::set_font_size

source ·
pub fn set_font_size<I: Into<i32>>(sz: I)
Expand description

Set the app’s font size

Examples found in repository?
examples/temp_converter2.rs (line 80)
73
74
75
76
77
78
79
80
81
    fn init_styles() {
        app::set_scheme(app::Scheme::Gleam);
        app::set_background_color(170, 189, 206);
        app::set_background2_color(255, 255, 255);
        app::set_foreground_color(0, 0, 0);
        app::set_selection_color(255, 160, 63);
        app::set_inactive_color(130, 149, 166);
        app::set_font_size(16);
    }
More examples
Hide additional examples
examples/defaults.rs (line 12)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
fn main() {
    let (r, g, b) = utils::hex2rgb(0xfafdf3);

    let app = app::App::default();

    // global theming
    app::background(r, g, b); // background color. For input/output and text widgets, use app::background2
    app::foreground(20, 20, 20); // labels
    app::set_font(enums::Font::Courier);
    app::set_font_size(16);
    app::set_frame_type(enums::FrameType::RFlatBox);
    app::set_visible_focus(false);

    // regular widget code
    let mut win = window::Window::default().with_size(400, 300);
    let frame = frame::Frame::new(0, 0, 400, 200, "Defaults");
    let flex = group::Flex::default()
        .with_size(400, 50)
        .below_of(&frame, 50);
    let mut but1 = button::Button::default().with_label("Button1");
    but1.set_color(enums::Color::Yellow);
    but1.set_down_frame(enums::FrameType::RFlatBox);
    frame::Frame::default();
    let mut but2 = button::Button::default().with_label("Button2");
    but2.set_color(enums::Color::Yellow);
    but2.set_down_frame(enums::FrameType::RFlatBox);
    flex.end();

    win.end();
    win.show();

    app.run().unwrap();
}