Пример #1
0
            public static bool DoesSupportUnicode(
                this PreviewFontInfo previewFontInfo,
                UnicodeLangBits unicodeLangBits)
            {
                long bits   = (long)unicodeLangBits;
                int  bitpos = (int)(bits >> 32);

                if (bitpos == 0)
                {
                    return(true); //default
                }
                else if (bitpos < 32)
                {
                    //use range 1
                    return((previewFontInfo.UnicodeRange1 & (1 << bitpos)) != 0);
                }
                else if (bitpos < 64)
                {
                    return((previewFontInfo.UnicodeRange2 & (1 << (bitpos - 32))) != 0);
                }
                else if (bitpos < 96)
                {
                    return((previewFontInfo.UnicodeRange3 & (1 << (bitpos - 64))) != 0);
                }
                else if (bitpos < 128)
                {
                    return((previewFontInfo.UnicodeRange4 & (1 << (bitpos - 96))) != 0);
                }
                else
                {
                    throw new System.NotSupportedException();
                }
            }
Пример #2
0
        internal static bool DoesSupportUnicode(Languages langs, UnicodeLangBits unicodeLangBits)
        {
            long bits   = (long)unicodeLangBits;
            int  bitpos = (int)(bits >> 32);

            if (bitpos < 32)
            {
                //use range 1
                return((langs.UnicodeRange1 & (1 << bitpos)) != 0);
            }
            else if (bitpos < 64)
            {
                return((langs.UnicodeRange2 & (1 << (bitpos - 32))) != 0);
            }
            else if (bitpos < 96)
            {
                return((langs.UnicodeRange3 & (1 << (bitpos - 64))) != 0);
            }
            else if (bitpos < 128)
            {
                return((langs.UnicodeRange4 & (1 << (bitpos - 96))) != 0);
            }
            else
            {
                throw new System.NotSupportedException();
            }
        }
Пример #3
0
            public static UnicodeRangeInfo ToUnicodeRangeInfo(this UnicodeLangBits unicodeLangBits)
            {
                long bits    = (long)unicodeLangBits;
                int  bitpos  = (int)(bits >> 32);
                int  lower32 = (int)(bits & 0xFFFFFFFF);

                return(new UnicodeRangeInfo(bitpos,
                                            lower32 >> 16,
                                            lower32 & 0xFFFF));
            }
Пример #4
0
            public static bool DoesSupportUnicode(
                this Typeface typeface,
                UnicodeLangBits unicodeLangBits)
            {
                if (typeface.OS2Table == null)
                {
                    return(false);
                }
                //-----------------------------
                long bits   = (long)unicodeLangBits;
                int  bitpos = (int)(bits >> 32);

                if (bitpos == 0)
                {
                    return(true); //default
                }
                else if (bitpos < 32)
                {
                    //use range 1
                    return((typeface.OS2Table.ulUnicodeRange1 & (1 << bitpos)) != 0);
                }
                else if (bitpos < 64)
                {
                    return((typeface.OS2Table.ulUnicodeRange2 & (1 << (bitpos - 32))) != 0);
                }
                else if (bitpos < 96)
                {
                    return((typeface.OS2Table.ulUnicodeRange3 & (1 << (bitpos - 64))) != 0);
                }
                else if (bitpos < 128)
                {
                    return((typeface.OS2Table.ulUnicodeRange4 & (1 << (bitpos - 96))) != 0);
                }
                else
                {
                    throw new System.NotSupportedException();
                }
            }
Пример #5
0
 public UnicodeRangeMapWithScriptLang(UnicodeLangBits unicodeRangeBits, ScriptLang scLang)
 {
     this.scLang           = scLang;
     this.unicodeRangeBits = unicodeRangeBits;
 }
Пример #6
0
            public static bool DoseSupportUnicode(
                this Typeface typeface,
                UnicodeLangBits unicodeLangBits)
            {
                if (typeface.OS2Table == null)
                {
                    return false;
                }
                //-----------------------------
                long bits = (long)unicodeLangBits;
                int bitpos = (int)(bits >> 32);

                if (bitpos == 0)
                {
                    return true; //default
                }
                else if (bitpos < 32)
                {
                    //use range 1
                    return (typeface.OS2Table.ulUnicodeRange1 & (1 << bitpos)) != 0;
                }
                else if (bitpos < 64)
                {
                    return (typeface.OS2Table.ulUnicodeRange2 & (1 << (bitpos - 32))) != 0;
                }
                else if (bitpos < 96)
                {
                    return (typeface.OS2Table.ulUnicodeRange3 & (1 << (bitpos - 64))) != 0;
                }
                else if (bitpos < 128)
                {
                    return (typeface.OS2Table.ulUnicodeRange4 & (1 << (bitpos - 96))) != 0;
                }
                else
                {
                    throw new System.NotSupportedException();
                }
            }
Пример #7
0
 public void SetInfo(Typography.OpenFont.ScriptLang scriptLang, UnicodeLangBits langBits)
 {
     _scriptLang      = scriptLang;
     _langBits        = langBits;
     this.label1.Text = _scriptLang.fullname + "," + _scriptLang.shortname + "," + langBits.ToString();
 }
Пример #8
0
 public static bool DoesSupportUnicode(
     this Typeface typeface,
     UnicodeLangBits unicodeLangBits)
 {
     return(DoesSupportUnicode(typeface.Languages, unicodeLangBits));
 }
Пример #9
0
 public static bool DoesSupportUnicode(
     this PreviewFontInfo previewFontInfo,
     UnicodeLangBits unicodeLangBits)
 {
     return(DoesSupportUnicode(previewFontInfo.Languages, unicodeLangBits));
 }