Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/font/layout/GXLayoutEngine.h
38918 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/242526/*27*28* (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved29*30*/3132#ifndef __GXLAYOUTENGINE_H33#define __GXLAYOUTENGINE_H3435#include "LETypes.h"36#include "LayoutEngine.h"3738#include "MorphTables.h"3940U_NAMESPACE_BEGIN4142class LEFontInstance;43class LEGlyphStorage;4445/**46* This class implements layout for QuickDraw GX or Apple Advanced Typograyph (AAT)47* fonts. A font is a GX or AAT font if it contains a 'mort' table. See Apple's48* TrueType Reference Manual (http://fonts.apple.com/TTRefMan/index.html) for details.49* Information about 'mort' tables is in the chapter titled "Font Files."50*51* @internal52*/53class GXLayoutEngine : public LayoutEngine54{55public:56/**57* This is the main constructor. It constructs an instance of GXLayoutEngine for58* a particular font, script and language. It takes the 'mort' table as a parameter since59* LayoutEngine::layoutEngineFactory has to read the 'mort' table to know that it has a60* GX font.61*62* Note: GX and AAT fonts don't contain any script and language specific tables, so63* the script and language are ignored.64*65* @param fontInstance - the font66* @param scriptCode - the script67* @param langaugeCode - the language68* @param morphTable - the 'mort' table69* @param success - set to an error code if the operation fails70*71* @see LayoutEngine::layoutEngineFactory72* @see ScriptAndLangaugeTags.h for script and language codes73*74* @internal75*/76GXLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const LEReferenceTo<MorphTableHeader> &morphTable, LEErrorCode &success);7778/**79* The destructor, virtual for correct polymorphic invocation.80*81* @internal82*/83virtual ~GXLayoutEngine();8485/**86* ICU "poor man's RTTI", returns a UClassID for the actual class.87*88* @stable ICU 2.889*/90virtual UClassID getDynamicClassID() const;9192/**93* ICU "poor man's RTTI", returns a UClassID for this class.94*95* @stable ICU 2.896*/97static UClassID getStaticClassID();9899protected:100101/**102* The address of the 'mort' table103*104* @internal105*/106LEReferenceTo<MorphTableHeader> fMorphTable;107108/**109* This method does GX layout using the font's 'mort' table. It converts the110* input character codes to glyph indices using mapCharsToGlyphs, and then111* applies the 'mort' table.112*113* Input parameters:114* @param chars - the input character context115* @param offset - the index of the first character to process116* @param count - the number of characters to process117* @param max - the number of characters in the input context118* @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run119* @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.120*121* Output parameters:122* @param success - set to an error code if the operation fails123*124* @return the number of glyphs in the glyph index array125*126* @internal127*/128virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,129LEGlyphStorage &glyphStorage, LEErrorCode &success);130131/**132* This method adjusts the glyph positions using the font's133* 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.134*135* Input parameters:136* @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed.137*138* Output parameters:139* @param success - set to an error code if the operation fails140*141* @internal142*/143virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,144LEGlyphStorage &glyphStorage, LEErrorCode &success);145146};147148U_NAMESPACE_END149#endif150151152153