示例#1
0
        /// <summary>
        ///     Try-pattern version of <see cref="GetCharMetrics"/>.
        /// </summary>
        public bool TryGetCharMetrics(Rune rune, float scale, out CharMetrics metrics, bool fallback = true)
        {
            var maybe = GetCharMetrics(rune, scale);

            if (maybe.HasValue)
            {
                metrics = maybe.Value;
                return(true);
            }

            metrics = default;
            return(false);
        }
示例#2
0
        /// <summary>
        ///     Try-pattern version of <see cref="GetCharMetrics"/>.
        /// </summary>
        public bool TryGetCharMetrics(char chr, out CharMetrics metrics)
        {
            var maybe = GetCharMetrics(chr);

            if (maybe.HasValue)
            {
                metrics = maybe.Value;
                return(true);
            }

            metrics = default;
            return(false);
        }
示例#3
0
 public bool TryGetCharMetrics(char chr, out CharMetrics metrics)
 {
     return(TryGetCharMetrics(chr, 1, out metrics));
 }