Skip to content

[feat] Support get system text size (Accessibility - Text Size) #14711

@BTMuli

Description

@BTMuli

Describe the problem

In addition to screen resolution and scaling, the text size setting under Accessibility also affects the zoom level of WebView2 content. Currently, Tauri only supports the former; please add support for the latter as well.

Image

Describe the solution you'd like

From hkcu

    let hkcu = RegKey::predef(HKEY_CURRENT_USER);
    let text_scale_factor_path = r#"Software\Microsoft\Accessibility"#.to_string();
    let text_scale_factor_key = hkcu.open_subkey(&text_scale_factor_path).unwrap();
    let text_scale_factor_value = text_scale_factor_key
        .get_value("TextScaleFactor")
        .unwrap_or(100u32);

    let accessibility_text_scale_factor = text_scale_factor_value as f64 / 100.0;

Alternatives considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions