# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/cuneiform/hocr2.patch # Copyright (C) 2010 - 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- cuneiform-linux-1.0.0/cuneiform_src/Kern/rout/src/html.cpp.vanilla 2010-11-25 11:18:50.000000000 +0100 +++ cuneiform-linux-1.0.0/cuneiform_src/Kern/rout/src/html.cpp 2010-11-25 11:49:28.000000000 +0100 @@ -228,9 +228,6 @@ static Byte* pLineStart = 0; //! \~english is the ptr to the location that gMemCur pointed to when reason was BROWSE_LINE_START - static std::vector currentLineCharBBoxes; - currentLineCharBBoxes.reserve(200); - // В конце вызывается WordControl @@ -246,11 +243,14 @@ FontStyle(CED_GetCharFontAttribs(hObject)); r = CED_GetCharLayout(hObject); - currentLineCharBBoxes.push_back(r); // Записать символ if(isGoodCharRect(r) && hocrmode) { + sprintf(buf, "", + r.left, r.top, r.right, r.bottom); + PUT_STRING(buf); + if (0 == isInLine) // начнем определение границ строки { @@ -276,6 +276,9 @@ } ONE_CHAR(hObject); + if(r.left != -1 && hocrmode) + PUT_STRING(""); + break; } case BROWSE_LINE_START: @@ -286,17 +289,8 @@ case BROWSE_LINE_END: // Конец строки текста - if (hocrmode) - writeHocrLineStartTag(pLineStart, rcLine, iLine); FontStyle(0); - // write character bounding boxes info - if (currentLineCharBBoxes.size()) - if (hocrmode) - writeHocrCharBBoxesInfo(currentLineCharBBoxes, iLine); - currentLineCharBBoxes.resize(0); - - isInLine = false; if ( gPreserveLineBreaks || gEdLineHardBreak ) { @@ -304,8 +298,6 @@ } iLine++; - // close HocrLine tag - PUT_STRING(""); NEW_LINE; break;