diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-02-06 11:15:48 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-02-06 11:15:48 +0100 |
| commit | 02dc29d18a7b67edf0eaa5d125be22eec6cfebb7 (patch) | |
| tree | 2079ec1be481265655c798adc94d5e9e0166cfc2 /src/lib.rs | |
| parent | 751812f45141a7b2022d0dba138457f3c21950b0 (diff) | |
Highlight bold / italic / monospace 🎨
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 } |
