Beispiel #1
0
        public static float measureText(float offset, string buf, int start, int count, TextStyle style,
                                        List <float> advances, int advanceOffset, TabStops tabStops)
        {
            Layout layout = new Layout();

            layout.setTabStops(tabStops);
            layout.doLayout(offset, buf, start, count, style);
            if (advances != null)
            {
                var layoutAdv = layout.getAdvances();
                for (int i = 0; i < count; i++)
                {
                    advances[i + advanceOffset] = layoutAdv[i];
                }
            }

            return(layout.getAdvance());
        }
Beispiel #2
0
 public void setTabStops(TabStops tabStops)
 {
     this._tabStops = tabStops;
 }