diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -65,6 +65,8 @@ pub struct Typesetter { style: LayoutStyle, /// The standard library scope. scope: Scope, + /// Whether to render debug boxes. + debug: bool, } /// The font loader type used in the [`Typesetter`]. @@ -83,6 +85,7 @@ impl Typesetter { loader: RefCell::new(FontLoader::new(provider)), style: LayoutStyle::default(), scope: Scope::with_std(), + debug: false, } } @@ -96,6 +99,11 @@ impl Typesetter { self.style.page = style; } + /// Set whether to render debug boxes. + pub fn set_debug(&mut self, debug: bool) { + self.debug = debug; + } + /// A reference to the backing font loader. pub fn loader(&self) -> &GlobalFontLoader { &self.loader @@ -126,7 +134,7 @@ impl Typesetter { axes: LayoutAxes::new(LeftToRight, TopToBottom), alignment: LayoutAlignment::new(Origin, Origin), nested: false, - debug: false, + debug: self.debug, }, ).await } |
