fix #1900: intraword spacing for slightly better pdf copy-paste performance

This commit is contained in:
Jeff Breidenbach 2019-04-29 11:28:30 +02:00 committed by Zdenko Podobný
parent 137e6de56f
commit 546a9e81eb

View File

@ -466,6 +466,10 @@ char* TessPDFRenderer::GetPDFTextObjects(TessBaseAPI* api,
}
res_it->Next(RIL_SYMBOL);
} while (!res_it->Empty(RIL_BLOCK) && !res_it->IsAtBeginningOf(RIL_WORD));
if (res_it->IsAtBeginningOf(RIL_WORD)) {
pdf_word += "0020";
pdf_word_len++;
}
if (word_length > 0 && pdf_word_len > 0) {
double h_stretch =
kCharWidth * prec(100.0 * word_length / (fontsize * pdf_word_len));