From c32cb95c4588e47554d690a0b4ffd5f645f205b5 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 28 Feb 2013 15:59:14 +0800 Subject: [PATCH] change css names --- src/HTMLRenderer/TextLineBuffer.cc | 2 +- src/HTMLRenderer/font.cc | 10 +++++----- src/css_class_names.cmakelists.txt | 8 ++++---- src/util/css_const.h.in | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/HTMLRenderer/TextLineBuffer.cc b/src/HTMLRenderer/TextLineBuffer.cc index 8aab0b9..2a678f8 100644 --- a/src/HTMLRenderer/TextLineBuffer.cc +++ b/src/HTMLRenderer/TextLineBuffer.cc @@ -275,7 +275,7 @@ int HTMLRenderer::TextLineBuffer::State::diff(const State & s) const // the order should be the same as in the enum const char * const HTMLRenderer::TextLineBuffer::State::css_class_names [] = { - CSS::FONT_NAME_CN, + CSS::FONT_FAMILY_CN, CSS::FONT_SIZE_CN, CSS::FILL_COLOR_CN, CSS::STROKE_COLOR_CN, diff --git a/src/HTMLRenderer/font.cc b/src/HTMLRenderer/font.cc index 62fd9d1..ca4eaa0 100644 --- a/src/HTMLRenderer/font.cc +++ b/src/HTMLRenderer/font.cc @@ -727,7 +727,7 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff } f_css.fs << "@font-face{" - << "font-family:" << CSS::FONT_NAME_CN << info.id << ";" + << "font-family:" << CSS::FONT_FAMILY_CN << info.id << ";" << "src:url("; { @@ -749,8 +749,8 @@ void HTMLRenderer::export_remote_font(const FontInfo & info, const string & suff f_css.fs << ")" << "format(\"" << format << "\");" << "}" // end of @font-face - << "." << CSS::FONT_NAME_CN << info.id << "{" - << "font-family:" << CSS::FONT_NAME_CN << info.id << ";" + << "." << CSS::FONT_FAMILY_CN << info.id << "{" + << "font-family:" << CSS::FONT_FAMILY_CN << info.id << ";" << "line-height:" << round(info.ascent - info.descent) << ";" << "font-style:normal;" << "font-weight:normal;" @@ -772,12 +772,12 @@ static string general_font_family(GfxFont * font) // TODO: this function is called when some font is unable to process, may use the name there as a hint void HTMLRenderer::export_remote_default_font(long long fn_id) { - f_css.fs << "." << CSS::FONT_NAME_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; + f_css.fs << "." << CSS::FONT_FAMILY_CN << fn_id << "{font-family:sans-serif;visibility:hidden;}" << endl; } void HTMLRenderer::export_local_font(const FontInfo & info, GfxFont * font, const string & original_font_name, const string & cssfont) { - f_css.fs << "." << CSS::FONT_NAME_CN << info.id << "{"; + f_css.fs << "." << CSS::FONT_FAMILY_CN << info.id << "{"; f_css.fs << "font-family:" << ((cssfont == "") ? (original_font_name + "," + general_font_family(font)) : cssfont) << ";"; string fn = original_font_name; diff --git a/src/css_class_names.cmakelists.txt b/src/css_class_names.cmakelists.txt index c48dbd7..8fdaf09 100644 --- a/src/css_class_names.cmakelists.txt +++ b/src/css_class_names.cmakelists.txt @@ -2,19 +2,19 @@ # Note # don't use: (otherwise conflicted with others when there is an ID suffix) -# p f +# p f s set(CSS_INVALID_ID "_") -set(CSS_LINE_CN "tl") # text line -set(CSS_TRANSFORM_MATRIX_CN "tm") # transform matrix +set(CSS_LINE_CN "t") # text +set(CSS_TRANSFORM_MATRIX_CN "m") # matrix set(CSS_PAGE_DECORATION_CN "pd") # page decoration set(CSS_PAGE_FRAME_CN "pf") # page frame set(CSS_PAGE_CONTENT_BOX_CN "pc") # page content set(CSS_PAGE_DATA_CN "pi") # page info -set(CSS_FONT_NAME_CN "fn") # font name +set(CSS_FONT_FAMILY_CN "ff") # font family set(CSS_FONT_SIZE_CN "fs") # font size set(CSS_FILL_COLOR_CN "fc") # fill color diff --git a/src/util/css_const.h.in b/src/util/css_const.h.in index ff585e1..be9c4d5 100644 --- a/src/util/css_const.h.in +++ b/src/util/css_const.h.in @@ -35,7 +35,7 @@ const char * const PAGE_FRAME_CN = "@CSS_PAGE_FRAME_CN@"; const char * const PAGE_CONTENT_BOX_CN = "@CSS_PAGE_CONTENT_BOX_CN@"; const char * const PAGE_DATA_CN = "@CSS_PAGE_DATA_CN@"; -const char * const FONT_NAME_CN = "@CSS_FONT_NAME_CN@"; +const char * const FONT_FAMILY_CN = "@CSS_FONT_FAMILY_CN@"; const char * const FONT_SIZE_CN = "@CSS_FONT_SIZE_CN@"; const char * const FILL_COLOR_CN = "@CSS_FILL_COLOR_CN@"; const char * const STROKE_COLOR_CN = "@CSS_STROKE_COLOR_CN@";