From c6e46b94a236eefd4bc94ba41b4bcde591f576f4 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 9 Aug 2015 00:54:38 +0300 Subject: [PATCH] [fbreader] Refactored CSS and XHTML support This significantly improves EPUB rendering. --- app/data/default/styles.xml | 23 +- app/src/BooksSettings.cpp | 8 +- app/src/BooksTextStyle.cpp | 9 +- app/src/BooksTextStyle.h | 9 +- .../fbreader/src/bookmodel/BookReader.cpp | 13 +- .../fbreader/src/bookmodel/BookReader.h | 1 + .../fbreader/src/bookmodel/FBTextKind.h | 1 + .../src/formats/css/StyleSheetParser.cpp | 433 +++++++++++------- .../src/formats/css/StyleSheetParser.h | 43 +- .../src/formats/css/StyleSheetTable.cpp | 301 +++++++----- .../src/formats/css/StyleSheetTable.h | 50 +- .../src/formats/xhtml/XHTMLReader.cpp | 387 +++++++++++----- .../fbreader/src/formats/xhtml/XHTMLReader.h | 46 +- .../zlibrary/core/src/util/ZLStringUtil.cpp | 49 +- .../zlibrary/core/src/util/ZLStringUtil.h | 10 +- .../zlibrary/core/src/view/ZLPaintContext.cpp | 24 + .../zlibrary/core/src/view/ZLPaintContext.h | 1 + .../text/src/area/ZLTextAreaStyle.cpp | 11 +- .../src/area/ZLTextArea_prepareTextLine.cpp | 1 + .../src/area/ZLTextArea_processTextLine.cpp | 2 + .../zlibrary/text/src/area/ZLTextElement.h | 1 + .../text/src/area/ZLTextParagraphBuilder.cpp | 3 + .../text/src/area/ZLTextParagraphCursor.cpp | 3 + .../text/src/area/ZLTextParagraphCursor.h | 1 + .../zlibrary/text/src/model/ZLTextModel.cpp | 50 +- .../zlibrary/text/src/model/ZLTextModel.h | 1 + .../text/src/model/ZLTextParagraph.cpp | 202 ++++++-- .../zlibrary/text/src/model/ZLTextParagraph.h | 31 +- .../text/src/style/ZLTextDecoratedStyle.cpp | 112 +++-- .../text/src/style/ZLTextDecoratedStyle.h | 15 +- .../zlibrary/text/src/style/ZLTextStyle.h | 3 +- .../text/src/style/ZLTextStyleCollection.cpp | 59 ++- .../text/src/style/ZLTextStyleCollection.h | 34 +- .../text/src/view/ZLTextPositionIndicator.cpp | 2 +- 34 files changed, 1349 insertions(+), 590 deletions(-) diff --git a/app/data/default/styles.xml b/app/data/default/styles.xml index f4d8aea..464da94 100644 --- a/app/data/default/styles.xml +++ b/app/data/default/styles.xml @@ -1,24 +1,27 @@ -