diff --git a/src/css_reader.py b/src/css_reader.py index 095f663..bfee39a 100644 --- a/src/css_reader.py +++ b/src/css_reader.py @@ -116,7 +116,7 @@ LIVECARTA_STYLE_ATTRS_MAPPING = { 'font-variant': lambda x: x, 'text-align': lambda x: x, 'font': lambda x: '', - 'font-family': lambda x: LawCartaConfig.font_correspondence_table.get(x.capitalize()), + 'font-family': lambda x: LawCartaConfig.font_correspondence_table.get(x) or LawCartaConfig.font_correspondence_table.get(x.capitalize()), 'font-size': convert_font_size, 'color': get_text_color, 'background-color': get_bg_color, diff --git a/src/html_epub_preprocessor.py b/src/html_epub_preprocessor.py index b22b735..8ac82da 100644 --- a/src/html_epub_preprocessor.py +++ b/src/html_epub_preprocessor.py @@ -461,7 +461,7 @@ def preprocess_pre_tags(chapter_tag): new_tag.append(BeautifulSoup(features='lxml').new_tag('br')) new_tag.attrs['style'] = "font-family: courier new,courier,monospace; " \ - "font-size: 14px; white-space: pre-wrap;" + "font-size: 14px; white-space: nowrap;" pre.insert_before(new_tag) pre.extract() table = wrap_span_with_table(chapter_tag, new_tag) diff --git a/src/livecarta_config.py b/src/livecarta_config.py index 0e969ae..f059b94 100644 --- a/src/livecarta_config.py +++ b/src/livecarta_config.py @@ -68,7 +68,9 @@ class LawCartaConfig: "Tahoma": "tahoma,geneva,sans-serif", "Times New Roman": "times new roman,times,serif", "Trebuchet MS": "trebuchet ms,helvetica,sans-serif", - "Verdana": "verdana,geneva,sans-serif" + "Verdana": "verdana,geneva,sans-serif", + "monospace": "courier new,courier,monospace", + "sans-serif": "arial,helvetica,sans-serif", } COLORS_MAP = {