diff --git a/icu4c/source/aclocal.m4 b/icu4c/source/aclocal.m4 index cdaff9b1ab2..ef5bf838d42 100644 --- a/icu4c/source/aclocal.m4 +++ b/icu4c/source/aclocal.m4 @@ -1,5 +1,5 @@ # aclocal.m4 for ICU -# Copyright (c) 1999-2009, International Business Machines Corporation and +# Copyright (c) 1999-2010, International Business Machines Corporation and # others. All Rights Reserved. # Stephen F. Booth @@ -149,10 +149,13 @@ AC_DEFUN(AC_CHECK_64BIT_LIBS, if test "$cross_compiling" = "yes" -a "${BITS_REQ}" != "nochange"; then AC_MSG_ERROR([Don't specify bitness when cross compiling. See readme.html for help with cross compilation., and set compiler options manually.]) fi - DEFAULT_64BIT=no + AC_CHECK_SIZEOF([void *]) AC_MSG_CHECKING([whether runnable 64 bit binaries are built by default]) - AC_RUN_IFELSE(int main(void) {return (sizeof(void*)*8==64)?0:1;}, - DEFAULT_64BIT=yes, DEFAULT_64BIT=no, DEFAULT_64BIT=unknown) + case $ac_cv_sizeof_void_p in + 8) DEFAULT_64BIT=yes ;; + 4) DEFAULT_64BIT=no ;; + *) DEFAULT_64BIT=unknown + esac BITS_GOT=unknown # 'OK' here means, we can exit any further checking, everything's copa diff --git a/icu4c/source/config/mh-cygwin b/icu4c/source/config/mh-cygwin index 873a0dd652e..fdbd0e71c46 100644 --- a/icu4c/source/config/mh-cygwin +++ b/icu4c/source/config/mh-cygwin @@ -1,6 +1,6 @@ ## -*-makefile-*- ## Cygwin-specific setup -## Copyright (c) 2001-2009, International Business Machines Corporation and +## Copyright (c) 2001-2010, International Business Machines Corporation and ## others. All Rights Reserved. ## Commands to generate dependency files @@ -58,11 +58,6 @@ LIBICU = cyg$(ICUPREFIX) ## To have an import library is better on Cygwin IMPORT_LIB_EXT = .dll.a -# Change the stubnames so that poorly working FAT disks and installation programs can work. -# This is also for backwards compatibility. -DATA_STUBNAME = dt -I18N_STUBNAME = in - ## Compilation rules %.$(STATIC_O): $(srcdir)/%.c $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< diff --git a/icu4c/source/layout/ExtensionSubtables.cpp b/icu4c/source/layout/ExtensionSubtables.cpp index 411f565e2a0..6011154bf68 100644 --- a/icu4c/source/layout/ExtensionSubtables.cpp +++ b/icu4c/source/layout/ExtensionSubtables.cpp @@ -1,7 +1,7 @@ /* * %W% %E% * - * (C) Copyright IBM Corp. 2008 - All Rights Reserved + * (C) Copyright IBM Corp. 2008-2010 - All Rights Reserved * */ @@ -15,6 +15,8 @@ U_NAMESPACE_BEGIN +// read a 32-bit value that might only be 16-bit-aligned in memory +#define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1))) // FIXME: should look at the format too... maybe have a sub-class for it? le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_uint16 lookupType, @@ -27,7 +29,7 @@ le_uint32 ExtensionSubtable::process(const LookupProcessor *lookupProcessor, le_ le_uint16 elt = SWAPW(extensionLookupType); if (elt != lookupType) { - le_uint32 extOffset = SWAPL(extensionOffset); + le_uint32 extOffset = READ_LONG(extensionOffset); LookupSubtable *subtable = (LookupSubtable *) ((char *) this + extOffset); return lookupProcessor->applySubtable(subtable, elt, glyphIterator, fontInstance, success); diff --git a/icu4c/source/layout/Features.h b/icu4c/source/layout/Features.h deleted file mode 100644 index 47563d9d433..00000000000 --- a/icu4c/source/layout/Features.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved - * - */ - -#ifndef __FEATURES_H -#define __FEATURES_H - -/** - * \file - * \internal - */ - -#include "LETypes.h" -#include "OpenTypeTables.h" - -U_NAMESPACE_BEGIN - -struct FeatureRecord -{ - ATag featureTag; - Offset featureTableOffset; -}; - -struct FeatureTable -{ - Offset featureParamsOffset; - le_uint16 lookupCount; - le_uint16 lookupListIndexArray[ANY_NUMBER]; -}; - -struct FeatureListTable -{ - le_uint16 featureCount; - FeatureRecord featureRecordArray[ANY_NUMBER]; - - const FeatureTable *getFeatureTable(le_uint16 featureIndex, LETag *featureTag) const; - - const FeatureTable *getFeatureTable(LETag featureTag) const; -}; - -U_NAMESPACE_END -#endif diff --git a/icu4c/source/layout/MarkToBasePosnSubtables.cpp b/icu4c/source/layout/MarkToBasePosnSubtables.cpp index 6843c4a1c80..7711988081e 100644 --- a/icu4c/source/layout/MarkToBasePosnSubtables.cpp +++ b/icu4c/source/layout/MarkToBasePosnSubtables.cpp @@ -1,6 +1,6 @@ /* * - * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -83,11 +83,27 @@ le_int32 MarkToBasePositioningSubtable::process(GlyphIterator *glyphIterator, co glyphIterator->setCurrGlyphBaseOffset(baseIterator.getCurrStreamPosition()); if (glyphIterator->isRightToLeft()) { + // FIXME: need similar patch to below; also in MarkToLigature and MarkToMark + // (is there a better way to approach this for all the cases?) glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX, anchorDiffY, -markAdvance.fX, -markAdvance.fY); } else { LEPoint baseAdvance; fontInstance->getGlyphAdvance(baseGlyph, pixels); + + //JK: adjustment needs to account for non-zero advance of any marks between base glyph and current mark + GlyphIterator gi(baseIterator, (le_uint16)0); // copy of baseIterator that won't ignore marks + gi.next(); // point beyond the base glyph + while (gi.getCurrStreamPosition() < glyphIterator->getCurrStreamPosition()) { // for all intervening glyphs (marks)... + LEGlyphID otherMark = gi.getCurrGlyphID(); + LEPoint px; + fontInstance->getGlyphAdvance(otherMark, px); // get advance, in case it's non-zero + pixels.fX += px.fX; // and add that to the base glyph's advance + pixels.fY += px.fY; + gi.next(); + } + // end of JK patch + fontInstance->pixelsToUnits(pixels, baseAdvance); glyphIterator->setCurrGlyphPositionAdjustment(anchorDiffX - baseAdvance.fX, anchorDiffY - baseAdvance.fY, -markAdvance.fX, -markAdvance.fY); diff --git a/icu4c/source/layout/OpenTypeLayoutEngine.cpp b/icu4c/source/layout/OpenTypeLayoutEngine.cpp index d9c9b29da51..13479b44cea 100644 --- a/icu4c/source/layout/OpenTypeLayoutEngine.cpp +++ b/icu4c/source/layout/OpenTypeLayoutEngine.cpp @@ -1,7 +1,7 @@ /* * - * (C) Copyright IBM Corp. 1998-2009 - All Rights Reserved + * (C) Copyright IBM Corp. 1998-2010 - All Rights Reserved * */ @@ -102,7 +102,9 @@ OpenTypeLayoutEngine::OpenTypeLayoutEngine(const LEFontInstance *fontInstance, l fGDEFTable = (const GlyphDefinitionTableHeader *) getFontTable(gdefTableTag); - if (gposTable != NULL && gposTable->coversScriptAndLanguage(fScriptTag, fLangSysTag)) { +// JK patch, 2008-05-30 - see Sinhala bug report and LKLUG font +// if (gposTable != NULL && gposTable->coversScriptAndLanguage(fScriptTag, fLangSysTag)) { + if (gposTable != NULL && gposTable->coversScript(fScriptTag)) { fGPOSTable = gposTable; } } @@ -198,9 +200,18 @@ le_int32 OpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_i return 0; } + if (LE_FAILURE(success)) { + LE_DELETE_ARRAY(outChars); + return 0; + } + CanonShaping::reorderMarks(&chars[offset], count, rightToLeft, outChars, glyphStorage); } + if (LE_FAILURE(success)) { + return 0; + } + glyphStorage.allocateGlyphArray(count, rightToLeft, success); glyphStorage.allocateAuxData(success); @@ -338,8 +349,11 @@ void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int3 } le_int32 glyphCount = glyphStorage.getGlyphCount(); + if (glyphCount == 0) { + return; + } - if (glyphCount > 0 && fGPOSTable != NULL) { + if (fGPOSTable != NULL) { GlyphPositionAdjustments *adjustments = new GlyphPositionAdjustments(glyphCount); le_int32 i; @@ -409,6 +423,9 @@ void OpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int3 glyphStorage.adjustPosition(glyphCount, xAdjust, -yAdjust, success); delete adjustments; + } else { + // if there was no GPOS table, maybe there's non-OpenType kerning we can use + LayoutEngine::adjustGlyphPositions(chars, offset, count, reverse, glyphStorage, success); } LEGlyphID zwnj = fFontInstance->mapCharToGlyph(0x200C);