Ejemplo n.º 1
0
 public TextAnalysis(String Text, String localName, ReadingDirection readingDirection, NumberSubstitution numberSubstitution)
 {
     text_ = Text;
     localeName_ = localName;
     readingDirection_ = readingDirection;
     numberSubstitution_ = numberSubstitution;
 }
Ejemplo n.º 2
0
 public void SetNumberSubstitution(int textPosition, int textLength, SharpDX.DirectWrite.NumberSubstitution numberSubstitution)
 {
     this._numberSubstitution = numberSubstitution;
 }
Ejemplo n.º 3
0
        /// <summary>
        ///   This method applies the given number substition to a range of characters.
        /// </summary>
        /// <param name="textRange"> This parameter indicates the range of characters to modify. </param>
        /// <param name="numberSubstitution"> This parameter references the number substitution to apply to the range. </param>
        public void SetNumberSubstitution(IndexedRange textRange, NumberSubstitution numberSubstitution)
        {
            Contract.Assert(textRange.IsWithin(_FullText));

            foreach(int index in textRange)
            {
                _Characters[index].NumberSubstitution = numberSubstitution;
            }
        }
Ejemplo n.º 4
0
 public void SetNumberSubstitution(int textPosition, int textLength, NumberSubstitution numberSubstitution)
 {
     SetCurrentRun(textPosition);
     SplitCurrentRun(textPosition);
     while (textLength > 0)
     {
         int nextRunIndex = FetchNextRunIndex(ref textLength);
         LinkedRun run = runs_[nextRunIndex];
         run.isNumberSubstituted = (numberSubstitution != null);
         runs_[nextRunIndex] = run;
     }
 }
Ejemplo n.º 5
0
        private void SetLayoutNumbers(LayoutNumbers layoutNumbers)
        {
            // Creates a number substitution to select which digits are displayed.
            String localName = "en-us";
            if (layoutNumbers == LayoutNumbers.Arabic)
                localName = "ar-eg";
            NumberSubstitution numberSubstitution = new NumberSubstitution(FactoryDWrite, NumberSubstitutionMethod.Contextual, localName, true);
            flowLayout.SetNumberSubstitution(numberSubstitution);

            SetLayoutText(textMode_);
            numberSubstitution.Dispose();
        }
Ejemplo n.º 6
0
 public void SetNumberSubstitution(NumberSubstitution numberSubstitution)
 {
     numberSubstitution_ = numberSubstitution;
 }
Ejemplo n.º 7
0
        /// <summary>
        ///   This method applies the results of number substition analysis to a range of characters.
        /// </summary>
        /// <param name="textPosition"> This parameter indicates the starting index of the range. </param>
        /// <param name="textLength"> This parameter indicates the length of the range. </param>
        /// <param name="numberSubstitution"> This parameter references the number substition to apply to the range. </param>
        void TextAnalysisSink.SetNumberSubstitution(
			int textPosition, int textLength, NumberSubstitution numberSubstitution)
        {
            IndexedRange range = new IndexedRange(textPosition, textLength);

            foreach(int index in range)
            {
                _OutputSink.Characters[index].NumberSubstitution = numberSubstitution;
            }
        }