5891N/A/*
5891N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5891N/A *
5891N/A * This code is free software; you can redistribute it and/or modify it
5891N/A * under the terms of the GNU General Public License version 2 only, as
5891N/A * published by the Free Software Foundation. Oracle designates this
5891N/A * particular file as subject to the "Classpath" exception as provided
5891N/A * by Oracle in the LICENSE file that accompanied this code.
5891N/A *
5891N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5891N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5891N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5891N/A * version 2 for more details (a copy is included in the LICENSE file that
5891N/A * accompanied this code).
5891N/A *
5891N/A * You should have received a copy of the GNU General Public License version
5891N/A * 2 along with this work; if not, write to the Free Software Foundation,
5891N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5891N/A *
5891N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5891N/A * or visit www.oracle.com if you need additional information or have any
5891N/A * questions.
5891N/A *
5891N/A */
5891N/A
5891N/A/*
5891N/A *
5891N/A * (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
5891N/A *
5891N/A */
5891N/A
5891N/A#include "LETypes.h"
5891N/A#include "LayoutEngine.h"
5891N/A#include "GXLayoutEngine2.h"
5891N/A#include "LEGlyphStorage.h"
5891N/A#include "MorphTables.h"
5891N/A
5891N/AU_NAMESPACE_BEGIN
5891N/A
5891N/AUOBJECT_DEFINE_RTTI_IMPLEMENTATION(GXLayoutEngine2)
5891N/A
5980N/AGXLayoutEngine2::GXLayoutEngine2(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const LEReferenceTo<MorphTableHeader2> &morphTable, le_int32 typoFlags, LEErrorCode &success)
5980N/A : LayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, success), fMorphTable(morphTable)
5891N/A{
5980N/A // nothing else to do?
5891N/A}
5891N/A
5891N/AGXLayoutEngine2::~GXLayoutEngine2()
5891N/A{
5891N/A reset();
5891N/A}
5891N/A
5891N/A// apply 'morx' table
5891N/Ale_int32 GXLayoutEngine2::computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success)
5891N/A{
5891N/A if (LE_FAILURE(success)) {
5891N/A return 0;
5891N/A }
5891N/A
5891N/A if (chars == NULL || offset < 0 || count < 0 || max < 0 || offset >= max || offset + count > max) {
5891N/A success = LE_ILLEGAL_ARGUMENT_ERROR;
5891N/A return 0;
5891N/A }
5891N/A
5891N/A mapCharsToGlyphs(chars, offset, count, rightToLeft, rightToLeft, glyphStorage, success);
5891N/A
5891N/A if (LE_FAILURE(success)) {
5891N/A return 0;
5891N/A }
5891N/A
5980N/A fMorphTable->process(fMorphTable, glyphStorage, fTypoFlags, success);
5891N/A return count;
5891N/A}
5891N/A
5891N/A// apply positional tables
5891N/Avoid GXLayoutEngine2::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool /*reverse*/,
5891N/A LEGlyphStorage &/*glyphStorage*/, LEErrorCode &success)
5891N/A{
5891N/A if (LE_FAILURE(success)) {
5891N/A return;
5891N/A }
5891N/A
5891N/A if (chars == NULL || offset < 0 || count < 0) {
5891N/A success = LE_ILLEGAL_ARGUMENT_ERROR;
5891N/A return;
5891N/A }
5891N/A
5891N/A // FIXME: no positional processing yet...
5891N/A}
5891N/A
5891N/AU_NAMESPACE_END