mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-07-16 13:58:51 +00:00
working on nbsp
This commit is contained in:
parent
b8cfac4574
commit
e7a55c6371
@ -78,10 +78,10 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
|
|||||||
* This is by standard
|
* This is by standard
|
||||||
* however some PDF will use ' ' as a normal encoding slot
|
* however some PDF will use ' ' as a normal encoding slot
|
||||||
* such that it will be mapped to other unicodes
|
* such that it will be mapped to other unicodes
|
||||||
* In that case, when sapce_as_offset is on, we will simply ignore that character...
|
* In that case, when space_as_offset is on, we will simply ignore that character...
|
||||||
*
|
*
|
||||||
* Checking mapped unicode may or may not work
|
* Checking mapped unicode may or may not work
|
||||||
* There are always ugly PDF files with no usefull info at all.
|
* There are always ugly PDF files with no useful info at all.
|
||||||
*/
|
*/
|
||||||
is_space = true;
|
is_space = true;
|
||||||
++nSpaces;
|
++nSpaces;
|
||||||
@ -113,13 +113,15 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
|
|||||||
html_text_page.get_cur_line()->append_unicodes(&uu, 1);
|
html_text_page.get_cur_line()->append_unicodes(&uu, 1);
|
||||||
/*
|
/*
|
||||||
* In PDF, word_space is appended if (n == 1 and *p = ' ')
|
* In PDF, word_space is appended if (n == 1 and *p = ' ')
|
||||||
* but in HTML, word_space is appended if (uu == ' ')
|
* but in HTML, word_space is appended if (uu == ' ' || 0xa0)
|
||||||
*/
|
*/
|
||||||
int space_count = (is_space ? 1 : 0) - (uu == ' ' ? 1 : 0);
|
int space_count = (is_space ? 1 : 0) - ((uu == ' ' || uu == 0xa0) ? 1 : 0);
|
||||||
if(space_count != 0)
|
if(space_count != 0)
|
||||||
|
{
|
||||||
html_text_page.get_cur_line()->append_offset(cur_word_space * draw_text_scale * space_count);
|
html_text_page.get_cur_line()->append_offset(cur_word_space * draw_text_scale * space_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dx += dx1;
|
dx += dx1;
|
||||||
dy += dy1;
|
dy += dy1;
|
||||||
|
@ -262,6 +262,7 @@ void ffw_cidflatten(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* There is no check if a glyph with the same unicode exists!
|
* There is no check if a glyph with the same unicode exists!
|
||||||
|
* TODO: let FontForge fill in the standard glyph name <- or maybe this might cause collision?
|
||||||
*/
|
*/
|
||||||
void ffw_add_empty_char(int32_t unicode, int width)
|
void ffw_add_empty_char(int32_t unicode, int width)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user