diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-02-28 10:50:15 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-02-28 10:50:15 +0100 |
| commit | 5e135db87287862e3f035aeb3bef23ea4d2a08ca (patch) | |
| tree | 7a066b226f582123ca528dfed2a49402b71d41db | |
| parent | 4d4824aa083589871f7453651269df613b18180f (diff) | |
Use bitflags for opentype font flags 🏁
| -rw-r--r-- | src/pdf.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10,7 +10,7 @@ use pdf::font::{ Type0Font, CMapEncoding, CIDFont, CIDFontType, CIDSystemInfo, WidthRecord, FontDescriptor, FontFlags, EmbeddedFont, GlyphUnit }; -use opentype::{OpenTypeReader, tables::{self, NameEntry}}; +use opentype::{OpenTypeReader, tables::{self, NameEntry, MacStyleFlags}}; /// A type that is a sink for documents that can be written in the _PDF_ format. @@ -214,7 +214,7 @@ impl<'a, W: Write> PdfCreator<'a, W> { flags.set(FontFlags::FIXED_PITCH, font_data.post.is_fixed_pitch); flags.set(FontFlags::SERIF, base_font.contains("Serif")); flags.insert(FontFlags::SYMBOLIC); - flags.set(FontFlags::ITALIC, (font_data.head.mac_style & 1) != 0); + flags.set(FontFlags::ITALIC, font_data.head.mac_style.contains(MacStyleFlags::ITALIC)); flags.insert(FontFlags::SMALL_CAP); self.writer.write_obj(id + 2, |
