Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/font/layout/GXLayoutEngine2.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*/2425/*26*27* (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved28*29*/3031#ifndef __GXLAYOUTENGINE2_H32#define __GXLAYOUTENGINE2_H3334#include "LETypes.h"35#include "LayoutEngine.h"3637#include "MorphTables.h"3839U_NAMESPACE_BEGIN4041class LEFontInstance;42class LEGlyphStorage;4344/**45* This class implements layout for QuickDraw GX or Apple Advanced Typograyph (AAT)46* fonts. A font is a GX or AAT font if it contains a 'mort' table. See Apple's47* TrueType Reference Manual (http://fonts.apple.com/TTRefMan/index.html) for details.48* Information about 'mort' tables is in the chapter titled "Font Files."49*50* @internal51*/52class GXLayoutEngine2 : public LayoutEngine53{54public:55/**56* This is the main constructor. It constructs an instance of GXLayoutEngine for57* a particular font, script and language. It takes the 'mort' table as a parameter since58* LayoutEngine::layoutEngineFactory has to read the 'mort' table to know that it has a59* GX font.60*61* Note: GX and AAT fonts don't contain any script and language specific tables, so62* the script and language are ignored.63*64* @param fontInstance - the font65* @param scriptCode - the script66* @param langaugeCode - the language67* @param morphTable - the 'mort' table68* @param success - set to an error code if the operation fails69*70* @see LayoutEngine::layoutEngineFactory71* @see ScriptAndLangaugeTags.h for script and language codes72*73* @internal74*/75GXLayoutEngine2(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, const LEReferenceTo<MorphTableHeader2> &morphTable, le_int32 typoFlags, LEErrorCode &success);7677/**78* The destructor, virtual for correct polymorphic invocation.79*80* @internal81*/82virtual ~GXLayoutEngine2();8384/**85* ICU "poor man's RTTI", returns a UClassID for the actual class.86*87* @stable ICU 2.888*/89virtual UClassID getDynamicClassID() const;9091/**92* ICU "poor man's RTTI", returns a UClassID for this class.93*94* @stable ICU 2.895*/96static UClassID getStaticClassID();9798protected:99100/**101* The address of the 'mort' table102*103* @internal104*/105const LEReferenceTo<MorphTableHeader2> fMorphTable;106107/**108* This method does GX layout using the font's 'mort' table. It converts the109* input character codes to glyph indices using mapCharsToGlyphs, and then110* applies the 'mort' table.111*112* Input parameters:113* @param chars - the input character context114* @param offset - the index of the first character to process115* @param count - the number of characters to process116* @param max - the number of characters in the input context117* @param rightToLeft - <code>TRUE</code> if the text is in a right to left directional run118* @param glyphStorage - the glyph storage object. The glyph and char index arrays will be set.119*120* Output parameters:121* @param success - set to an error code if the operation fails122*123* @return the number of glyphs in the glyph index array124*125* @internal126*/127virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,128LEGlyphStorage &glyphStorage, LEErrorCode &success);129130/**131* This method adjusts the glyph positions using the font's132* 'kern', 'trak', 'bsln', 'opbd' and 'just' tables.133*134* Input parameters:135* @param glyphStorage - the object holding the glyph storage. The positions will be updated as needed.136*137* Output parameters:138* @param success - set to an error code if the operation fails139*140* @internal141*/142virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,143LEGlyphStorage &glyphStorage, LEErrorCode &success);144145};146147U_NAMESPACE_END148#endif149150151