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

restrict letter space optimization

This commit is contained in:
Lu Wang 2013-04-03 18:15:06 +08:00
parent 4f34a3ed84
commit add45cde74
2 changed files with 5 additions and 2 deletions

View File

@ -189,7 +189,9 @@ For some versions of Firefox, however, there will be a problem when the font siz
.TP .TP
.B --space-as-offset <0|1> (Default: 1) .B --space-as-offset <0|1> (Default: 1)
If set to 1, space characters will be treated as offsets, which allows a better optimization. Turn it off if space characters are not displayed correctly. If set to 1, space characters will be treated as offsets, which allows a better optimization.
This option may cause problems for PDF files with bad encodings.
.TP .TP
.B --tounicode <-1|0|1> (Default: 0) .B --tounicode <-1|0|1> (Default: 0)

View File

@ -338,7 +338,8 @@ void HTMLRenderer::TextLineBuffer::optimize()
} }
// now we would like to adjust letter space to most_used width // now we would like to adjust letter space to most_used width
if(max_count <= text_count - offset_count) // we shall apply the optimization only when it can significantly reduce the number of elements
if(max_count <= text_count / 2)
{ {
// the old value is the best // the old value is the best
// just copy copy offsets // just copy copy offsets