docs: fontsize example (#441)

* docs: fontsize example

* fix
main
bokuweb 2022-03-11 11:35:56 +09:00 committed by GitHub
parent f74e79bc07
commit 6e4648b0d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -74,7 +74,7 @@ jobs:
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: 1.58.1
override: true override: true
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: rustup target add wasm32-unknown-unknown - run: rustup target add wasm32-unknown-unknown

View File

@ -0,0 +1,11 @@
use docx_rs::*;
pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./output/font_size.docx");
let file = std::fs::File::create(&path).unwrap();
Docx::new()
.add_paragraph(Paragraph::new().add_run(Run::new().add_text("Hello").size(24)))
.build()
.pack(file)?;
Ok(())
}