Exemplo n.º 1
0
 public StringPart(LetterData letter, int fromCharacterIndex, int toCharacterIndex, LetterForm letterForm)
 {
     this.letter             = letter;
     this.fromCharacterIndex = fromCharacterIndex;
     this.toCharacterIndex   = toCharacterIndex;
     this.letterForm         = letterForm;
 }
Exemplo n.º 2
0
        public List <WordData> FindEligibleWords(int maxWordLength, LetterData containedLetter, LetterForm form)
        {
            var vocabularyHelper = AppManager.I.VocabularyHelper;
            var eligibleWords    = new List <WordData>();

            var pair = new KeyValuePair <LetterData, LetterForm>(containedLetter, form);

            if (!eligibleWordsForLetters.ContainsKey(pair))
            {
                foreach (var word in vocabularyHelper.GetWordsByCategory(category, parameters.wordFilters))
                {
                    if (!WordIsEligible(word, containedLetter, form, maxWordLength))
                    {
                        continue;
                    }
                    eligibleWords.Add(word);
                    //Debug.Log("Letter: " + containedLetter + " form: " + form + " Word: " + word);
                }
                eligibleWordsForLetters[pair] = eligibleWords;
            }
            eligibleWords = eligibleWordsForLetters[pair];

            //Debug.LogWarning("Eligible words: " + eligibleWords.Count + " out of " + vocabularyHelper.GetWordsByCategory(category, parameters.wordFilters).Count);
            return(eligibleWords);
        }
        public ActionResult Send()
        {
            var cusList        = new List <Customer>();
            var newProduct     = new ProductInformation();
            var letterDataList = new List <LetterData>();

            try
            {
                using (dbEntities db = new dbEntities())
                {
                    // geting list of customers
                    cusList = db.Customers.ToList();
                    // geting new product information
                    newProduct = db.ProductInformations.OrderByDescending(x => x.Id).Take(1).FirstOrDefault();
                }

                // sending letters to all customers
                foreach (var cus in cusList)
                {
                    LetterData      ld          = new LetterData();
                    ReportingEngine engine      = new ReportingEngine();
                    DataSet         dsMailMerge = new DataSet();
                    string          dataDir     = Server.MapPath("~/Document/Template/New Product Introduction Letter.docx");
                    // Loding doc template
                    Document doc = new Document(dataDir);
                    // building dataset
                    ld = new LetterData
                    {
                        ProductDescription = newProduct.ProductDescription,
                        ProductName        = newProduct.ProductName,
                        ReceiverName       = cus.Name,
                        SenderDesignation  = WebUtility.senderDesignation,
                        SenderName         = WebUtility.senderName,
                        SentDate           = DateTime.Now
                    };

                    // Execute the build report.
                    engine.BuildReport(doc, ld, "ld");
                    string uniqueDoc = Server.MapPath("~/Document/Unique/" + cus.Name + ".docx");
                    // Save the document to disk.
                    doc.Save(uniqueDoc);
                    // Sending news letter using smtp
                    if (GeneralFunctions.SendEmail(cus, uniqueDoc, ld.ProductName))
                    {
                        return(View("Success"));
                    }
                    else
                    {
                        return(View("Error"));
                    }
                }
                return(View("About"));
            }
            catch (Exception ex)
            {
                ViewBag.Message = ex.Message;
                return(View("Error"));
            }
        }
Exemplo n.º 4
0
 // @note: this should be the only constructor for LL_LetterData
 public LL_LetterData(LetterData _data)
 {
     Data = _data;
     if (_data.ForcedLetterForm != LetterForm.None)
     {
         Form = _data.ForcedLetterForm;
     }
 }
        public void FlashLetterInWord(LetterData letterToFlash, Color color)
        {
            if (flashLetterInWordCoroutine != null) {
                StopCoroutine(flashLetterInWordCoroutine);
            }

            flashLetterInWordCoroutine = FlashLetterInWordCoroutine(letterToFlash, color);
            StartCoroutine(flashLetterInWordCoroutine);
        }
Exemplo n.º 6
0
    public override void OnScreenOpen(LessonData data)
    {
        base.OnScreenOpen(data);
        lockTouchLetters      = true;
        correctLetterID       = myData.letterID;
        currentLeterData      = alphabetData.GetLetterByID(correctLetterID);
        completedLettersCount = 0;

        StartCoroutine(TutorPartProcess());
    }
Exemplo n.º 7
0
        /// <summary>
        /// default values play Letter Phoneme
        /// </summary>
        /// <returns>The letter AudioClip</returns>
        /// <param name="data">Letter Data</param>
        /// <param name="exclusive">stops other letters?</param>
        /// <param name="soundType">Phoneme or Name?</param>
        public IAudioSource PlayLetter(LetterData data, bool exclusive = true, LetterDataSoundType soundType = LetterDataSoundType.Phoneme)
        {
            if (exclusive)
            {
                StopVocabularyGroup();
            }

            AudioClip clip = GetAudioClip(data, soundType);

            return(new AudioSourceWrapper(vocabularyGroup.Play(clip), vocabularyGroup, this));
        }
    void PrintChar(char displayLetter)
    {
        //  Debug.Log("Printing: " + displayLetter);

        Vector3 nextLocation = new Vector3(0, lineY, 0);

        nextLocation.x = FindNextLocationForLetter();
        letterCount   += 1;

        if (displayLetter != ' ')
        {
            if (letterCount > 1)
            {
                if (previouslyPrintedLetter != ' ')
                {
                    //   Debug.Log("Adding to total line");
                    totalLineLength += Database.Letter.FindLetter(previouslyPrintedLetter).nextPositionOffset; //this should ideally never affect the letter first on a line
                    //  Debug.Log(totalLineLength);
                }
                //it says not space, because then it starts looking for a space in the database of which there is none
                else
                {
                    //   Debug.Log("this is after a space, adding to total line");
                    totalLineLength += 7;
                }
            }
            if (totalLineLength >= 248)
            {
                //   Debug.Log("Time to switch line!");
                switchToNewLine();
            }
            LetterData letterData   = Database.Letter.FindLetter(displayLetter);
            GameObject letterPrefab = Instantiate(letterData.Prefab, nextLocation, Quaternion.identity);
            letterPrefab.transform.SetParent(m_TextArea.transform, false);
            currentlyDisplayedLetters.Add(letterPrefab);
        }
        else
        {
            if (totalLineLength != 248)
            {
                //  Debug.Log("Now taking care of a space");
                totalLineLength += 5;
                if (totalLineLength >= 250)
                {
                    //   Debug.Log("Time to switch line!");
                    switchToNewLine();
                }
                nextLocation.x += 5;
            }
        }
        previouslyPrintedLetter         = displayLetter;
        previouslyPrintedLetterLocation = nextLocation.x; //Adding this ensures that the letters go forward each time
    }
Exemplo n.º 9
0
        public void Init(LetterData letterData)
        {
            var isolatedChar = letterData.GetStringForDisplay(LetterForm.Isolated);
            var InitialChar  = letterData.GetStringForDisplay(LetterForm.Initial);
            var MedialChar   = letterData.GetStringForDisplay(LetterForm.Medial);
            var FinalChar    = letterData.GetStringForDisplay(LetterForm.Final);

            LetterTextIsolated.SetTextUnfiltered(isolatedChar);
            LetterTextInitial.SetTextUnfiltered(InitialChar);
            LetterTextMedial.SetTextUnfiltered(MedialChar);
            LetterTextFinal.SetTextUnfiltered(FinalChar);
        }
Exemplo n.º 10
0
        public AudioClip GetAudioClip(LetterData data, LetterDataSoundType soundType = LetterDataSoundType.Phoneme)
        {
            AudioClip res;
            var       audiofile = data.GetAudioFilename(soundType);

            res = GetCachedResource("AudioArabic/Letters/" + audiofile);

            if (res == null)
            {
                Debug.LogWarning("Warning: cannot find audio clip for letter:" + data + " filename:" + audiofile);
            }
            return(res);
        }
        private List <WordData> FindWordsWithCommonLetter(LetterData commonLetter)
        {
            var eligibleWords    = new List <WordData>();
            var vocabularyHelper = AppManager.I.VocabularyHelper;
            var words            = vocabularyHelper.GetWordsWithLetter(parameters.wordFilters, commonLetter, letterEqualityStrictness);

            foreach (var w in words)
            {
                eligibleWords.Add(w);
            }
            //Debug.Log(eligibleWords.ToDebugStringNewline());
            return(eligibleWords);
        }
Exemplo n.º 12
0
        private List <WordData> FindWordsWithCommonLetter(LetterData commonLetter)
        {
            var vocabularyHelper = AppManager.I.VocabularyHelper;

            // Cache words
            if (lettersToWordCache == null)
            {
                lettersToWordCache =
                    new Dictionary <LetterData, List <WordData> >(new StrictLetterDataComparer(LetterEqualityStrictness.WithVisualForm));
            }
            if (!lettersToWordCache.ContainsKey(commonLetter))
            {
                //Debug.Log("Creating cache for " + commonLetter);
                lettersToWordCache[commonLetter] = vocabularyHelper.GetWordsWithLetter(parameters.wordFilters, commonLetter, parameters.letterEqualityStrictness);
            }

            allWordsCache.Clear();
            allWordsCache.AddRange(lettersToWordCache[commonLetter]);

            badLettersCache.Clear();
            badLettersCache.AddRange(currentRound_letters);
            badLettersCache.Remove(commonLetter);

            badWordsCache.Clear();
            badWordsCache.AddRange(currentRound_words);

            eligibleWordsCache.Clear();
            foreach (var w in allWordsCache)
            {
                // Not words that appeared already this round
                if (badWordsCache.Contains(w))
                {
                    continue;
                }

                // Not words that have one of the previous letters (but the current one)
                if (vocabularyHelper.WordContainsAnyLetter(w, badLettersCache))
                {
                    continue;
                }

                eligibleWordsCache.Add(w);
            }

            //Debug.LogWarning(allWordsCache.ToDebugStringNewline());
            //Debug.LogWarning(eligibleWordsCache.ToDebugStringNewline());
            return(eligibleWordsCache);
        }
        private bool WordContainsLetter(WordData word, LetterData letter, int maxWordLength, LetterEqualityStrictness strictness)
        {
            // Check max length
            if (word.Letters.Length > maxWordLength)
            {
                return(false);
            }

            // Check that it contains the letter at least once
            if (AppManager.I.VocabularyHelper.WordContainsLetterTimes(word, letter, strictness) >= 1)
            {
                //Debug.Log("Letter " + letter + " is in word " + word + " " + AppManager.I.VocabularyHelper.WordContainsLetterTimes(word, letter, LetterEqualityStrictness.WithActualForm) + " times");
                return(true);
            }

            return(false);
        }
Exemplo n.º 14
0
        //        private UIButton uIButton;

        public void Init(LetterData _letterData)
        {
            myLetterData = _letterData;
            //            uIButton = GetComponent<UIButton>();

            if (myLetterData == null)
            {
                LetterText.SetTextUnfiltered("");
                SubtitleText.SetText("");
            }
            else
            {
                var isolatedChar = myLetterData.GetStringForDisplay(LetterForm.Isolated);
                LetterText.SetTextUnfiltered(isolatedChar);
                SubtitleText.SetText(myLetterData.Id);
            }
        }
Exemplo n.º 15
0
        private QuestionPackData CreateSingleQuestionPackData(LetterData letter, LetterForm correctForm)
        {
            var teacher = AppManager.I.Teacher;

            // Find a word with the letter in that form
            var usableWords = teacher.VocabularyAi.SelectData(
                () => FindEligibleWords(maximumWordLength, letter, correctForm),
                new SelectionParameters(parameters.correctSeverity, 1, useJourney: parameters.useJourneyForCorrect,
                                        packListHistory: parameters.correctChoicesHistory, filteringIds: previousPacksIDs_words)
                );
            var question = usableWords[0];

            // Place the correct letter and form
            var correctAnswers = new List <LetterData>();
            var letterWithForm = AppManager.I.VocabularyHelper.ConvertToLetterWithForcedForm(letter, correctForm);

            correctAnswers.Add(letterWithForm);

            // Place the other forms as wrong forms
            var wrongAnswers = new List <LetterData>();

            foreach (var wrongForm in letter.GetAvailableForms())
            {
                if (wrongForm == correctForm)
                {
                    continue;
                }
                letterWithForm = AppManager.I.VocabularyHelper.ConvertToLetterWithForcedForm(letter, wrongForm);
                wrongAnswers.Add(letterWithForm);
            }

            if (ConfigAI.VerboseQuestionPacks)
            {
                string debugString = "--------- TEACHER: question pack result ---------";
                debugString += "\nQuestion: " + question;
                debugString += "\nCorrect Answers: " + correctAnswers.Count;
                foreach (var l in correctAnswers)
                {
                    debugString += " " + l;
                }
                ConfigAI.AppendToTeacherReport(debugString);
            }

            return(QuestionPackData.Create(question, correctAnswers, wrongAnswers));
        }
Exemplo n.º 16
0
        public void Init(LetterData letterData)
        {
            currentLetter = letterData;
            var isolatedChar = letterData.GetStringForDisplay(LetterForm.Isolated);
            var InitialChar  = letterData.GetStringForDisplay(LetterForm.Initial);
            var MedialChar   = letterData.GetStringForDisplay(LetterForm.Medial);
            var FinalChar    = letterData.GetStringForDisplay(LetterForm.Final);

            if (Book.Book.I.TestShaddah)
            {
                isolatedChar = ReplaceWithShaddah(isolatedChar);
                InitialChar  = ReplaceWithShaddah(InitialChar);
                MedialChar   = ReplaceWithShaddah(MedialChar);
                FinalChar    = ReplaceWithShaddah(FinalChar);
            }

            if (AppManager.I.ParentEdition.BookShowRelatedWords)
            {
                LetterTextIsolated.gameObject.GetComponent <RectTransform>().offsetMin = new Vector2(0, 0);
                LetterTextInitial.gameObject.SetActive(false);
                LetterTextMedial.gameObject.SetActive(false);
                LetterTextFinal.gameObject.SetActive(false);
            }
            else
            {
                LetterTextIsolated.gameObject.GetComponent <RectTransform>().offsetMin = new Vector2(0, 130);
                LetterTextInitial.gameObject.SetActive(true);
                LetterTextMedial.gameObject.SetActive(true);
                LetterTextFinal.gameObject.SetActive(true);
            }

            LetterTextIsolated.SetTextUnfiltered(isolatedChar);
            LetterTextInitial.SetTextUnfiltered(InitialChar);
            LetterTextMedial.SetTextUnfiltered(MedialChar);
            LetterTextFinal.SetTextUnfiltered(FinalChar);

            if (Book.Book.I.EditDiacritics)
            {
                IsolatedSubtitle.gameObject.SetActive(true);
                IsolatedSubtitle.text = ($"<color=black>{letterData.GetUnicode(LetterForm.Isolated)}</color>");
                InitialSubtitle.text  = ($"<color=black>{letterData.GetUnicode(LetterForm.Initial)}</color>");
                MedialSubtitle.text   = ($"<color=black>{letterData.GetUnicode(LetterForm.Medial)}</color>");
                FinalSubtitle.text    = ($"<color=black>{letterData.GetUnicode(LetterForm.Final)}</color>");
            }
        }
Exemplo n.º 17
0
        public void DetailLetter(LetterInfo letterInfo)
        {
            DetailPanel.SetActive(true);
            myLetterInfo = letterInfo;
            myLetterData = letterInfo.data;
            //string debug_output = "//////// LETTER " + myLetterData.Number + " " + myLetterData.Id + "\n";
            HighlightLetterItem(myLetterInfo.data.Id);

            emptyContainer(DiacriticsContainer);

            var letterbase        = myLetterInfo.data.Id;
            var variationsletters = AppManager.I.DB.FindLetterData(
                (x) => (x.BaseLetter == letterbase && (x.Kind == LetterDataKind.DiacriticCombo && x.Active))
                );

            // diacritics box
            var letterGO = Instantiate(DiacriticSymbolItemPrefab);

            letterGO.transform.SetParent(DiacriticsContainer.transform, false);
            letterGO.GetComponent <ItemDiacriticSymbol>().Init(this, myLetterInfo, true);

            List <LetterInfo> info_list = AppManager.I.ScoreHelper.GetAllLetterInfo();

            info_list.Sort((x, y) => x.data.Id.CompareTo(y.data.Id));
            foreach (var info_item in info_list)
            {
                if (variationsletters.Contains(info_item.data))
                {
                    if (AppConfig.DisableShaddah && info_item.data.Symbol == "shaddah")
                    {
                        continue;
                    }
                    btnGO = Instantiate(DiacriticSymbolItemPrefab);
                    btnGO.transform.SetParent(DiacriticsContainer.transform, false);
                    btnGO.GetComponent <ItemDiacriticSymbol>().Init(this, info_item, false);
                    //debug_output += info_item.data.GetDebugDiacriticFix();
                }
            }
            //Debug.Log(debug_output);
            ShowLetter(myLetterInfo);
        }
Exemplo n.º 18
0
        private void ShowLetter(LetterInfo letterInfo)
        {
            myLetterInfo = letterInfo;
            myLetterData = letterInfo.data;

            // Debug.Log("ShowLetter " + myLetterData.Id);

            string positionsString = "";

            foreach (var p in letterInfo.data.GetAvailableForms())
            {
                positionsString = positionsString + " " + p;
            }
            MainLetterDisplay.Init(myLetterData);
            //LetterScoreText.text = "Score: " + myLetterInfo.score;

            HighlightDiacriticItem(myLetterData.Id);
            playSound();

            // Debug.Log(myLetterData.GetDebugDiacriticFix());
        }
        private List <WordData> FindWordsWithLetterStrict(LetterData containedLetter, int maxWordLength)
        {
            var vocabularyHelper = AppManager.I.VocabularyHelper;
            var eligibleWords    = new List <WordData>();

            if (!eligibleWordsForLetters.ContainsKey(containedLetter))
            {
                foreach (var word in vocabularyHelper.GetWordsByCategory(category, parameters.wordFilters))
                {
                    if (!WordContainsLetter(word, containedLetter, maxWordLength, LetterEqualityStrictness.LetterOnly))
                    {
                        continue;
                    }
                    eligibleWords.Add(word);
                    //Debug.Log("Letter: " + containedLetter + " in Word: " + word);
                }
                eligibleWordsForLetters[containedLetter] = eligibleWords;
            }
            eligibleWords = eligibleWordsForLetters[containedLetter];

            //Debug.LogWarning("Eligible words: " + eligibleWords.Count + " out of " + vocabularyHelper.GetWordsByCategory(category, parameters.wordFilters).Count);
            return(eligibleWords);
        }
Exemplo n.º 20
0
        private bool WordIsEligible(WordData word, LetterData containedLetter, LetterForm form, int maxWordLength)
        {
            // Check max length
            if (word.Letters.Length > maxWordLength)
            {
                return(false);
            }

            // Check that it contains the letter only once
            if (AppManager.I.VocabularyHelper.WordContainsLetterTimes(word, containedLetter) > 1)
            {
                return(false);
            }

            // Check that it contains a letter in the correct form
            var letterWithForm = AppManager.I.VocabularyHelper.ConvertToLetterWithForcedForm(containedLetter, form);

            if (!AppManager.I.VocabularyHelper.WordContainsLetter(word, letterWithForm, LetterEqualityStrictness.WithActualForm))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 21
0
        private void ShowLetter(LetterInfo letterInfo, LetterDataSoundType soundType = LetterDataSoundType.Name)
        {
            myLetterInfo = letterInfo;
            myLetterData = letterInfo.data;

            if (ApplicationConfig.I.VerboseBook)
            {
                Debug.Log("[ShowLetter]" + myLetterData.Number + " " + myLetterData.Id);
            }

            string positionsString = "";

            foreach (var p in letterInfo.data.GetAvailableForms())
            {
                positionsString = positionsString + " " + p;
            }
            MainLetterDisplay.Init(myLetterData);
            //LetterScoreText.text = "Score: " + myLetterInfo.score;

            HighlightDiacriticItem(myLetterData.Id);
            playSound(soundType);

            // Debug.Log(myLetterData.GetDebugDiacriticFix());
        }
Exemplo n.º 22
0
        /// <summary>
        /// Creates the data for the specified row.
        /// </summary>
        /// <param name="Row">The row.</param>
        internal Data Create(Row Row)
        {
            Data Data;

            switch (this.Index)
            {
            case 0:
            {
                Data = new BuildingData(Row, this);
                break;
            }

            case 1:
            {
                Data = new LocaleData(Row, this);
                break;
            }

            case 2:
            {
                Data = new ResourceData(Row, this);
                break;
            }

            case 3:
            {
                Data = new CharacterData(Row, this);
                break;
            }

            case 6:
            {
                Data = new BuildingClassData(Row, this);
                break;
            }

            case 7:
            {
                Data = new ObstacleData(Row, this);
                break;
            }

            case 8:
            {
                Data = new EffectData(Row, this);
                break;
            }

            case 9:
            {
                Data = new ParticleEmitterData(Row, this);
                break;
            }

            case 10:
            {
                Data = new ExperienceLevelData(Row, this);
                break;
            }

            case 11:
            {
                Data = new TrapData(Row, this);
                break;
            }

            case 12:
            {
                Data = new AllianceBadgeData(Row, this);
                break;
            }

            case 13:
            {
                Data = new GlobalData(Row, this);
                break;
            }

            case 14:
            {
                Data = new TownhallLevelData(Row, this);
                break;
            }

            case 15:
            {
                Data = new PrototypeData(Row, this);
                break;
            }

            case 16:
            {
                Data = new NpcData(Row, this);
                break;
            }

            case 17:
            {
                Data = new DecoData(Row, this);
                break;
            }

            case 18:
            {
                Data = new ResourcePackData(Row, this);
                break;
            }

            case 20:
            {
                Data = new MissionData(Row, this);
                break;
            }

            case 21:
            {
                Data = new BillingPackageData(Row, this);
                break;
            }

            case 22:
            {
                Data = new AchievementData(Row, this);
                break;
            }

            case 25:
            {
                Data = new SpellData(Row, this);
                break;
            }

            case 26:
            {
                Data = new HintData(Row, this);
                break;
            }

            case 27:
            {
                Data = new LandingShipData(Row, this);
                break;
            }

            case 28:
            {
                Data = new ArtifactData(Row, this);
                break;
            }

            case 29:
            {
                Data = new ArtifactBonusData(Row, this);
                break;
            }

            case 30:
            {
                Data = new DeepseaParameterData(Row, this);
                break;
            }

            case 31:
            {
                Data = new ExplorationCostData(Row, this);
                break;
            }

            case 34:
            {
                Data = new ResourceShipData(Row, this);
                break;
            }

            case 35:
            {
                Data = new LootBoxData(Row, this);
                break;
            }

            case 36:
            {
                Data = new LiberatedIncomeData(Row, this);
                break;
            }

            case 37:
            {
                Data = new RegionData(Row, this);
                break;
            }

            case 38:
            {
                Data = new DefenseRewardData(Row, this);
                break;
            }

            case 39:
            {
                Data = new LocatorData(Row, this);
                break;
            }

            case 40:
            {
                Data = new EventData(Row, this);
                break;
            }

            case 41:
            {
                Data = new FootstepData(Row, this);
                break;
            }

            case 42:
            {
                Data = new PersistentEventRewardData(Row, this);
                break;
            }

            case 43:
            {
                Data = new CommunityLinkData(Row, this);
                break;
            }

            case 44:
            {
                Data = new ShieldData(Row, this);
                break;
            }

            case 45:
            {
                Data = new AbTestData(Row, this);
                break;
            }

            case 46:
            {
                Data = new LetterData(Row, this);
                break;
            }

            case 47:
            {
                Data = new RankData(Row, this);
                break;
            }

            case 48:
            {
                Data = new CountryData(Row, this);
                break;
            }

            case 51:
            {
                Data = new BoomboxData(Row, this);
                break;
            }

            case 52:
            {
                Data = new HeroData(Row, this);
                break;
            }

            case 53:
            {
                Data = new HeroAbilityData(Row, this);
                break;
            }

            case 54:
            {
                Data = new OfferData(Row, this);
                break;
            }

            case 55:
            {
                Data = new DeepLinkData(Row, this);
                break;
            }

            case 56:
            {
                Data = new SectorData(Row, this);
                break;
            }

            case 57:
            {
                Data = new SectorBonusData(Row, this);
                break;
            }

            default:
            {
                Data = new Data(Row, this);
                break;
            }
            }

            return(Data);
        }
Exemplo n.º 23
0
 static void initLetters()
 {
     if (letters != null)
     {
         return;
     }
     letters           = new Dictionary <char, LetterData>();
     letters[' ']      = new LetterData(new float[] {}, new int[] {});
     letters['!']      = new LetterData(new float[] { 0.4f, 0.2f, 0.5f, 0.3f, 0.6f, 0.2f, 0.5f, 0.1f, 0.4f, 1.8f, 0.5f, 1.9f, 0.6f, 1.8f, 0.5f, 0.5f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4 });
     letters['"']      = new LetterData(new float[] { 0.3f, 1.7f, 0.4f, 1.8f, 0.5f, 1.7f, 0.3f, 1.5f, 0.5f, 1.7f, 0.6f, 1.8f, 0.7f, 1.7f, 0.5f, 1.5f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4 });
     letters['#']      = new LetterData(new float[] { 0.4f, 0.5f, 0.4f, 1.4f, 0.2f, 1.0f, 0.8f, 1.3f, 0.6f, 1.5f, 0.6f, 0.6f, 0.2f, 0.7f, 0.8f, 1.0f }, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
     letters['%']      = new LetterData(new float[] { 0.2f, 1.6f, 0.3f, 1.7f, 0.4f, 1.6f, 0.3f, 1.5f, 0.8f, 1.7f, 0.2f, 0.3f, 0.6f, 0.4f, 0.7f, 0.5f, 0.8f, 0.4f, 0.7f, 0.3f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 6, 7, 7, 8, 8, 9, 9, 6 });
     letters['\'']     = new LetterData(new float[] { 0.4f, 1.7f, 0.5f, 1.8f, 0.6f, 1.7f, 0.4f, 1.5f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0 });
     letters['(']      = new LetterData(new float[] { 0.4f, 0.3f, 0.4f, 1.7f, 0.6f, 1.9f, 0.6f, 0.1f }, new int[] { 0, 1, 1, 2, 3, 0 });
     letters[')']      = new LetterData(new float[] { 0.4f, 1.9f, 0.6f, 1.7f, 0.6f, 0.3f, 0.4f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3 });
     letters['*']      = new LetterData(new float[] { 0.6f, 0.8f, 0.4f, 1.2f, 0.6f, 1.2f, 0.4f, 0.8f, 0.7f, 1.0f, 0.3f, 1.0f }, new int[] { 0, 1, 2, 3, 4, 5 });
     letters['+']      = new LetterData(new float[] { 0.2f, 1.0f, 0.8f, 1.0f, 0.5f, 1.3f, 0.5f, 0.7f }, new int[] { 0, 1, 2, 3 });
     letters[',']      = new LetterData(new float[] { 0.4f, 0.2f, 0.5f, 0.3f, 0.6f, 0.2f, 0.4f, 0.0f }, new int[] { 0, 1, 1, 2, 3, 0, 3, 2 });
     letters['-']      = new LetterData(new float[] { 0.8f, 1.0f, 0.2f, 1.0f }, new int[] { 0, 1 });
     letters['.']      = new LetterData(new float[] { 0.4f, 0.2f, 0.5f, 0.3f, 0.6f, 0.2f, 0.5f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0 });
     letters['/']      = new LetterData(new float[] { 0.9f, 1.9f, 0.1f, 0.1f }, new int[] { 0, 1 });
     letters['0']      = new LetterData(new float[] { 0.1f, 1.9f, 0.9f, 1.9f, 0.1f, 0.1f, 0.9f, 0.1f, 0.1f, 0.1f, 0.9f, 1.9f }, new int[] { 0, 1, 2, 0, 1, 3, 3, 2, 4, 5 });
     letters['1']      = new LetterData(new float[] { 0.9f, 1.9f, 0.9f, 0.1f }, new int[] { 0, 1 });
     letters['2']      = new LetterData(new float[] { 0.1f, 1.9f, 0.9f, 1.9f, 0.1f, 0.1f, 0.9f, 0.1f, 0.9f, 1.0f, 0.1f, 1.0f }, new int[] { 0, 1, 2, 3, 1, 4, 4, 5, 2, 5 });
     letters['3']      = new LetterData(new float[] { 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 0.1f, 0.1f, 0.1f, 0.1f, 1.0f, 0.9f, 1.0f }, new int[] { 0, 1, 1, 2, 2, 3, 4, 5 });
     letters['4']      = new LetterData(new float[] { 0.1f, 1.9f, 0.1f, 1.0f, 0.9f, 1.9f, 0.9f, 0.1f, 0.9f, 1.0f }, new int[] { 0, 1, 2, 3, 1, 4 });
     letters['5']      = new LetterData(new float[] { 0.1f, 1.0f, 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 1.0f, 0.9f, 0.1f, 0.1f, 0.1f }, new int[] { 0, 1, 1, 2, 3, 0, 3, 4, 4, 5 });
     letters['6']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 1.0f, 0.9f, 0.1f, 0.1f, 1.0f }, new int[] { 0, 1, 1, 2, 3, 4, 4, 0, 5, 3 });
     letters['7']      = new LetterData(new float[] { 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 0.1f }, new int[] { 0, 1, 1, 2 });
     letters['8']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 0.1f, 0.1f, 1.0f, 0.9f, 1.0f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5 });
     letters['9']      = new LetterData(new float[] { 0.1f, 1.0f, 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 0.1f, 0.9f, 1.0f, 0.1f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3, 4, 0, 3, 5 });
     letters[':']      = new LetterData(new float[] { 0.4f, 1.4f, 0.5f, 1.5f, 0.6f, 1.4f, 0.5f, 1.3f, 0.4f, 0.2f, 0.5f, 0.3f, 0.6f, 0.2f, 0.5f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4 });
     letters[';']      = new LetterData(new float[] { 0.4f, 1.4f, 0.5f, 1.5f, 0.6f, 1.4f, 0.5f, 1.3f, 0.4f, 0.2f, 0.5f, 0.3f, 0.6f, 0.2f, 0.4f, 0.0f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4 });
     letters['<']      = new LetterData(new float[] { 0.8f, 0.7f, 0.2f, 1.0f, 0.8f, 1.3f }, new int[] { 0, 1, 1, 2 });
     letters['=']      = new LetterData(new float[] { 0.2f, 1.2f, 0.8f, 1.2f, 0.2f, 0.8f, 0.8f, 0.8f }, new int[] { 0, 1, 2, 3 });
     letters['>']      = new LetterData(new float[] { 0.2f, 1.3f, 0.8f, 1.0f, 0.2f, 0.7f }, new int[] { 0, 1, 1, 2 });
     letters['?']      = new LetterData(new float[] { 0.4f, 0.2f, 0.5f, 0.3f, 0.6f, 0.2f, 0.5f, 0.1f, 0.5f, 0.5f, 0.5f, 0.8f, 0.9f, 1.2f, 0.9f, 1.7f, 0.7f, 1.9f, 0.3f, 1.9f, 0.1f, 1.7f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10 });
     letters['@']      = new LetterData(new float[] { 0.1f, 1.7f, 0.3f, 1.9f, 0.7f, 1.9f, 0.1f, 0.3f, 0.9f, 1.7f, 0.3f, 0.1f, 0.7f, 0.1f, 0.9f, 0.3f, 0.9f, 1.0f, 0.7f, 0.8f, 0.5f, 0.8f, 0.3f, 1.0f, 0.3f, 1.2f, 0.5f, 1.4f }, new int[] { 0, 1, 1, 2, 3, 0, 2, 4, 5, 3, 6, 5, 7, 6, 4, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13 });
     letters['A']      = new LetterData(new float[] { 0.1f, 0.1f, 0.5f, 1.9f, 0.9f, 0.1f, 0.3f, 1.0f, 0.7f, 1.0f }, new int[] { 0, 1, 1, 2, 3, 4 });
     letters['B']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.7f, 1.9f, 0.9f, 0.3f, 0.7f, 0.1f, 0.9f, 0.8f, 0.7f, 1.0f, 0.1f, 1.0f, 0.9f, 1.7f, 0.9f, 1.2f }, new int[] { 0, 1, 1, 2, 3, 4, 4, 0, 5, 3, 6, 5, 7, 6, 2, 8, 8, 9, 6, 9 });
     letters['C']      = new LetterData(new float[] { 0.1f, 0.3f, 0.1f, 1.7f, 0.3f, 1.9f, 0.7f, 0.1f, 0.3f, 0.1f, 0.9f, 0.3f, 0.7f, 1.9f, 0.9f, 1.7f }, new int[] { 0, 1, 1, 2, 3, 4, 4, 0, 5, 3, 2, 6, 6, 7 });
     letters['D']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.7f, 1.9f, 0.9f, 1.7f, 0.9f, 0.3f, 0.7f, 0.1f }, new int[] { 0, 1, 1, 2, 3, 4, 2, 3, 4, 5, 0, 5 });
     letters['E']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f, 0.6f, 1.0f, 0.1f, 1.0f, 0.9f, 0.1f }, new int[] { 0, 1, 1, 2, 3, 4, 5, 0 });
     letters['F']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f, 0.6f, 1.0f, 0.1f, 1.0f }, new int[] { 0, 1, 1, 2, 3, 4 });
     letters['G']      = new LetterData(new float[] { 0.1f, 0.3f, 0.1f, 1.7f, 0.3f, 1.9f, 0.7f, 1.9f, 0.9f, 1.7f, 0.3f, 0.1f, 0.7f, 0.1f, 0.9f, 0.3f, 0.9f, 0.6f, 0.7f, 0.6f }, new int[] { 0, 1, 1, 2, 3, 4, 2, 3, 5, 0, 6, 5, 7, 6, 8, 7, 9, 8 });
     letters['H']      = new LetterData(new float[] { 0.1f, 1.0f, 0.9f, 1.0f, 0.9f, 1.9f, 0.9f, 0.1f, 0.1f, 1.9f, 0.1f, 0.1f }, new int[] { 0, 1, 2, 3, 4, 5 });
     letters['I']      = new LetterData(new float[] { 0.3f, 0.1f, 0.7f, 0.1f, 0.5f, 1.9f, 0.5f, 0.1f, 0.3f, 1.9f, 0.7f, 1.9f }, new int[] { 0, 1, 2, 3, 4, 5 });
     letters['J']      = new LetterData(new float[] { 0.5f, 0.1f, 0.3f, 0.3f, 0.3f, 1.9f, 0.7f, 1.9f, 0.7f, 1.9f, 0.7f, 0.3f }, new int[] { 0, 1, 2, 3, 4, 5, 5, 0 });
     letters['K']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.1f, 1.0f, 0.9f, 1.9f, 0.9f, 0.1f }, new int[] { 0, 1, 2, 3, 4, 2 });
     letters['L']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 0.1f }, new int[] { 0, 1, 2, 0 });
     letters['M']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.5f, 1.0f, 0.9f, 1.9f, 0.9f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 4 });
     letters['N']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 0.1f, 0.9f, 1.9f }, new int[] { 0, 1, 2, 3, 1, 2 });
     letters['O']      = new LetterData(new float[] { 0.1f, 0.3f, 0.1f, 1.7f, 0.7f, 1.9f, 0.9f, 1.7f, 0.3f, 1.9f, 0.9f, 0.3f, 0.7f, 0.1f, 0.3f, 0.1f }, new int[] { 0, 1, 2, 3, 4, 2, 1, 4, 3, 5, 5, 6, 7, 0, 6, 7 });
     letters['P']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.7f, 1.9f, 0.9f, 1.7f, 0.9f, 1.2f, 0.7f, 1.0f, 0.1f, 1.0f }, new int[] { 0, 1, 1, 2, 3, 4, 2, 3, 4, 5, 5, 6 });
     letters['Q']      = new LetterData(new float[] { 0.1f, 0.3f, 0.1f, 1.7f, 0.3f, 1.9f, 0.7f, 1.9f, 0.9f, 1.7f, 0.9f, 0.4f, 0.3f, 0.1f, 0.6f, 0.1f, 0.6f, 0.4f, 0.9f, 0.1f }, new int[] { 0, 1, 1, 2, 3, 4, 2, 3, 4, 5, 6, 0, 7, 6, 5, 7, 8, 9 });
     letters['R']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.7f, 1.9f, 0.9f, 1.7f, 0.9f, 1.2f, 0.7f, 1.0f, 0.9f, 0.1f, 0.5f, 1.0f, 0.1f, 1.0f }, new int[] { 0, 1, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 5, 8 });
     letters['S']      = new LetterData(new float[] { 0.1f, 1.2f, 0.1f, 1.7f, 0.3f, 1.9f, 0.7f, 1.9f, 0.9f, 1.7f, 0.3f, 1.0f, 0.7f, 1.0f, 0.9f, 0.8f, 0.9f, 0.3f, 0.7f, 0.1f, 0.3f, 0.1f, 0.1f, 0.3f }, new int[] { 0, 1, 1, 2, 3, 4, 2, 3, 5, 0, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10 });
     letters['T']      = new LetterData(new float[] { 0.1f, 1.9f, 0.9f, 1.9f, 0.5f, 1.9f, 0.5f, 0.1f }, new int[] { 0, 1, 2, 3 });
     letters['U']      = new LetterData(new float[] { 0.1f, 0.3f, 0.1f, 1.9f, 0.9f, 0.3f, 0.7f, 0.1f, 0.3f, 0.1f, 0.9f, 1.9f }, new int[] { 0, 1, 2, 3, 3, 4, 4, 0, 5, 2 });
     letters['V']      = new LetterData(new float[] { 0.5f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f }, new int[] { 0, 1, 2, 0 });
     letters['W']      = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 0.1f, 0.5f, 0.6f }, new int[] { 0, 1, 2, 3, 3, 4, 4, 0 });
     letters['X']      = new LetterData(new float[] { 0.9f, 0.1f, 0.1f, 1.9f, 0.1f, 0.1f, 0.9f, 1.9f }, new int[] { 0, 1, 2, 3 });
     letters['Y']      = new LetterData(new float[] { 0.5f, 1.0f, 0.1f, 1.9f, 0.5f, 0.1f, 0.9f, 1.9f }, new int[] { 0, 1, 0, 2, 3, 0 });
     letters['Z']      = new LetterData(new float[] { 0.9f, 1.9f, 0.1f, 1.9f, 0.9f, 0.1f, 0.1f, 0.1f }, new int[] { 0, 1, 2, 3, 3, 0 });
     letters['[']      = new LetterData(new float[] { 0.4f, 0.1f, 0.4f, 1.9f, 0.6f, 1.9f, 0.6f, 0.1f }, new int[] { 0, 1, 1, 2, 3, 0 });
     letters['\\']     = new LetterData(new float[] { 0.9f, 0.1f, 0.1f, 1.9f }, new int[] { 0, 1 });
     letters['\x007f'] = new LetterData(new float[] { 0.1f, 0.1f, 0.1f, 1.9f, 0.9f, 1.9f, 0.9f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 1, 3, 2, 0 });
     letters[']']      = new LetterData(new float[] { 0.4f, 1.9f, 0.6f, 1.9f, 0.6f, 0.1f, 0.4f, 0.1f }, new int[] { 0, 1, 1, 2, 2, 3 });
     letters['^']      = new LetterData(new float[] { 0.3f, 1.7f, 0.5f, 1.9f, 0.7f, 1.7f }, new int[] { 0, 1, 1, 2 });
     letters['_']      = new LetterData(new float[] { 0.9f, 0.1f, 0.1f, 0.1f }, new int[] { 0, 1 });
     letters['`']      = new LetterData(new float[] { 0.6f, 1.5f, 0.4f, 1.7f, 0.5f, 1.8f, 0.6f, 1.7f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0 });
     letters['a']      = new LetterData(new float[] { 0.8f, 0.3f, 0.6f, 0.1f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 1.0f, 0.8f, 0.8f, 0.9f, 0.1f, 0.4f, 0.1f, 0.2f, 0.3f, 0.2f, 0.5f, 0.4f, 0.7f, 0.6f, 0.7f, 0.8f, 0.5f }, new int[] { 0, 1, 2, 3, 4, 5, 3, 4, 5, 0, 0, 6, 1, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12 });
     letters['b']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.4f, 0.8f, 0.3f, 0.8f, 0.7f, 0.6f, 0.1f, 0.4f, 0.1f, 0.6f, 0.9f, 0.4f, 0.9f, 0.2f, 0.7f, 0.2f, 0.3f }, new int[] { 0, 1, 2, 3, 4, 2, 5, 4, 3, 6, 6, 7, 7, 8, 9, 5 });
     letters['c']      = new LetterData(new float[] { 0.2f, 0.3f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 1.0f, 0.4f, 0.1f, 0.8f, 0.8f, 0.6f, 0.1f, 0.8f, 0.3f }, new int[] { 0, 1, 2, 3, 1, 2, 4, 0, 3, 5, 6, 4, 7, 6 });
     letters['d']      = new LetterData(new float[] { 0.2f, 0.3f, 0.2f, 0.7f, 0.4f, 0.9f, 0.6f, 0.1f, 0.4f, 0.1f, 0.6f, 0.9f, 0.8f, 0.7f, 0.8f, 0.3f, 0.8f, 0.1f, 0.8f, 1.4f }, new int[] { 0, 1, 1, 2, 3, 4, 4, 0, 2, 5, 5, 6, 7, 3, 8, 9 });
     letters['e']      = new LetterData(new float[] { 0.4f, 0.1f, 0.2f, 0.3f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 1.0f, 0.6f, 0.1f, 0.8f, 0.3f, 0.8f, 0.8f, 0.8f, 0.6f, 0.2f, 0.6f }, new int[] { 0, 1, 2, 3, 3, 4, 1, 2, 5, 0, 6, 5, 4, 7, 7, 8, 8, 9 });
     letters['f']      = new LetterData(new float[] { 0.9f, 1.2f, 0.7f, 1.4f, 0.3f, 1.0f, 0.7f, 1.0f, 0.5f, 1.2f, 0.5f, 0.1f }, new int[] { 0, 1, 2, 3, 4, 5, 1, 4 });
     letters['g']      = new LetterData(new float[] { 0.4f, -0.1f, 0.2f, 0.1f, 0.6f, -0.1f, 0.8f, 1.0f, 0.8f, 0.1f, 0.6f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.2f, 0.8f, 0.2f, 0.4f, 0.4f, 0.2f, 0.6f, 0.2f, 0.8f, 0.4f }, new int[] { 0, 1, 2, 0, 3, 4, 4, 2, 5, 6, 7, 5, 8, 7, 9, 8, 10, 9, 11, 10, 12, 11 });
     letters['h']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.4f, 0.6f, 1.0f, 0.8f, 0.8f, 0.4f, 1.0f, 0.2f, 0.8f, 0.8f, 0.1f }, new int[] { 0, 1, 2, 3, 4, 2, 5, 4, 3, 6 });
     letters['i']      = new LetterData(new float[] { 0.5f, 0.1f, 0.5f, 1.0f, 0.5f, 1.3f, 0.6f, 1.2f, 0.4f, 1.2f, 0.5f, 1.1f }, new int[] { 0, 1, 2, 3, 4, 2, 5, 4, 3, 5 });
     letters['j']      = new LetterData(new float[] { 0.6f, 1.2f, 0.7f, 1.3f, 0.8f, 1.2f, 0.7f, 1.1f, 0.7f, 1.0f, 0.7f, 0.3f, 0.5f, 0.1f, 0.3f, 0.3f }, new int[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7 });
     letters['k']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.4f, 0.2f, 0.6f, 0.8f, 0.1f, 0.8f, 1.0f }, new int[] { 0, 1, 2, 3, 4, 2 });
     letters['l']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.4f }, new int[] { 0, 1 });
     letters['m']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.0f, 0.8f, 0.8f, 0.6f, 1.0f, 0.8f, 0.1f, 0.5f, 0.9f, 0.5f, 0.1f, 0.4f, 1.0f, 0.2f, 0.8f }, new int[] { 0, 1, 2, 3, 4, 2, 5, 6, 7, 8, 5, 3, 7, 5 });
     letters['n']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.0f, 0.6f, 1.0f, 0.4f, 1.0f, 0.8f, 0.8f, 0.8f, 0.1f, 0.2f, 0.8f }, new int[] { 0, 1, 2, 3, 4, 2, 5, 4, 3, 6 });
     letters['o']      = new LetterData(new float[] { 0.2f, 0.3f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 0.1f, 0.4f, 0.1f, 0.8f, 0.3f, 0.8f, 0.8f, 0.6f, 1.0f }, new int[] { 0, 1, 1, 2, 3, 4, 4, 0, 5, 3, 6, 5, 7, 6, 2, 7 });
     letters['p']      = new LetterData(new float[] { 0.2f, 1.0f, 0.2f, 0.1f, 0.4f, 1.0f, 0.6f, 1.0f, 0.2f, 0.8f, 0.4f, 0.2f, 0.2f, 0.4f, 0.8f, 0.8f, 0.8f, 0.4f, 0.6f, 0.2f }, new int[] { 0, 1, 2, 3, 4, 2, 5, 6, 3, 7, 7, 8, 8, 9, 5, 9 });
     letters['q']      = new LetterData(new float[] { 0.2f, 0.3f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 0.1f, 0.4f, 0.1f, 0.8f, 0.3f, 0.6f, 1.0f, 0.8f, 0.8f, 0.8f, 1.0f, 0.8f, -0.1f }, new int[] { 0, 1, 1, 2, 3, 4, 4, 0, 5, 3, 2, 6, 6, 7, 8, 9 });
     letters['r']      = new LetterData(new float[] { 0.2f, 0.1f, 0.2f, 1.0f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 1.0f, 0.8f, 0.8f }, new int[] { 0, 1, 2, 3, 4, 5, 3, 4 });
     letters['s']      = new LetterData(new float[] { 0.2f, 0.7f, 0.2f, 0.8f, 0.4f, 1.0f, 0.6f, 1.0f, 0.3f, 0.6f, 0.7f, 0.6f, 0.8f, 0.8f, 0.8f, 0.5f, 0.8f, 0.3f, 0.6f, 0.1f, 0.4f, 0.1f, 0.2f, 0.3f }, new int[] { 0, 1, 2, 3, 1, 2, 4, 5, 3, 6, 0, 4, 5, 7, 7, 8, 8, 9, 9, 10, 10, 11 });
     letters['t']      = new LetterData(new float[] { 0.5f, 0.3f, 0.5f, 1.4f, 0.3f, 1.0f, 0.7f, 1.0f, 0.9f, 0.3f, 0.7f, 0.1f }, new int[] { 0, 1, 2, 3, 4, 5, 5, 0 });
     letters['u']      = new LetterData(new float[] { 0.2f, 0.3f, 0.2f, 1.0f, 0.8f, 0.3f, 0.6f, 0.1f, 0.4f, 0.1f, 0.8f, 1.0f, 0.8f, 0.1f }, new int[] { 0, 1, 2, 3, 3, 4, 4, 0, 5, 6 });
     letters['v']      = new LetterData(new float[] { 0.5f, 0.1f, 0.2f, 1.0f, 0.8f, 1.0f }, new int[] { 0, 1, 2, 0 });
     letters['w']      = new LetterData(new float[] { 0.3f, 0.1f, 0.2f, 1.0f, 0.8f, 1.0f, 0.7f, 0.1f, 0.5f, 0.4f }, new int[] { 0, 1, 2, 3, 3, 4, 4, 0 });
     letters['x']      = new LetterData(new float[] { 0.8f, 0.1f, 0.2f, 1.0f, 0.8f, 1.0f, 0.2f, 0.1f }, new int[] { 0, 1, 2, 3 });
     letters['y']      = new LetterData(new float[] { 0.5f, 0.6f, 0.5f, 0.1f, 0.2f, 1.0f, 0.8f, 1.0f }, new int[] { 0, 1, 0, 2, 3, 0 });
     letters['z']      = new LetterData(new float[] { 0.8f, 1.0f, 0.2f, 1.0f, 0.8f, 0.1f, 0.2f, 0.1f }, new int[] { 0, 1, 2, 3, 3, 0 });
     letters['{']      = new LetterData(new float[] { 0.4f, 1.7f, 0.6f, 1.9f, 0.4f, 0.9f, 0.3f, 1.0f, 0.4f, 1.1f, 0.4f, 0.3f, 0.6f, 0.1f }, new int[] { 0, 1, 2, 3, 3, 4, 4, 0, 5, 2, 6, 5 });
     letters['|']      = new LetterData(new float[] { 0.5f, 0.1f, 0.5f, 1.9f }, new int[] { 0, 1 });
     letters['}']      = new LetterData(new float[] { 0.7f, 1.0f, 0.6f, 0.9f, 0.6f, 1.1f, 0.4f, 1.9f, 0.6f, 1.7f, 0.6f, 0.3f, 0.4f, 0.1f }, new int[] { 0, 1, 2, 0, 3, 4, 4, 2, 1, 5, 5, 6 });
     letters['~']      = new LetterData(new float[] { 0.4f, 1.7f, 0.3f, 1.6f, 0.7f, 1.6f, 0.6f, 1.5f }, new int[] { 0, 1, 2, 3, 3, 0 });
 }
Exemplo n.º 24
0
 private LL_LetterData BuildLetterData_LL(LetterData data)
 {
     return(new LL_LetterData(data.GetId()));
 }
Exemplo n.º 25
0
        public List <StringPart> FindLetter(DatabaseManager database, WordData wordData, LetterData letterToFind, LetterEqualityStrictness strictness)
        {
            var stringParts = new List <StringPart>();

            bool findSameForm = strictness == LetterEqualityStrictness.WithActualForm || strictness == LetterEqualityStrictness.WithVisualForm;
            var  parts        = SplitWord(database, wordData, separateDiacritics: false, separateVariations: letterToFind.Kind != LetterDataKind.LetterVariation, keepFormInsideLetter: findSameForm);

            for (int i = 0, count = parts.Count; i < count; ++i)
            {
                if (parts[i].letter.IsSameLetterAs(letterToFind, strictness))
                {
                    stringParts.Add(parts[i]);
                }
            }

            return(stringParts);
        }
Exemplo n.º 26
0
        private IEnumerator FlashLetterInWordCoroutine(LetterData letterToFlash, Color color)
        {
            if (letterData is LL_WordData) {
                var splitLetters = ArabicAlphabetHelper.SplitWord(AppManager.I.DB, ((LL_WordData)letterData).Data);

                int charPosition = 0;
                List<int> foundLetterIndices = new List<int>();

                for (int index = 0; index < splitLetters.Count; ++index) {
                    if (splitLetters[index].letter.Id == letterToFlash.Id) {
                        foundLetterIndices.Add(charPosition);
                    }

                    charPosition += splitLetters[index].letter.GetStringForDisplay().Length;
                }

                if (foundLetterIndices.Count != 0) {
                    string originalText = ((LL_WordData)letterData).TextForLivingLetter;

                    letterObjectView.Label.SetText(originalText);

                    float timeElapsed = 0f;
                    int numCompletedCycles = 0;

                    float halfDuration = FLASH_CYCLE_DURATION * 0.5f;

                    string preparedText = ArabicAlphabetHelper.ProcessArabicString(originalText);
                    preparedText = originalText;

                    while (numCompletedCycles < NUM_FLASH_CYCLES) {
                        float interpolant = timeElapsed < halfDuration
                            ? timeElapsed / halfDuration
                            : 1 - ((timeElapsed - halfDuration) / halfDuration);
                        string tagStart = "<color=#" + GenericHelper.ColorToHex(Color.Lerp(Color.black, color, interpolant)) + ">";
                        string tagEnd = "</color>";

                        string composedString = "";

                        for (int i = 0; i < foundLetterIndices.Count; i++) {
                            int startIdx = i == 0 ? 0 : foundLetterIndices[i - 1] + letterToFlash.GetStringForDisplay().Length;
                            int endIdx = foundLetterIndices[i] - 1;

                            composedString += preparedText.Substring(startIdx, endIdx - startIdx + 1);

                            composedString += tagStart;
                            composedString += preparedText.Substring(foundLetterIndices[i], letterToFlash.GetStringForDisplay().Length);
                            composedString += tagEnd;
                        }

                        composedString += preparedText.Substring(foundLetterIndices[foundLetterIndices.Count - 1] + letterToFlash.GetStringForDisplay().Length);

                        letterObjectView.Label.SetText(composedString);

                        timeElapsed += Time.fixedDeltaTime;
                        if (timeElapsed >= FLASH_CYCLE_DURATION) {
                            numCompletedCycles++;
                            timeElapsed = 0f;
                        }

                        yield return new WaitForFixedUpdate();
                    }

                    letterObjectView.Label.SetText(originalText);
                }
            }

            flashLetterInWordCoroutine = null;
        }
Exemplo n.º 27
0
        public void DetailLetter(LetterInfo letterInfo)
        {
            DetailPanel.SetActive(true);
            myLetterInfo = letterInfo;
            myLetterData = letterInfo.data;

            if (ApplicationConfig.I.VerboseBook)
            {
                Debug.Log("[DetailLetter]" + myLetterData.Number + " " + myLetterData.Id);
            }

            HighlightLetterItem(myLetterInfo.data.Id);

            if (AppManager.I.ParentEdition.BookShowRelatedWords)
            {
                // show related words
                RelatedWordsContainer.SetActive(true);
                DiacriticsContainer.SetActive(false);
                emptyContainer(RelatedWordsContainer);
                foreach (var word in letterInfo.data.LinkedWords)
                {
                    WordData wdata = AppManager.I.DB.GetWordDataById(word);
                    WordInfo winfo = new WordInfo();
                    winfo.data = wdata;

                    btnGO = Instantiate(WordItemPrefab);
                    btnGO.transform.SetParent(RelatedWordsContainer.transform, false);
                    btnGO.GetComponent <ItemWord>().Init(this, winfo, false);
                }
            }
            else
            {
                // show related diacritics
                RelatedWordsContainer.SetActive(false);
                DiacriticsContainer.SetActive(true);
                emptyContainer(DiacriticsContainer);
                var letterbase        = myLetterInfo.data.Id;
                var variationsletters = AppManager.I.DB.FindLetterData(
                    (x) => (x.BaseLetter == letterbase && (x.Kind == LetterDataKind.DiacriticCombo && x.Active))
                    );
                variationsletters.Sort((x, y) => x.Number - y.Number);

                // diacritics box
                var letterGO = Instantiate(DiacriticSymbolItemPrefab);
                letterGO.transform.SetParent(DiacriticsContainer.transform, false);
                letterGO.GetComponent <ItemDiacriticSymbol>().Init(this, myLetterInfo, true);

                List <LetterInfo> info_list = AppManager.I.ScoreHelper.GetAllLetterInfo();
                info_list.Sort((x, y) => x.data.Number - y.data.Number);
                foreach (var info_item in info_list)
                {
                    if (variationsletters.Contains(info_item.data))
                    {
                        if (AppConfig.DisableShaddah && info_item.data.Symbol == "shaddah")
                        {
                            continue;
                        }
                        btnGO = Instantiate(DiacriticSymbolItemPrefab);
                        btnGO.transform.SetParent(DiacriticsContainer.transform, false);
                        btnGO.GetComponent <ItemDiacriticSymbol>().Init(this, info_item, false);
                        //debug_output += info_item.data.GetDebugDiacriticFix();
                    }
                }
            }

            //Debug.Log(debug_output);
            ShowLetter(myLetterInfo);
        }