// ------------------------------------------------------------------
 // Constructor.
 //
 //      PtsContext - Context
 //      TextParagraphCache - Contained line break
 // ------------------------------------------------------------------
 internal OptimalBreakSession(TextParagraph textParagraph, TextParaClient textParaClient, TextParagraphCache TextParagraphCache, OptimalTextSource optimalTextSource) : base(textParagraph.PtsContext)
 {
     _textParagraph      = textParagraph;
     _textParaClient     = textParaClient;
     _textParagraphCache = TextParagraphCache;
     _optimalTextSource  = optimalTextSource;
 }
Пример #2
0
 // ------------------------------------------------------------------
 // Constructor.
 //
 //      PtsContext - Context
 //      TextParagraphCache - Contained line break
 // ------------------------------------------------------------------
 internal OptimalBreakSession(TextParagraph textParagraph, TextParaClient textParaClient, TextParagraphCache TextParagraphCache, OptimalTextSource optimalTextSource) : base(textParagraph.PtsContext)
 {
     _textParagraph = textParagraph;
     _textParaClient = textParaClient;
     _textParagraphCache = TextParagraphCache;
     _optimalTextSource = optimalTextSource;
 }
Пример #3
0
        // Token: 0x06006B23 RID: 27427 RVA: 0x001EED14 File Offset: 0x001ECF14
        internal void CreateOptimalBreakSession(TextParaClient textParaClient, int dcpStart, int durTrack, LineBreakRecord lineBreakRecord, out OptimalBreakSession optimalBreakSession, out bool isParagraphJustified)
        {
            this._textRunCache = new TextRunCache();
            TextFormatter     textFormatter     = base.StructuralCache.TextFormatterHost.TextFormatter;
            TextLineBreak     previousLineBreak = (lineBreakRecord != null) ? lineBreakRecord.TextLineBreak : null;
            OptimalTextSource optimalTextSource = new OptimalTextSource(base.StructuralCache.TextFormatterHost, base.ParagraphStartCharacterPosition, durTrack, textParaClient, this._textRunCache);

            base.StructuralCache.TextFormatterHost.Context = optimalTextSource;
            TextParagraphCache textParagraphCache = textFormatter.CreateParagraphCache(base.StructuralCache.TextFormatterHost, dcpStart, TextDpi.FromTextDpi(durTrack), this.GetLineProperties(true, dcpStart), previousLineBreak, this._textRunCache);

            base.StructuralCache.TextFormatterHost.Context = null;
            optimalBreakSession  = new OptimalBreakSession(this, textParaClient, textParagraphCache, optimalTextSource);
            isParagraphJustified = ((TextAlignment)base.Element.GetValue(Block.TextAlignmentProperty) == TextAlignment.Justify);
        }
Пример #4
0
        // Token: 0x06006B27 RID: 27431 RVA: 0x001EEE9C File Offset: 0x001ED09C
        internal IList <TextBreakpoint> FormatLineVariants(TextParaClient textParaClient, TextParagraphCache textParagraphCache, OptimalTextSource optimalTextSource, int dcp, TextLineBreak textLineBreak, uint fswdir, int urStartLine, int durLine, bool allowHyphenation, bool clearOnLeft, bool clearOnRight, bool treatAsFirstInPara, bool treatAsLastInPara, bool suppressTopSpace, IntPtr lineVariantRestriction, out int iLineBestVariant)
        {
            base.StructuralCache.TextFormatterHost.Context = optimalTextSource;
            IList <TextBreakpoint> result = textParagraphCache.FormatBreakpoints(dcp, textLineBreak, lineVariantRestriction, TextDpi.FromTextDpi(durLine), out iLineBestVariant);

            base.StructuralCache.TextFormatterHost.Context = null;
            return(result);
        }