public static IFragment[] LayoutRubyInLine(IFragment[] fragmentList, float endSpaceLength) { IFragment[] layouted = new IFragment[fragmentList.Length]; var n = fragmentList.Length; for (int i = 0; i < n; ++i) { IFragment current = fragmentList[i]; IAdjacentableToFragment before = (i > 0 ? fragmentList[i - 1] : DenyRubyHanging.theInstance); IAdjacentableToFragment after = (i < n - 1 ? fragmentList[i + 1] : DenyRubyHanging.theInstance); layouted[i] = current.LayoutRuby(before, after); } return(layouted); }
private static IFragment[] LayoutRubyInLine( LineBreaking.ILineConstraint constraint, IFragment[] fragmentList, float endSpaceLength) { //TODO: constraint を考慮して最適なものを選ぶ IFragment[] layouted = new IFragment[fragmentList.Length]; var n = fragmentList.Length; for (int i = 0; i < n; ++i) { IFragment current = fragmentList[i]; IAdjacentableToFragment before = (i > 0 ? fragmentList[i - 1] : DenyRubyHanging.theInstance); IAdjacentableToFragment after = (i < n - 1 ? fragmentList[i + 1] : DenyRubyHanging.theInstance); layouted[i] = current.LayoutRuby(before, after); } return(layouted); }