Dash:
[t2.git] / package / graphic / cuneiform / hocr2.patch
blob0b8e87d71fe01b1d2c15aba81d30423ec0dc6b21
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../cuneiform/hocr2.patch
5 # Copyright (C) 2010 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- cuneiform-linux-1.0.0/cuneiform_src/Kern/rout/src/html.cpp.vanilla 2010-11-25 11:18:50.000000000 +0100
18 +++ cuneiform-linux-1.0.0/cuneiform_src/Kern/rout/src/html.cpp 2010-11-25 11:49:28.000000000 +0100
19 @@ -228,9 +228,6 @@
20 static Byte* pLineStart = 0;
21 //! \~english is the ptr to the location that gMemCur pointed to when reason was BROWSE_LINE_START
23 - static std::vector<edRect > currentLineCharBBoxes;
24 - currentLineCharBBoxes.reserve(200);
27 // Â êîíöå âûçûâàåòñÿ WordControl
29 @@ -246,11 +243,14 @@
30 FontStyle(CED_GetCharFontAttribs(hObject));
32 r = CED_GetCharLayout(hObject);
33 - currentLineCharBBoxes.push_back(r);
35 // Çàïèñàòü ñèìâîë
36 if(isGoodCharRect(r) && hocrmode)
38 + sprintf(buf, "<span title=\"bbox %d %d %d %d\">",
39 + r.left, r.top, r.right, r.bottom);
40 + PUT_STRING(buf);
42 if (0 == isInLine)
43 // íà÷íåì îïðåäåëåíèå ãðàíèö ñòðîêè
45 @@ -276,6 +276,9 @@
47 ONE_CHAR(hObject);
49 + if(r.left != -1 && hocrmode)
50 + PUT_STRING("</span>");
52 break;
54 case BROWSE_LINE_START:
55 @@ -286,17 +289,8 @@
57 case BROWSE_LINE_END:
58 // Êîíåö ñòðîêè òåêñòà
59 - if (hocrmode)
60 - writeHocrLineStartTag(pLineStart, rcLine, iLine);
61 FontStyle(0);
63 - // write character bounding boxes info
64 - if (currentLineCharBBoxes.size())
65 - if (hocrmode)
66 - writeHocrCharBBoxesInfo(currentLineCharBBoxes, iLine);
67 - currentLineCharBBoxes.resize(0);
70 isInLine = false;
71 if ( gPreserveLineBreaks || gEdLineHardBreak )
73 @@ -304,8 +298,6 @@
76 iLine++;
77 - // close HocrLine tag
78 - PUT_STRING("</span>");
80 NEW_LINE;
81 break;