public JapaneseLetterFragment( GlueProperty beforeGlue, float contentLength, UChar content, TextEmphasysDot textEmphasysDot) : base(beforeGlue, contentLength, textEmphasysDot) { _content = content; }
public void PutGroupRuby(GroupRuby @object) { var baseFragments = GenerateFragments(_currentStyle, @object.BaseObjects, _accumulatedGlue); _accumulatedGlue = default(GlueProperty); var rubyFragments = GenerateFragments(_currentStyle, @object.RubyObjects, default(GlueProperty)); _buffer.Add(new InlineLayoutEngine.RubyFragment(baseFragments, rubyFragments)); }
public LatinWordPartFragment( GlueProperty beforeGlue, float contentLength, UString content, TextEmphasysDot textEmphasysDot) : base(beforeGlue, contentLength, textEmphasysDot) { _content = content; }
public AtomicFragment( GlueProperty beforeGlue, float contentLength, TextEmphasysDot textEmphasysDot) { BeforeGlue = beforeGlue; ContentLength = contentLength; _textEmphasysDot = textEmphasysDot; }
public void PutLetter(JapaneseLetter @object) { var newFragment = new InlineLayoutEngine.JapaneseLetterFragment( _accumulatedGlue, @object.Length, @object.Letter, _currentStyle.TextEmphasysDot); _buffer.Add(newFragment); _accumulatedGlue = default(GlueProperty); }
public JapaneseInterletterspace( GlueProperty glue, GlueProperty glueBeforeBreak, float indentAfterBreak, bool isBreakProhibited) { Glue = glue; GlueBeforeBreak = glueBeforeBreak; IndentAfterBreak = indentAfterBreak; _penalty = isBreakProhibited ? LineBreaking.Constants.PenaltyInfinity : 0; }
public void PutLatinWordPart(LatinWord @object) { var newFragment = new InlineLayoutEngine.LatinWordPartFragment( _accumulatedGlue, @object.Length, @object.Letters, _currentStyle.TextEmphasysDot); _buffer.Add(newFragment); _accumulatedGlue = default(GlueProperty); }
public JapaneseLetterFragment( GlueProperty beforeGlue, float contentLength, string content, TextEmphasysDot textEmphasysDot) { BeforeGlue = beforeGlue; ContentLength = contentLength; Content = content; _textEmphasysDot = textEmphasysDot; }
private static IFragment[] ConvertToFragments(ref GlueProperty startGlue, IEnumerable <IFormatObject> objectList, ref GlueProperty endGlue, InlineStyle style, out InlineStyle newStyle) { var styleClone = style.Clone(); var context = new Context(styleClone, 64); context.PutGlue(startGlue); foreach (var obj in objectList) { context.Put(obj); } context.PutGlue(endGlue); newStyle = styleClone; return(context.Fragments); }
public static UnjustifiedLine Solve( LineBreaking.ILineConstraint constraint, GlueProperty startGlue, IEnumerable <IFormatObject> objectList, GlueProperty endGlue, float penaltyValue, Heading heading, InlineStyle style, out InlineStyle newStyle) { IFragment[] fragments = ConvertToFragments(ref startGlue, objectList, ref endGlue, style, out newStyle); var rubyLayoutedBuffer = LayoutRubyInLine(constraint, fragments, endGlue.Length); return(new UnjustifiedLine(rubyLayoutedBuffer, penaltyValue, heading)); }
public UnjustifiedLine Build( GlueProperty startGlue, IEnumerable <IFormatObject> objectList, GlueProperty endGlue, float penaltyValue, InlineStyle style, out InlineStyle newStyle) { var styleClone = style.Clone(); Context context = new Context(styleClone, 64); context.PutGlue(startGlue); foreach (var obj in objectList) { context.Put(obj); } context.PutGlue(endGlue); var buffer = context.Buffer.ToArray(); //TODO: この処理が同じオブジェクト列に対して繰り返し呼ばれる。もっと前段階に運搬 var rubyLayoutedBuffer = UnjustifiedLine.LayoutRubyInLine(buffer, endGlue.Length); newStyle = styleClone; return(new UnjustifiedLine(rubyLayoutedBuffer, context.AccumulatedGlue, penaltyValue)); }
public LatinInterwordSpace(GlueProperty glue) { Glue = glue; }
public JapaneseEndOfLineSpace(GlueProperty finalGlue) { _finalGlue = finalGlue; }
private static UnjustifiedLine.JapaneseLetterFragment[] GenerateFragments(InlineStyle style, IFormatObject[] objects, GlueProperty startGlue) { Context baseContext = new Context(style, objects.Length); baseContext.PutGlue(startGlue); foreach (var x in objects) { baseContext.Put(x); } try { return(Array.ConvertAll(baseContext.Buffer, x => (UnjustifiedLine.JapaneseLetterFragment)x)); } catch (Exception ex) { throw new NotImplementedException("texts both with formatting and with ruby is not supported", ex); } }
public EndOfLinePsuedoFragment(GlueProperty glue) { _glue = glue; }
public Context(InlineStyle style, int capacity) { _buffer = new List <InlineLayoutEngine.IFragment>(capacity); _accumulatedGlue = default(GlueProperty); _currentStyle = style; }
public UnjustifiedLine(IFragment[] fragmentList, GlueProperty endGlue, float penaltyValue) { _fragmentList = (IFragment[])fragmentList.Clone(); _endGlue = endGlue; _penaltyValue = penaltyValue; }
private static InlineLayoutEngine.AtomicFragment[] GenerateFragments(InlineStyle style, IFormatObject[] objects, GlueProperty startGlue) { Context baseContext = new Context(style, objects.Length); baseContext.PutGlue(startGlue); foreach (var x in objects) { baseContext.Put(x); } try { return(baseContext._buffer.ConvertAll(x => (InlineLayoutEngine.AtomicFragment)x).ToArray()); } catch (Exception ex) { throw new NotImplementedException("texts both with formatting and with ruby is not supported", ex); } }
public void PutGlue(GlueProperty glue) { _accumulatedGlue += glue; }