/*
* 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.
*/
#import <AppKit/AppKit.h>
#import "CoreTextSupport.h"
/*
* Callback for CoreText which uses the CoreTextProviderStruct to
* feed CT UniChars. We only use it for one-off lines, and don't
* attempt to fragment our strings.
*/
const UniChar *
{
// if we have a zero length string we can just return NULL for the string
// or if the index anything other than 0 we are not using core text
// correctly since we only have one run.
if (stringIndex != 0) {
return NULL;
}
}
/*
* Gets a Dictionary filled with common details we want to use for CoreText
* when we are interacting with it from Java.
*/
static inline CFMutableDictionaryRef
{
// TODO(cpc): following attribute is private...
//gOneNumber, (id)kCTForegroundColorFromContextAttributeName,
// force integer hack in CoreText to help with Java integer assumptions
NULL];
return dictRef;
}
/*
* Releases the CoreText Dictionary - in the future we should hold on
* to these to improve performance.
*/
static inline void
{
}
/*
* Transform Unicode characters into glyphs.
*
* Fills the "glyphsAsInts" array with the glyph codes for the current font,
* or the negative unicode value if we know the character can be hot-substituted.
*
* This is the heart of "Universal Font Substitution" in Java.
*/
(const AWTFont *font, const UniChar unicodes[], CGGlyph glyphs[], jint glyphsAsInts[], const size_t count)
{
size_t i;
for (i = 0; i < count; i++) {
if (glyph > 0) {
glyphsAsInts[i] = glyph;
continue;
}
const CTFontRef fallback = JRSFontCreateFallbackFontForCharacters((CTFontRef)font->fFont, &unicode, 1);
if (fallback) {
}
if (glyph > 0) {
} else {
}
}
}
/*
* Returns the substituted font, and places the appropriate glyph into "glyphRef"
*/
CTFontRef fallback = JRSFontCreateFallbackFontForCharacters((CTFontRef)font->fFont, charRef, count);
{
// use the original font if we somehow got duped into trying to fallback something we can't
}
return fallback;
}
/*
* Translates a Java glyph code int (might be a negative unicode value) into a CGGlyph/CTFontRef pair
* Returns the substituted font, and places the appropriate glyph into "glyphRef"
*/
{
// negative glyph codes are really unicodes, which were placed there by the mapper
// to indicate we should use CoreText to substitute the character
if (glyphCode >= 0)
{
}
}
// Breakup a 32 bit unicode value into the component surrogate pairs
}