/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
*
*
* (C) Copyright IBM Corp. 2004-2010 - All Rights Reserved
*
*/
#include "KernTable.h"
#include "LEFontInstance.h"
#include "LEGlyphStorage.h"
#include "LESwaps.h"
#include "OpenTypeUtilities.h"
#include <stdio.h>
#define DEBUG 0
struct PairInfo {
};
struct Subtable_0 {
};
// Kern table version 0 only
struct SubtableHeader {
};
// Version 0 only, version 1 has different layout
struct KernTableHeader {
};
/*
* This implementation has support for only one subtable, so if the font has
* multiple subtables, only the first will be used. If this turns out to
* be a problem in practice we should add it.
*
* This also supports only version 0 of the kern table header, only
* Apple supports the latter.
*
* This implementation isn't careful about the kern table flags, and
* might invoke kerning when it is not supposed to. That too I'm
* leaving for a bug fix.
*
* TODO: support multiple subtables
* TODO: respect header flags
*/
{
#if DEBUG
#endif
return;
}
#if DEBUG
// dump first 32 bytes of header
for (int i = 0; i < 64; ++i) {
if (((i+1)&0xf) == 0) {
} else if (((i+1)&0x7) == 0) {
}
}
#endif
if(LE_FAILURE(success)) return;
#if 0 // some old fonts have bad values here...
#else
#endif
// pairsSwapped is an instance member, and table is on the stack.
// set 'pairsSwapped' based on table.getAlias(). This will range check it.
if (pairsSwapped == NULL) {
KERN_SUBTABLE_0_HEADER_SIZE, // .. offset of header size
nPairs); // count
}
}
}
}
#if 0
fprintf(stderr, " searchRange: %d entrySelector: %d rangeShift: %d\n", searchRange, entrySelector, rangeShift);
fprintf(stderr, "[[ ignored font table entries: range %d selector %d shift %d ]]\n", SWAPW(table->searchRange), SWAPW(table->entrySelector), SWAPW(table->rangeShift));
#endif
#if DEBUG
" searchRange(pairs): %d entrySelector: %d rangeShift(pairs): %d\n",
{
// dump part of the pair list
for (int i = 256; --i >= 0;) {
if (id < 256) {
}
}
PairInfo *p = pairsSwapped;
for (int i = 0; i < nPairs; ++i, p++) {
if (c > 0x20 && c < 0x7f) {
} else {
}
if (c > 0x20 && c < 0x7f) {
} else {
}
}
}
}
#endif
}
}
}
}
/*
* Process the glyph positions. The positions array has two floats for each
* glyph, plus a trailing pair to mark the end of the last glyph.
*/
{
if(LE_FAILURE(success)) return;
if (pairsSwapped) {
float adjust = 0;
// argh, to do a binary search, we need to have the pair list in sorted order
// but it is not in sorted order on win32 platforms because of the endianness difference
// so either I have to swap the element each time I examine it, or I have to swap
// all the elements ahead of time and store them in the font
const PairInfo* p = pairsSwapped;
const PairInfo* tp = (const PairInfo*)(p + (rangeShift/KERN_PAIRINFO_SIZE)); /* rangeshift is in original table bytes */
p = tp;
}
#if DEBUG
#endif
while (probe > 1) {
probe >>= 1;
#if DEBUG
#endif
#if DEBUG
#endif
// Have to undo the device transform.
// REMIND either find a way to do this only if there is a
// device transform, or a faster way, such as moving the
// entire kern table up to Java.
break;
}
p = tp;
}
}
}
}
}