01-13-2017, 11:16 AM | #1 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2012
Device: Kindle 3G Keyboard
|
PDF converted with Calibre (from epub) is missing bold and italic
PDFs converted with Calibre (from epub) are missing bold and italic, which I need.
Epub on left, PDF on right: As you can see it's missing bold and italic in the converted PDF. I don't really get why. The code shouldn't pose any problems for Calibre: Code:
<p class="normal text"><i class="italic"><span xml:lang="NO-BOK" xmlns:xml="http://www.w3.org/XML/1998/namespace">TIPS! Har enkelte kostnader sammenheng med både lønnsinntekt og næringsinntekt, kan du eventuelt foreta en fordeling, feks at 75 prosent av denne konkrete kostnaden føres i næringsregnskapet, mens 25 prosent inngår som en del av minstefradraget i lønnsinntekt mv.</span></i></p> Code:
.italic {font-style: italic} Code:
ebook-convert book.epub book.pdf --preserve-cover-aspect-ratio --paper-size a4 --embed-all-fonts --base-font-size 10 --margin-bottom 40 --margin-top 50 --margin-left 50 --margin-right 50 Last edited by kris33; 01-13-2017 at 11:20 AM. Reason: Better image |
01-13-2017, 10:52 PM | #2 |
creator of calibre
Posts: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
Advert | |
|
01-29-2017, 12:41 PM | #3 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2012
Device: Kindle 3G Keyboard
|
Here
A test file is attached. So is the PDF, command and log. Log: Code:
Convert book 1 of 1 (Bold Italic) Resolved conversion options calibre version: 2.78.0 {'asciiize': False, 'author_sort': None, 'authors': None, 'base_font_size': 10.0, 'book_producer': None, 'change_justification': u'original', 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']", 'chapter_mark': u'pagebreak', 'comments': None, 'cover': u'/var/folders/5j/9x30qv714wx0zj94s55xmjl00000gn/C/calibre_2.78.0_tmp_YjGHO8/h8_ZWF.jpeg', 'custom_size': None, 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'expand_css': False, 'extra_css': None, 'filter_css': u'', 'fix_indents': True, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x1128d2f50>, 'insert_blank_line': False, 'insert_blank_line_size': 0.5, 'insert_metadata': False, 'isbn': None, 'italicize_common_cases': True, 'keep_ligatures': False, 'language': None, 'level1_toc': None, 'level2_toc': None, 'level3_toc': None, 'line_height': 0.0, 'linearize_tables': False, 'margin_bottom': 40.0, 'margin_left': 50.0, 'margin_right': 50.0, 'margin_top': 50.0, 'markup_chapter_headings': True, 'max_toc_links': 50, 'minimum_line_height': 120.0, 'no_chapters_in_toc': False, 'no_inline_navbars': False, 'old_pdf_engine': False, 'output_profile': <calibre.customize.profiles.OutputProfile object at 0x1128d4350>, 'override_profile_size': True, 'page_breaks_before': u'/', 'paper_size': u'a4', 'pdf_add_toc': False, 'pdf_default_font_size': 12, 'pdf_footer_template': None, 'pdf_header_template': None, 'pdf_mark_links': False, 'pdf_mono_family': u'Courier New', 'pdf_mono_font_size': 16, 'pdf_page_numbers': False, 'pdf_sans_family': u'Helvetica', 'pdf_serif_family': u'Times New Roman', 'pdf_standard_font': u'serif', 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': True, 'pretty_print': False, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'/var/folders/5j/9x30qv714wx0zj94s55xmjl00000gn/C/calibre_2.78.0_tmp_YjGHO8/AVtsDP.opf', 'remove_fake_margins': True, 'remove_first_image': False, 'remove_paragraph_spacing': False, 'remove_paragraph_spacing_indent_size': 1.5, 'renumber_headings': True, 'replace_scene_breaks': u'', 'search_replace': '[]', 'series': None, 'series_index': None, 'smarten_punctuation': False, 'sr1_replace': None, 'sr1_search': None, 'sr2_replace': None, 'sr2_search': None, 'sr3_replace': None, 'sr3_search': None, 'start_reading_at': None, 'subset_embedded_fonts': False, 'tags': None, 'timestamp': None, 'title': None, 'title_sort': None, 'toc_filter': None, 'toc_threshold': 6, 'toc_title': None, 'transform_css_rules': '[]', 'uncompressed_pdf': False, 'unit': u'inch', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: EPUB Input running on /var/folders/5j/9x30qv714wx0zj94s55xmjl00000gn/C/calibre_2.78.0_tmp_YjGHO8/2gILF0.epub Found HTML cover OEBPS/Text/titlepage.xhtml Parsing all content... Parsing OEBPS/Styles/stylesheet.css ... Parsing OEBPS/Text/BoldItalic_2015_split_007.htm ... Parsing OEBPS/Text/titlepage.xhtml ... Parsing OEBPS/Text/BoldItalic_2015_split_009.htm ... Referenced file u'OEBPS/Text/BoldItalic_2015_split_011.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_003.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_016.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_017.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_014.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_019.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_012.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_015.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_018.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_021.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_006.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_020.htm' not found Referenced file u'OEBPS/Text/BoldItalic_split_002.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_010.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_005.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_004.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_023.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_013.htm' not found Referenced file u'OEBPS/Text/BoldItalic_2015_split_008.htm' not found Spine item 'html14' not found Spine item 'html13' not found Spine item 'html12' not found Spine item 'html11' not found Spine item 'html10' not found Spine item 'html9' not found Spine item 'html8' not found Spine item 'html7' not found Spine item 'html6' not found Spine item 'html5' not found Spine item 'html4' not found Spine item 'html3' not found Spine item 'html1' not found Reading TOC from NCX... TOC reference u'OEBPS/Text/BoldItalic_split_002.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_003.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_004.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_005.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_006.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_008.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_010.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_011.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_012.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_013.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_014.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_015.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_016.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_017.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_018.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_019.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_020.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_021.htm' not found TOC reference u'OEBPS/Text/BoldItalic_2015_split_023.htm' not found Merging user specified metadata... Detecting structure... Flattening CSS and remapping font sizes... Source base font size is 11.99998pt Removing fake margins... Found 90 items of level: p_1 p_1 left margin stats: Counter({u'0': 90}) p_1 right margin stats: Counter({u'0': 90}) Cleaning up manifest... Trimming unused files from manifest... Trimming u'OEBPS/Text/titlepage.xhtml' from manifest Creating PDF Output... Splitting markup on page breaks and flow limits, if any... Converting input as a text based book... Serializing oeb input to disk for processing... The cover image has an id != "cover". Renaming to work around bug in Nook Color Rendering pages to PDF... Processing /var/folders/5j/9x30qv714wx0zj94s55xmjl00000gn/C/calibre_2.78.0_tmp_YjGHO8/XSgTni_pdf_out/OEBPS/Text/BoldItalic_2015_split_007.htm... Loading font: family_name=Droid Serif full_name=Droid Serif postscript_name=DroidSerif subfamily_name=Regular Processing /var/folders/5j/9x30qv714wx0zj94s55xmjl00000gn/C/calibre_2.78.0_tmp_YjGHO8/XSgTni_pdf_out/OEBPS/Text/BoldItalic_2015_split_009.htm... Rendered PDF in 0.686728 seconds: PDF output written to /var/folders/5j/9x30qv714wx0zj94s55xmjl00000gn/C/calibre_2.78.0_tmp_YjGHO8/mBplZD.pdf Code:
./ebook-convert book.epub book.pdf --preserve-cover-aspect-ratio --paper-size a4 --embed-all-fonts --base-font-size 10 --margin-bottom 40 --margin-top 50 --margin-left 50 --margin-right 50 |
01-29-2017, 01:56 PM | #4 |
creator of calibre
Posts: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Your epub file references the font DroidSerif, but it only has the regular variant of that font embedded. Add the bold and italic variants or remove the references to that font and you will be fine.
|
01-29-2017, 02:09 PM | #5 | |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2012
Device: Kindle 3G Keyboard
|
Quote:
Most epub viewers support the file. |
|
Advert | |
|
01-29-2017, 02:18 PM | #6 |
creator of calibre
Posts: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Does not work in the calibre viewer. Does not work in Adobe Digital Editions 1.7.
When a font is missing bold/italic variants, there is no guarantee that the fallback font will be bold/italic, that's upto the vagaries of the font selection system of the OS in question. So if you want to embed a font and use its bold/italic faces, then embed all the faces. For example, on a linux system, do fc-match 'some family with no bold:weight=bold' and font config will return the regular face for that font. You absolutely must not rely on rendering systems substituting a bold face for a font with no bold face of its own. |
01-29-2017, 04:24 PM | #7 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jan 2012
Device: Kindle 3G Keyboard
|
Thanks, that did the trick. Any idea why epubs with missing fonts validate?
|
01-29-2017, 10:03 PM | #8 |
creator of calibre
Posts: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Because epub validators are a useless joke. They basically check only the things that are easy to check programmatically, not the things that might actually cause rendering issues in the real world. epub validators will complain about a huge class of "errors" that cause no actual real world issues and remain silent about a huge class of errors that do cause actual real world issues.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to keep bold texts in converted pdf, when you convert docx to pdf? | Foxitoff | Conversion | 1 | 11-04-2015 10:24 PM |
iPad "Upgraded" to iBooks 3.2 – Bold fonts are extra-bold, italics are now bold-italic | MHC | Apple Devices | 4 | 03-03-2014 01:50 PM |
Text in converted epub is bold, underlined - How to make regular? | frank14612 | Conversion | 5 | 02-22-2014 09:45 AM |
docx to epub - obsolete classes for italic and bold | krbo | Conversion | 2 | 01-09-2014 05:44 AM |
Epub -> txt with italic/bold characters | Fallingwater | Conversion | 8 | 07-10-2013 09:01 PM |