<head>
<title>ReadMe for ICU 55.0.1 (55m1)</title>
<meta name="COPYRIGHT" content=
- "Copyright (c) 1997-2014 IBM Corporation and others. All Rights Reserved." />
+ "Copyright (c) 1997-2015 IBM Corporation and others. All Rights Reserved." />
<meta name="KEYWORDS" content=
"ICU; International Components for Unicode; ICU4C; what's new; readme; read me; introduction; downloads; downloading; building; installation;" />
<meta name="DESCRIPTION" content=
<p>See the <a href="APIChangeReport.html">API Change Report</a> for a complete
list of APIs added, removed, or changed in this release.</p>
+ <!-- ICU 55 items -->
+ <h3>Layout Engine: breaking API change</h3>
+ <p>The LayoutEngine (already deprecated) has had the function
+ <tt>LEFontInstance::getFontTable(LETag, size_t &length)</tt>
+ since ICU 52. Its implementation was optional. In ICU 55, this
+ version
+ of <tt>getFontTable</tt> has been made pure virtual, and the
+ version without a length (<tt>getFontTable(LETag)</tt>) has been
+ completely removed. This is a breaking change for users who have
+ not implemented the two-argument <tt>getFontTable()</tt>
+ function in their <tt>LEFontInstance</tt> subclasses.
+ The break is intentional, as the one-argument version cannot be
+ made secure. See <tt>LEFontInstance</tt> api docs for more detail.
+ </p>
+
+
<!-- ICU 54 items -->
<h3>Deprecation: Layout Engine</h3>
<p>The LayoutEngine is now deprecated. Please
/*
*
- * (C) Copyright IBM Corp. 1998-2014 - All Rights Reserved
+ * (C) Copyright IBM Corp. 1998-2015 - All Rights Reserved
*
*/
*
* Subclasses which represent composite fonts should always return <code>NULL</code>.
*
- * Note that implementing this function does not allow for range checking.
- * Subclasses that desire the safety of range checking must implement the
- * variation which has a length parameter.
- *
- * @param tableTag - the four byte table tag. (e.g. 'cmap')
- *
- * @return the address of the table in memory, or <code>NULL</code>
- * if the table doesn't exist.
- *
- * @deprecated ICU 54. See {@link icu::LayoutEngine}
- */
- virtual const void *getFontTable(LETag tableTag) const = 0;
-
- /**
- * This method reads a table from the font. Note that in general,
- * it only makes sense to call this method on an <code>LEFontInstance</code>
- * which represents a physical font - i.e. one which has been returned by
- * <code>getSubFont()</code>. This is because each subfont in a composite font
- * will have different tables, and there's no way to know which subfont to access.
- *
- * Subclasses which represent composite fonts should always return <code>NULL</code>.
- *
- * This version sets a length, for range checking.
- * Note that range checking can only be accomplished if this function is
- * implemented in subclasses.
- *
* @param tableTag - the four byte table tag. (e.g. 'cmap')
* @param length - ignored on entry, on exit will be the length of the table if known, or -1 if unknown.
* @return the address of the table in memory, or <code>NULL</code>
* if the table doesn't exist.
* @deprecated ICU 54. See {@link LayoutEngine}
*/
- virtual const void* getFontTable(LETag tableTag, size_t &length) const { length=-1; return getFontTable(tableTag); } /* -1 = unknown length */
+ virtual const void* getFontTable(LETag tableTag, size_t &length) const = 0;
/**
* This method is used to determine if the font can
/*
- * (C) Copyright IBM Corp. and others 1998-2014 - All Rights Reserved
+ * (C) Copyright IBM Corp. and others 1998-2015 - All Rights Reserved
*/
#include "LETypes.h"
break;
}
} else {
- MorphTableHeader2 *morxTable = (MorphTableHeader2 *)fontInstance->getFontTable(morxTableTag);
- if (morxTable != NULL && SWAPL(morxTable->version)==0x00020000) {
- result = new GXLayoutEngine2(fontInstance, scriptCode, languageCode, morxTable, typoFlags, success);
+ LEReferenceTo<MorphTableHeader2> morxTable(fontInstance, morxTableTag, success);
+ if (LE_SUCCESS(success) && morxTable.isValid() && SWAPL(morxTable->version)==0x00020000) {
+ result = new GXLayoutEngine2(fontInstance, scriptCode, languageCode, morxTable, typoFlags, success);
} else {
LEReferenceTo<MorphTableHeader> mortTable(fontInstance, mortTableTag, success);
if (LE_SUCCESS(success) && mortTable.isValid() && SWAPL(mortTable->version)==0x00010000) { // mort
/*
*******************************************************************************
*
- * Copyright (C) 1999-2014, International Business Machines
+ * Copyright (C) 1999-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
return table;
}
-const void *PortableFontInstance::getFontTable(LETag tableTag) const
-{
- size_t ignored;
- return getFontTable(tableTag, ignored);
-}
-
const void *PortableFontInstance::getFontTable(LETag tableTag, size_t &length) const
{
return FontTableCache::find(tableTag, length);
/*
*******************************************************************************
*
- * Copyright (C) 1999-2013, International Business Machines
+ * Copyright (C) 1999-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
virtual ~PortableFontInstance();
- virtual const void *getFontTable(LETag tableTag) const;
virtual const void *getFontTable(LETag tableTag, size_t &length) const;
virtual const char *getNameString(le_uint16 nameID, le_uint16 platform, le_uint16 encoding, le_uint16 language) const;
/*
*******************************************************************************
*
- * Copyright (C) 1999-2014, International Business Machines
+ * Copyright (C) 1999-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
// nothing to do...
}
-const void *SimpleFontInstance::getFontTable(LETag tableTag) const
+const void *SimpleFontInstance::getFontTable(LETag tableTag, size_t &length) const
{
+ length = -1; // unknown for this test.
#ifndef USING_ICULEHB
if (tableTag == LE_GSUB_TABLE_TAG) {
return CanonShaping::glyphSubstitutionTable;
/*
*******************************************************************************
*
- * Copyright (C) 1999-2007, International Business Machines
+ * Copyright (C) 1999-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
virtual ~SimpleFontInstance();
- virtual const void *getFontTable(LETag tableTag) const;
+ virtual const void *getFontTable(LETag tableTag, size_t &length) const;
virtual le_int32 getUnitsPerEM() const;