Пример #1
0
        /// <summary>
        /// Retrieves logical properties and measurements of each glyph cluster</summary>
        /// <returns>Metrics, such as line-break or total advance width, for a glyph cluster</returns>
        public ClusterMetrics[] GetClusterMetrics()
        {
            var clusterMetrics = NativeTextLayout.GetClusterMetrics();
            var result         = new ClusterMetrics[clusterMetrics.Length];

            for (int i = 0; i < clusterMetrics.Length; ++i)
            {
                result[i].Length           = clusterMetrics[i].Length;
                result[i].Width            = clusterMetrics[i].Width;
                result[i].CanWrapLineAfter = clusterMetrics[i].CanWrapLineAfter;
                result[i].IsNewline        = clusterMetrics[i].IsNewline;
                result[i].IsRightToLeft    = clusterMetrics[i].IsRightToLeft;
                result[i].IsSoftHyphen     = clusterMetrics[i].IsSoftHyphen;
                result[i].IsWhitespace     = clusterMetrics[i].IsWhitespace;
            }
            return(result);
        }
Пример #2
0
 /// <summary>
 /// Retrieves logical properties and measurements of each glyph cluster.
 /// </summary>
 /// <returns>Returns metrics, such as line-break or total advance width, for a glyph cluster. </returns>
 public ClusterMetrics[] GetClusterMetrics()
 {
     var clusterMetrics = NativeTextLayout.GetClusterMetrics();
     var result = new ClusterMetrics[clusterMetrics.Length];
     for (int i = 0; i < clusterMetrics.Length; ++i)
     {
         result[i].Length = clusterMetrics[i].Length;
         result[i].Width = clusterMetrics[i].Width;
         result[i].CanWrapLineAfter = clusterMetrics[i].CanWrapLineAfter;
         result[i].IsNewline = clusterMetrics[i].IsNewline;
         result[i].IsRightToLeft = clusterMetrics[i].IsRightToLeft;
         result[i].IsSoftHyphen = clusterMetrics[i].IsSoftHyphen;
         result[i].IsWhitespace = clusterMetrics[i].IsWhitespace;
     }
     return result;
 }