Beispiel #1
0
        private int FontProc(ref Win32.ENUMLOGFONTEX lpelfe, ref Win32.NEWTEXTMETRICEX lpntme, uint FontType, IntPtr lParam)
        {
            //(lpelfe.lfPitchAndFamily & 2)==0)
            bool interesting = FontType == 4 && (lpntme.ntmTm.tmPitchAndFamily & 1) == 0 && lpelfe.lfFaceName[0] != '@';

            //Terminalは依然ダメ
            //if(!interesting)
            //	if(lpelfe.lfFaceName=="FixedSys" || lpelfe.lfFaceName=="Terminal") interesting = true; //この2つだけはTrueTypeでなくともリストにいれる

            if (interesting)   //縦書きでないことはこれでしか判定できないのか?
            //さぼり
            {
                if (/*_language==Language.Japanese && */ lpntme.ntmTm.tmCharSet == 128 ||/*SHIFTJIS_CHARSET*/
                    lpntme.ntmTm.tmCharSet == 129 ||/*HANGUL_CHARSET*/
                    lpntme.ntmTm.tmCharSet == 130 ||/*JOHAB_CHARSET*/
                    lpntme.ntmTm.tmCharSet == 134 ||/*GB2312_CHARSET*/
                    lpntme.ntmTm.tmCharSet == 136 /*CHINESEBIG5_CHARSET*/)
                {
                    _cjkFontList.Items.Add(lpelfe.lfFaceName);
                    //日本語フォントでもASCIIは必ず表示できるはず
                    if (_asciiFontList.FindStringExact(lpelfe.lfFaceName) == -1)
                    {
                        _asciiFontList.Items.Add(lpelfe.lfFaceName);
                    }
                }
                else if (lpntme.ntmTm.tmCharSet == 0)
                {
                    if (_asciiFontList.FindStringExact(lpelfe.lfFaceName) == -1)
                    {
                        _asciiFontList.Items.Add(lpelfe.lfFaceName);
                    }
                }
            }
            return(1);
        }
Beispiel #2
0
        private int FontProc(ref Win32.ENUMLOGFONTEX lpelfe, ref Win32.NEWTEXTMETRICEX lpntme, uint FontType, IntPtr lParam)
        {
            //(lpelfe.lfPitchAndFamily & 2)==0)
            bool interesting = FontType == 4 && (lpntme.ntmTm.tmPitchAndFamily & 1) == 0 && lpelfe.lfFaceName[0] != '@';

            //if(!interesting)
            //	if(lpelfe.lfFaceName=="FixedSys" || lpelfe.lfFaceName=="Terminal") interesting = true; //この2つだけはTrueTypeでなくともリストにいれる

            if (interesting)              //縦書きでないことはこれでしか判定できないのか?
            {
                if (_language == Language.Japanese && lpntme.ntmTm.tmCharSet == 128)
                {
                    _japaneseFontList.Items.Add(lpelfe.lfFaceName);
                    //日本語フォントでもASCIIは必ず表示できるはず
                    if (_asciiFontList.FindStringExact(lpelfe.lfFaceName) == -1)
                    {
                        _asciiFontList.Items.Add(lpelfe.lfFaceName);
                    }
                }
                else if (lpntme.ntmTm.tmCharSet == 0)
                {
                    if (_asciiFontList.FindStringExact(lpelfe.lfFaceName) == -1)
                    {
                        _asciiFontList.Items.Add(lpelfe.lfFaceName);
                    }
                }
            }
            return(1);
        }