Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/native/sun/font/layout/ArabicShaping.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. 1998-2005 - All Rights Reserved28*29*/3031#ifndef __ARABICSHAPING_H32#define __ARABICSHAPING_H3334/**35* \file36* \internal37*/3839#include "LETypes.h"40#include "OpenTypeTables.h"4142U_NAMESPACE_BEGIN4344class LEGlyphStorage;4546class ArabicShaping /* not : public UObject because all methods are static */ {47public:48// Joining types49enum JoiningTypes50{51JT_NON_JOINING = 0,52JT_JOIN_CAUSING = 1,53JT_DUAL_JOINING = 2,54JT_LEFT_JOINING = 3,55JT_RIGHT_JOINING = 4,56JT_TRANSPARENT = 5,57JT_COUNT = 658};5960// shaping bit masks61enum ShapingBitMasks62{63MASK_SHAPE_RIGHT = 1, // if this bit set, shapes to right64MASK_SHAPE_LEFT = 2, // if this bit set, shapes to left65MASK_TRANSPARENT = 4, // if this bit set, is transparent (ignore other bits)66MASK_NOSHAPE = 8 // if this bit set, don't shape this char, i.e. tatweel67};6869// shaping values70enum ShapeTypeValues71{72ST_NONE = 0,73ST_RIGHT = MASK_SHAPE_RIGHT,74ST_LEFT = MASK_SHAPE_LEFT,75ST_DUAL = MASK_SHAPE_RIGHT | MASK_SHAPE_LEFT,76ST_TRANSPARENT = MASK_TRANSPARENT,77ST_NOSHAPE_DUAL = MASK_NOSHAPE | ST_DUAL,78ST_NOSHAPE_NONE = MASK_NOSHAPE79};8081typedef le_int32 ShapeType;8283static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,84le_bool rightToLeft, LEGlyphStorage &glyphStorage);8586static const FeatureMap *getFeatureMap(le_int32 &count);8788private:89// forbid instantiation90ArabicShaping();9192static ShapeType getShapeType(LEUnicode c);9394static const le_uint8 shapingTypeTable[];95static const size_t shapingTypeTableLen;9697static const ShapeType shapeTypes[];9899static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage);100};101102U_NAMESPACE_END103#endif104105106