Пример #1
0
        public void AnalyzeText(String text)
        {
            // Perform analysis on the given text, converting text to glyphs.

            // Analyzes the given text and keeps the results for later reflow.
            isTextAnalysisComplete_ = false;

            // Need a font face to determine metrics.
            if (fontFace_ == null)
            {
                throw new Exception("FlowLayout: Need a font face to determine metrics.");
            }

            text_ = text;

            // Query for the text analyzer's interface.
            TextAnalyzer textAnalyzer = new TextAnalyzer(dwriteFactory_);

            // Record the analyzer's results.
            TextAnalysis textAnalysis = new TextAnalysis(text_, localName_, readingDirection_, numberSubstitution_);

            textAnalysis.GenerateResults(textAnalyzer, out runs_, out breakpoints_);

            // Convert the entire text to glyphs.
            ShapeGlyphRuns(textAnalyzer);

            isTextAnalysisComplete_ = true;

            textAnalyzer.Dispose();
        }
Пример #2
0
        public void AnalyzeText(String text)
        {
            // Perform analysis on the given text, converting text to glyphs.

            // Analyzes the given text and keeps the results for later reflow.
            isTextAnalysisComplete_ = false;

            // Need a font face to determine metrics.
            if (fontFace_ == null)
                throw new Exception("FlowLayout: Need a font face to determine metrics.");

            text_ = text;

            // Query for the text analyzer's interface.
            TextAnalyzer textAnalyzer = new TextAnalyzer(dwriteFactory_);

            // Record the analyzer's results.
            TextAnalysis textAnalysis = new TextAnalysis(text_, localName_, readingDirection_, numberSubstitution_);
            textAnalysis.GenerateResults(textAnalyzer, out runs_, out breakpoints_);

            // Convert the entire text to glyphs.
            ShapeGlyphRuns(textAnalyzer);

            isTextAnalysisComplete_ = true;

            textAnalyzer.Dispose();
        }