2
|
1 |
/*
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
*
|
|
4 |
* This code is free software; you can redistribute it and/or modify it
|
|
5 |
* under the terms of the GNU General Public License version 2 only, as
|
5506
|
6 |
* published by the Free Software Foundation. Oracle designates this
|
2
|
7 |
* particular file as subject to the "Classpath" exception as provided
|
5506
|
8 |
* by Oracle in the LICENSE file that accompanied this code.
|
2
|
9 |
*
|
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
* accompanied this code).
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License version
|
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
*
|
5506
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
21 |
* or visit www.oracle.com if you need additional information or have any
|
|
22 |
* questions.
|
2
|
23 |
*
|
|
24 |
*/
|
|
25 |
|
|
26 |
/*
|
|
27 |
* (C) Copyright IBM Corp. 1998 - 2005 - All Rights Reserved
|
|
28 |
*
|
|
29 |
*/
|
|
30 |
|
|
31 |
#include "LETypes.h"
|
|
32 |
#include "OpenTypeTables.h"
|
|
33 |
#include "GlyphPositioningTables.h"
|
|
34 |
#include "CursiveAttachmentSubtables.h"
|
|
35 |
#include "AnchorTables.h"
|
|
36 |
#include "GlyphIterator.h"
|
|
37 |
#include "OpenTypeUtilities.h"
|
|
38 |
#include "LESwaps.h"
|
|
39 |
|
3935
|
40 |
U_NAMESPACE_BEGIN
|
|
41 |
|
16891
|
42 |
le_uint32 CursiveAttachmentSubtable::process(const LEReferenceTo<CursiveAttachmentSubtable> &base, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance, LEErrorCode &success) const
|
2
|
43 |
{
|
|
44 |
LEGlyphID glyphID = glyphIterator->getCurrGlyphID();
|
16891
|
45 |
le_int32 coverageIndex = getGlyphCoverage(base, glyphID, success);
|
2
|
46 |
le_uint16 eeCount = SWAPW(entryExitCount);
|
|
47 |
|
|
48 |
if (coverageIndex < 0 || coverageIndex >= eeCount) {
|
|
49 |
glyphIterator->setCursiveGlyph();
|
|
50 |
return 0;
|
|
51 |
}
|
|
52 |
|
|
53 |
LEPoint entryAnchor, exitAnchor;
|
16891
|
54 |
Offset entryOffset = SWAPW(entryExitRecords[coverageIndex].entryAnchor); // TODO
|
2
|
55 |
Offset exitOffset = SWAPW(entryExitRecords[coverageIndex].exitAnchor);
|
|
56 |
|
|
57 |
if (entryOffset != 0) {
|
|
58 |
const AnchorTable *entryAnchorTable = (const AnchorTable *) ((char *) this + entryOffset);
|
|
59 |
|
|
60 |
entryAnchorTable->getAnchor(glyphID, fontInstance, entryAnchor);
|
|
61 |
glyphIterator->setCursiveEntryPoint(entryAnchor);
|
7486
|
62 |
} else {
|
|
63 |
//glyphIterator->clearCursiveEntryPoint();
|
2
|
64 |
}
|
|
65 |
|
|
66 |
if (exitOffset != 0) {
|
|
67 |
const AnchorTable *exitAnchorTable = (const AnchorTable *) ((char *) this + exitOffset);
|
|
68 |
|
|
69 |
exitAnchorTable->getAnchor(glyphID, fontInstance, exitAnchor);
|
|
70 |
glyphIterator->setCursiveExitPoint(exitAnchor);
|
7486
|
71 |
} else {
|
|
72 |
//glyphIterator->clearCursiveExitPoint();
|
2
|
73 |
}
|
|
74 |
|
|
75 |
return 1;
|
|
76 |
}
|
3935
|
77 |
|
|
78 |
U_NAMESPACE_END
|