1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

working on nbsp

This commit is contained in:
Lu Wang 2013-05-02 00:56:37 +08:00
parent b8cfac4574
commit e7a55c6371
2 changed files with 7 additions and 4 deletions

View File

@ -78,10 +78,10 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
* This is by standard
* however some PDF will use ' ' as a normal encoding slot
* 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
* 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;
++nSpaces;
@ -113,11 +113,13 @@ void HTMLRenderer::drawString(GfxState * state, GooString * s)
html_text_page.get_cur_line()->append_unicodes(&uu, 1);
/*
* 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)
{
html_text_page.get_cur_line()->append_offset(cur_word_space * draw_text_scale * space_count);
}
}
}

View File

@ -262,6 +262,7 @@ void ffw_cidflatten(void)
/*
* 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)
{