sl@0: // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __FONTINDIC_H__ sl@0: #define __FONTINDIC_H__ sl@0: sl@0: #include "GlyphSel.h" sl@0: sl@0: /** Defines the maximum ammount of text thats can be shaped at one time. sl@0: Change this number to suit optimisation, as increasing it or decreasing it may sl@0: make Devanagari text faster/slower.*/ sl@0: const TInt KMaxTextToShape = 16; sl@0: sl@0: enum TIndicCodeType sl@0: { sl@0: // These values must not change without also changing sl@0: // KStateResponse table accordingly sl@0: EIndicCodeOther = 0, sl@0: EIndicCodeCombiningSign = 1, sl@0: EIndicCodeIndependentVowel = 2, sl@0: EIndicCodeConsonant = 3, sl@0: EIndicCodeDependentVowel = 4, sl@0: EIndicCodeVirama = 5, sl@0: EIndicCodeNukta = 6, sl@0: EIndicCodeZWJ = 7, sl@0: EIndicCodeNuktaConsonant = 8, sl@0: EIndicCodeIndependentVowelA = 9, sl@0: EIndicCodeDependentVowelCandraE = 10, sl@0: EIndicCodeConsonantKannadaBengaliRa = 11, sl@0: EIndicCodeSplitVowel1 = 12, sl@0: EIndicCodeSplitVowel2 = 13, sl@0: EIndicCodeTamilLengthMarkAU = 14, sl@0: //Gurmukhi specific types: EIndicCodeGurBeraer* for specific bearer sl@0: //EIndicCodeGurDependentVowel* for dependent vowles which can be combined sl@0: //with corresponding bearer to form an independent vowlel sl@0: EIndicCodeGurBearerA = 15, sl@0: EIndicCodeGurBearerU = 16, sl@0: EIndicCodeGurBearerI = 17, sl@0: EIndicCodeGurDependentVowelA = 18, sl@0: EIndicCodeGurDependentVowelU = 19, sl@0: EIndicCodeGurDependentVowelI = 20, sl@0: EIndicCodeConsonantMalaChillu = 21, sl@0: EIndicCodeConsonantMalaChilluNA = 22, sl@0: EIndicCodeConsonantMalaRRA = 23 sl@0: }; sl@0: sl@0: struct TIndicCodeMapping sl@0: { sl@0: TInt16 iFirstCodeInRange; sl@0: TInt16 iCodeType; // From TIndicCodeType sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the devanagari range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KDevCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0x901, EIndicCodeCombiningSign}, sl@0: {0x904, EIndicCodeIndependentVowel}, sl@0: {0x905, EIndicCodeIndependentVowelA}, sl@0: {0x906, EIndicCodeIndependentVowel}, sl@0: {0x915, EIndicCodeConsonant}, sl@0: {0x929, EIndicCodeNuktaConsonant}, sl@0: {0x92A, EIndicCodeConsonant}, sl@0: {0x931, EIndicCodeNuktaConsonant}, sl@0: {0x932, EIndicCodeConsonant}, sl@0: {0x934, EIndicCodeNuktaConsonant}, sl@0: {0x935, EIndicCodeConsonant}, sl@0: {0x93A, EIndicCodeOther}, sl@0: {0x93C, EIndicCodeNukta}, sl@0: {0x93D, EIndicCodeOther}, sl@0: {0x93E, EIndicCodeDependentVowel}, sl@0: {0x945, EIndicCodeDependentVowelCandraE}, sl@0: {0x946, EIndicCodeDependentVowel}, sl@0: {0x94D, EIndicCodeVirama}, sl@0: {0x94E, EIndicCodeOther}, sl@0: {0x951, EIndicCodeCombiningSign}, sl@0: {0x955, EIndicCodeConsonant}, sl@0: {0x958, EIndicCodeNuktaConsonant}, sl@0: {0x960, EIndicCodeIndependentVowel}, sl@0: {0x962, EIndicCodeDependentVowel}, sl@0: {0x964, EIndicCodeOther}, sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Kannada range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KKanCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0xC82, EIndicCodeCombiningSign}, sl@0: {0xC85, EIndicCodeIndependentVowel}, sl@0: {0xC95, EIndicCodeConsonant}, sl@0: {0xCB0, EIndicCodeConsonantKannadaBengaliRa}, sl@0: {0xCB1, EIndicCodeConsonant}, sl@0: {0xCB4, EIndicCodeOther}, sl@0: {0xCB5, EIndicCodeConsonant}, sl@0: {0xCBA, EIndicCodeOther}, sl@0: {0xCBC, EIndicCodeNukta}, sl@0: {0xCBD, EIndicCodeOther}, sl@0: {0xCBE, EIndicCodeDependentVowel}, sl@0: {0xCC5, EIndicCodeOther}, sl@0: {0xCC6, EIndicCodeDependentVowel}, sl@0: {0xCCD, EIndicCodeVirama}, sl@0: {0xCD5, EIndicCodeCombiningSign}, sl@0: {0xCDE, EIndicCodeConsonant}, sl@0: {0xCE0, EIndicCodeIndependentVowel}, sl@0: {0xCE2, EIndicCodeDependentVowel}, sl@0: {0xCE4, EIndicCodeOther}, sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Gujarati range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KGujCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0xA81, EIndicCodeCombiningSign}, sl@0: {0xA85, EIndicCodeIndependentVowel}, sl@0: {0xA8E, EIndicCodeOther}, sl@0: {0xA8F, EIndicCodeIndependentVowel}, sl@0: {0xA92, EIndicCodeOther}, sl@0: {0xA93, EIndicCodeIndependentVowel}, sl@0: {0xA95, EIndicCodeConsonant}, sl@0: {0xAA9, EIndicCodeOther}, sl@0: {0xAAA, EIndicCodeConsonant}, sl@0: {0xAB1, EIndicCodeOther}, sl@0: {0xAB2, EIndicCodeConsonant}, sl@0: {0xAB4, EIndicCodeOther}, sl@0: {0xAB5, EIndicCodeConsonant}, sl@0: {0xABC, EIndicCodeNukta}, sl@0: {0xABD, EIndicCodeOther}, sl@0: {0xABE, EIndicCodeDependentVowel}, sl@0: {0xAC6, EIndicCodeOther}, sl@0: {0xAC7, EIndicCodeDependentVowel}, sl@0: {0xACA, EIndicCodeOther}, sl@0: {0xACB, EIndicCodeDependentVowel}, sl@0: {0xACD, EIndicCodeVirama}, sl@0: {0xACE, EIndicCodeOther}, sl@0: {0xAE0, EIndicCodeIndependentVowel}, sl@0: {0xAE2, EIndicCodeDependentVowel}, sl@0: {0xAE4, EIndicCodeOther}, sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Gurmukhi range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KGurCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0xA01, EIndicCodeCombiningSign}, sl@0: {0xA04, EIndicCodeOther}, sl@0: {0xA05, EIndicCodeGurBearerA}, sl@0: {0xA06, EIndicCodeIndependentVowel}, sl@0: {0xA0B, EIndicCodeOther}, sl@0: {0xA0F, EIndicCodeIndependentVowel}, sl@0: {0xA11, EIndicCodeOther}, sl@0: {0xA13, EIndicCodeIndependentVowel}, sl@0: {0xA15, EIndicCodeConsonant}, sl@0: {0xA29, EIndicCodeOther}, sl@0: {0xA2A, EIndicCodeConsonant}, sl@0: {0xA31, EIndicCodeOther}, sl@0: {0xA32, EIndicCodeConsonant}, sl@0: {0xA33, EIndicCodeNuktaConsonant}, sl@0: {0xA34, EIndicCodeOther}, sl@0: {0xA35, EIndicCodeConsonant}, sl@0: {0xA36, EIndicCodeNuktaConsonant}, sl@0: {0xA37, EIndicCodeOther}, sl@0: {0xA38, EIndicCodeConsonant}, sl@0: {0xA3A, EIndicCodeOther}, sl@0: {0xA3C, EIndicCodeNukta}, sl@0: {0xA3D, EIndicCodeOther}, sl@0: {0xA3E, EIndicCodeGurDependentVowelA}, sl@0: {0xA3F, EIndicCodeGurDependentVowelI}, sl@0: {0xA41, EIndicCodeGurDependentVowelU}, sl@0: {0xA43, EIndicCodeOther}, sl@0: {0xA47, EIndicCodeGurDependentVowelI}, sl@0: {0xA48, EIndicCodeGurDependentVowelA}, sl@0: {0xA49, EIndicCodeOther}, sl@0: {0xA4B, EIndicCodeGurDependentVowelU}, sl@0: {0xA4C, EIndicCodeGurDependentVowelA}, sl@0: {0xA4D, EIndicCodeVirama}, sl@0: {0xA4E, EIndicCodeOther}, sl@0: {0xA59, EIndicCodeNuktaConsonant}, sl@0: {0xA5C, EIndicCodeConsonant}, sl@0: {0xA5D, EIndicCodeOther}, sl@0: {0xA5E, EIndicCodeNuktaConsonant}, sl@0: {0xA5F, EIndicCodeOther}, sl@0: {0xA70, EIndicCodeCombiningSign}, sl@0: {0xA71, EIndicCodeCombiningSign}, sl@0: {0xA72, EIndicCodeGurBearerI}, sl@0: {0xA73, EIndicCodeGurBearerU}, sl@0: {0xA74, EIndicCodeOther}, sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Bengali range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KBenCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0x981 , EIndicCodeCombiningSign}, sl@0: {0x985 , EIndicCodeIndependentVowel}, sl@0: {0x995 , EIndicCodeConsonant}, sl@0: {0x9B0 , EIndicCodeConsonantKannadaBengaliRa}, sl@0: {0x9B1 , EIndicCodeConsonant}, sl@0: {0x9BA , EIndicCodeOther}, sl@0: {0x9BC , EIndicCodeNukta}, sl@0: {0x9BD , EIndicCodeOther}, sl@0: {0x9BE , EIndicCodeDependentVowel}, sl@0: {0x9C9 , EIndicCodeOther}, sl@0: {0x9CB , EIndicCodeDependentVowel}, sl@0: {0x9CD , EIndicCodeVirama}, sl@0: {0x9CE , EIndicCodeOther}, sl@0: {0x9D7 , EIndicCodeDependentVowel}, sl@0: {0x9DC , EIndicCodeConsonant}, sl@0: {0x9E0 , EIndicCodeIndependentVowel}, sl@0: {0x9E2 , EIndicCodeDependentVowel}, sl@0: {0x9E4 , EIndicCodeOther}, sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Tamil range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KTamCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0xB82 , EIndicCodeCombiningSign}, sl@0: {0xB83 , EIndicCodeIndependentVowel}, sl@0: {0xB84 , EIndicCodeOther}, sl@0: {0xB85 , EIndicCodeIndependentVowel}, sl@0: {0xB92 , EIndicCodeIndependentVowelA}, sl@0: {0xB93 , EIndicCodeIndependentVowel}, sl@0: {0xB95 , EIndicCodeConsonant}, sl@0: {0xBBE , EIndicCodeSplitVowel2}, sl@0: {0xBBF , EIndicCodeDependentVowel}, sl@0: {0xBC6 , EIndicCodeSplitVowel1}, sl@0: {0xBC8 , EIndicCodeDependentVowel}, sl@0: {0xBCD , EIndicCodeVirama}, sl@0: {0xBCE , EIndicCodeOther}, sl@0: {0xBD7 , EIndicCodeTamilLengthMarkAU}, sl@0: {0xBE4 , EIndicCodeOther}, sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Telugu range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KTelCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, sl@0: {0xC01, EIndicCodeCombiningSign}, sl@0: {0xC04, EIndicCodeOther}, sl@0: {0xC05, EIndicCodeIndependentVowel}, sl@0: {0xC15, EIndicCodeConsonant}, sl@0: {0xC3A, EIndicCodeOther}, sl@0: {0xC3E, EIndicCodeDependentVowel}, sl@0: {0xC4D, EIndicCodeVirama}, sl@0: {0xC4E, EIndicCodeOther}, sl@0: {0xC55, EIndicCodeDependentVowel}, sl@0: {0xC57, EIndicCodeOther}, sl@0: {0xC60, EIndicCodeIndependentVowel}, sl@0: {0xC62, EIndicCodeOther} sl@0: }; sl@0: sl@0: /** Holds the types of all the symbols in the Malayalam range, so that we can sl@0: work out where the syllable boundaries begin and end. */ sl@0: static const TIndicCodeMapping KMalaCodeMap[] = sl@0: { sl@0: {0, EIndicCodeOther}, // NOT USED D00 - D01 sl@0: {0xD02, EIndicCodeCombiningSign}, // Modifiers sl@0: {0xD04, EIndicCodeOther}, // NOT USED sl@0: {0xD05, EIndicCodeIndependentVowel}, sl@0: // {0xD0D, EIndicCodeOther}, // Reserved sl@0: // {0xD0E, EIndicCodeIndependentVowel}, sl@0: // {0xD11, EIndicCodeOther}, // Reserved sl@0: // {0xD12, EIndicCodeIndependentVowel}, sl@0: {0xD15, EIndicCodeConsonant}, sl@0: {0xD23, EIndicCodeConsonantMalaChillu}, // NNA sl@0: {0xD24, EIndicCodeConsonant}, sl@0: {0xD28, EIndicCodeConsonantMalaChilluNA}, // NA sl@0: {0xD29, EIndicCodeOther}, // Reserved sl@0: {0xD2A, EIndicCodeConsonant}, sl@0: {0xD30, EIndicCodeConsonantMalaChillu}, // RA sl@0: {0xD31, EIndicCodeConsonantMalaRRA}, // RRA sl@0: {0xD32, EIndicCodeConsonantMalaChillu}, // LA, LLA sl@0: {0xD34, EIndicCodeConsonant}, sl@0: {0xD3A, EIndicCodeOther}, // NOT USED D3A - D3D sl@0: {0xD3E, EIndicCodeSplitVowel2}, sl@0: {0xD3F, EIndicCodeDependentVowel}, sl@0: // {0xD44, EIndicCodeOther}, // Reserved D44 - D45 sl@0: {0xD46, EIndicCodeSplitVowel1}, sl@0: {0xD48, EIndicCodeDependentVowel}, sl@0: // {0xD49, EIndicCodeOther}, // Reserved D49 sl@0: // {0xD4A, EIndicCodeDependentVowel}, sl@0: {0xD4D, EIndicCodeVirama}, sl@0: {0xD4E, EIndicCodeOther}, //Reserved D4E - D56 sl@0: {0xD57, EIndicCodeTamilLengthMarkAU}, // EIndicCodeDependentVowel for Telugu ??? sl@0: {0xD58, EIndicCodeOther}, // NOT USED D58 - D5F sl@0: {0xD60, EIndicCodeIndependentVowel}, // RR, LL sl@0: {0xD62, EIndicCodeOther}, // NOT USED D62 - D65, digits D66 - D6F sl@0: {0x200D, EIndicCodeZWJ}, sl@0: {0x200E, EIndicCodeOther} sl@0: }; sl@0: sl@0: /* Holds all parameters specific to scripts */ sl@0: struct TIndicScriptProcessorParameters{ sl@0: TUint32 iLanguageCode; sl@0: TUint32 iScriptCode; sl@0: TUint iUCLow; sl@0: TUint iUCHigh; sl@0: TUint iMapLen; sl@0: const TIndicCodeMapping *iCodeMap; sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicDevParameters = { sl@0: 0x48494E20, //KHindiLanguageCode, sl@0: 0x64657661, //KDevanagariScriptCode, sl@0: 0x0900, //KDevLow, sl@0: 0x0970, //KDevHigh, sl@0: sizeof(KDevCodeMap)/sizeof(KDevCodeMap[0]), sl@0: KDevCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicKanParameters = { sl@0: 0x4B414E20, //KKannadaLanguageCode, sl@0: 0x6B6E6461, //KKannadaScriptCode, sl@0: 0x0C80, //KKanLow, sl@0: 0x0CFF, //KKanHigh, sl@0: sizeof(KKanCodeMap)/sizeof(KKanCodeMap[0]), sl@0: KKanCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicGujParameters = { sl@0: 0x47554A20, //KGujaratiLanguageCode, sl@0: 0x67756A72, //KGujaratiScriptCode, sl@0: 0x0A80, //KGujLow, sl@0: 0x0AFF, //KGujHigh, sl@0: sizeof(KGujCodeMap)/sizeof(KGujCodeMap[0]), sl@0: KGujCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicBenParameters = { sl@0: 0x42454E20, //KBengaliLanguageCode, sl@0: 0x62656E67, //KBengaliScriptCode, sl@0: 0x0980, //KBenLow, sl@0: 0x09FF, //KBenHigh, sl@0: sizeof(KBenCodeMap)/sizeof(KBenCodeMap[0]), sl@0: KBenCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicTamParameters = { sl@0: 0x54414D20, //KTamilLanguageCode, sl@0: 0x74616D6C, //KTamilScriptCode, sl@0: 0x0B80, //KTamLow, sl@0: 0x0BFF, //KTamHigh, sl@0: sizeof(KTamCodeMap)/sizeof(KTamCodeMap[0]), sl@0: KTamCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicTelParameters = { sl@0: 0x54454C20, //KTeluguLanguageCode, sl@0: 0x74656C75, //KTeluguScriptCode, sl@0: 0x0C00, //KTelLow, sl@0: 0x0C7F, //KTelHigh, sl@0: sizeof(KTelCodeMap)/sizeof(KTelCodeMap[0]), sl@0: KTelCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicGurParameters = { sl@0: 0x00000000, //KGurmukhiLanguageCode, sl@0: 0x67757275, //KGurmukhiScriptCode, sl@0: 0x0A00, //KGurLow, sl@0: 0x0A7F, //KGurHigh, sl@0: sizeof(KGurCodeMap)/sizeof(KGurCodeMap[0]), sl@0: KGurCodeMap sl@0: }; sl@0: sl@0: static const TIndicScriptProcessorParameters KIndicMalParameters = { sl@0: 0x4D4C5220, //KMalayalamLanguageCode, sl@0: 0x6D6C796D, //KMalayalamScriptCode, sl@0: 0x0D00, //KMalaLow, sl@0: 0x0D7F, //KMalaHigh, sl@0: sizeof(KMalaCodeMap)/sizeof(KMalaCodeMap[0]), sl@0: KMalaCodeMap sl@0: }; sl@0: sl@0: /** This is the default glyph selector class for Devanagari characters in the sl@0: range 0x0900..0x097F. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Devanagari sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: sl@0: /** This is the default glyph selector class for Kannada characters in the sl@0: range 0x0C80..0x0CFF. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Kannada sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: sl@0: /** This is the default glyph selector class for Gujarati characters in the sl@0: range 0x0A80..0x0AFF. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Gujarati sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: /** This is the default glyph selector class for Bengali characters in the sl@0: range 0x0980..0x09FF. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Bengali sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: /** This is the default glyph selector class for Tamil characters in the sl@0: range 0x0B80..0x0BFF. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Tamil sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: /** This is the default glyph selector class for Telugu characters in the sl@0: range 0x0C00..0x0C7F. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Telugu sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: /** This is the default glyph selector class for Gurmukhi characters in the sl@0: range 0x0A00..0x0A7F. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Gurmukhi sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: /** This is the default glyph selector class for Malayalam characters in the sl@0: range 0x0D00..0x0D7F. sl@0: @internalComponent sl@0: */ sl@0: class GlyphSelector_Malayalam sl@0: { sl@0: public: sl@0: static TBool Process(TGlyphSelectionState& aGss, RShapeInfo&); sl@0: }; sl@0: sl@0: #endif