示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Determines whether or not to load the specified character in the grid. This method
        /// is only used when the grid is being loaded from a font.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private bool ShouldLoadFontChar(char ch)
        {
            if (ch == StringUtils.kchObject || ch == StringUtils.kchReplacement)
            {
                return(false);
            }

            if (m_cpe == null)
            {
                return((m_fSymbolCharSet || !char.IsLetterOrDigit(ch)) &&
                       !char.IsWhiteSpace(ch) && !char.IsControl(ch));
            }

            UcdProperty ucdProp = UcdProperty.GetInstance(m_cpe.get_GeneralCategory(ch));
            string      sUcdRep = ucdProp.UcdRepresentation;

            if (string.IsNullOrEmpty(sUcdRep))
            {
                return(false);
            }

            char charCat = sUcdRep.ToUpperInvariant()[0];

            return(charCat == 'S' || charCat == 'P' ||
                   (m_fSymbolCharSet && (charCat == 'L' || charCat == 'N')));
        }