From b58df8cc1681e3d679aad8b7cdd8b5a13a2095f1 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 12 Oct 2012 22:39:58 +0800 Subject: [PATCH] check compiler flag --- CMakeLists.txt | 7 +++++++ src/HTMLRenderer/state.cc | 11 ++++++++++- src/HTMLRenderer/text.cc | 8 ++++++++ src/include/HTMLRenderer.h | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1741ffd..6d31641 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,13 @@ else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x") endif() +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag("${CMAKE_CXX_FLAGS}" CXX0X_SUPPORT) +if(NOT CXX0X_SUPPORT) + message(FATAL_ERROR "Error: you compiler does not support C++0x, please update it.") +endif() + + configure_file (${CMAKE_SOURCE_DIR}/src/include/pdf2htmlEX-config.h.in ${CMAKE_SOURCE_DIR}/src/include/pdf2htmlEX-config.h) configure_file (${CMAKE_SOURCE_DIR}/pdf2htmlEX.1.in ${CMAKE_SOURCE_DIR}/pdf2htmlEX.1) diff --git a/src/HTMLRenderer/state.cc b/src/HTMLRenderer/state.cc index 615cf36..e5a1dac 100644 --- a/src/HTMLRenderer/state.cc +++ b/src/HTMLRenderer/state.cc @@ -271,7 +271,16 @@ void HTMLRenderer::check_state_change(GfxState * state) if(all_changed || color_changed) { GfxRGB new_color; - state->getFillRGB(&new_color); + /* + * Render modes 0 2 4 6 fill text (stroke or not) + * Render modes 1 5 stroke only + * Render modes 3 7 hidden (but ok, we won't even draw text) + */ + if(state->getRender() % 2 == 0) + state->getFillRGB(&new_color); + else + state->getStrokeRGB(&new_color); + if(!((new_color.r == cur_color.r) && (new_color.g == cur_color.g) && (new_color.b == cur_color.b))) { new_line_state = max(new_line_state, NLS_SPAN); diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index d6c6cfa..7e9b566 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -517,6 +517,14 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s) char *p = s->getCString(); int len = s->getLength(); + //debug + { + if(strcmp(p, "ORTUG") == 0) + { + cerr << "DEBUG: " << (int)(state->getRender()) << endl; + } + } + double dx = 0; double dy = 0; double dxerr = 0; diff --git a/src/include/HTMLRenderer.h b/src/include/HTMLRenderer.h index 989b17d..9feb54a 100644 --- a/src/include/HTMLRenderer.h +++ b/src/include/HTMLRenderer.h @@ -309,7 +309,7 @@ class HTMLRenderer : public OutputDev double cur_word_space; bool word_space_changed; - // color + // text color long long cur_color_id; GfxRGB cur_color; bool color_changed;