mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
change css names
This commit is contained in:
parent
81934107e0
commit
c32cb95c45
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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@";
|
||||
|
Loading…
Reference in New Issue
Block a user