diff --git a/src/scene/text/sdf_atlas.rs b/src/scene/text/sdf_atlas.rs index 40b2c6b59..021678faa 100644 --- a/src/scene/text/sdf_atlas.rs +++ b/src/scene/text/sdf_atlas.rs @@ -39,12 +39,13 @@ pub fn text_atlas() -> &'static Mutex { ATLAS.get_or_init(|| Mutex::new(GlyphAtlas::new(1024, 1024))) } -/// Whether SDF text rendering is enabled (env `OCS_TEXT_SDF`), read once. -/// When on, the wire path suppresses text glyph strokes so text draws only as -/// SDF quads (no double draw); the insertion snap point is kept. +/// Whether SDF text rendering is enabled, read once. Default ON — text draws +/// as SDF glyph quads (crisp at every zoom, no LOD; the wire path suppresses +/// the glyph strokes and keeps the insertion snap). Set `OCS_TEXT_SDF=0` to +/// fall back to the legacy stroke path (kill switch for the stroke renderer). pub fn sdf_text_enabled() -> bool { static ON: OnceLock = OnceLock::new(); - *ON.get_or_init(|| std::env::var_os("OCS_TEXT_SDF").is_some()) + *ON.get_or_init(|| std::env::var("OCS_TEXT_SDF").map_or(true, |v| v != "0")) } /// Debug: when env `OCS_TEXT_BOX` is set, each SDF text run also emits a