Example #1
0
        /// <summary>
        /// <ja>�R�s�[���č쐬���܂��B</ja>
        /// <en>Initializes with another instance.</en>
        /// </summary>
        public RenderProfile(RenderProfile src)
        {
            #if !MACRODOC
            _fontName = src._fontName;
            _japaneseFontName = src._japaneseFontName;
            _fontSize = src._fontSize;
            _useClearType = src._useClearType;
            _japaneseFont = _font = null;

            _forecolor = src._forecolor;
            _bgcolor = src._bgcolor;
            _esColorSet = (EscapesequenceColorSet)src._esColorSet.Clone();
            _bgbrush = _brush = null;

            _backgroundImageFileName = src._backgroundImageFileName;
            _imageLoadIsAttempted = false;
            _imageStyle = src.ImageStyle;
            #endif
        }
Example #2
0
        private void CreateFonts()
        {
            _font = new FontHandle(GUtil.CreateFont(_fontName, _fontSize));
            FontStyle fs = _font.Font.Style;
            _boldfont = new FontHandle(new Font(_font.Font, fs | FontStyle.Bold));
            _underlinefont = new FontHandle(new Font(_font.Font, fs | FontStyle.Underline));
            _boldunderlinefont = new FontHandle(new Font(_font.Font, fs | FontStyle.Underline | FontStyle.Bold));

            _japaneseFont = new FontHandle(new Font(_japaneseFontName, _fontSize));
            fs = _japaneseFont.Font.Style;
            _japaneseBoldfont = new FontHandle(new Font(_japaneseFont.Font, fs | FontStyle.Bold));
            _japaneseUnderlinefont = new FontHandle(new Font(_japaneseFont.Font, fs | FontStyle.Underline));
            _japaneseBoldunderlinefont = new FontHandle(new Font(_japaneseFont.Font, fs | FontStyle.Underline | FontStyle.Bold));

            _usingIdenticalFont = (_font.Font.Name==_japaneseFont.Font.Name);

            //�ʏ��
            Graphics g = Graphics.FromHwnd(Win32.GetDesktopWindow());
            #if false
            SizeF charsize1 = g.MeasureString("A", _font.Font);
            SizeF charsize2 = g.MeasureString("AA", _font.Font);

            _pitch = new SizeF(charsize2.Width-charsize1.Width, charsize1.Height);
            _chargap = (charsize1.Width-_pitch.Width)/2;
            #else
            IntPtr hdc = g.GetHdc();
            Win32.SelectObject(hdc, _font.HFONT);
            Win32.SIZE charsize1, charsize2;
            Win32.GetTextExtentPoint32(hdc, "A", 1, out charsize1);
            Win32.GetTextExtentPoint32(hdc, "AAA", 3, out charsize2);

            _pitch = new SizeF((charsize2.width-charsize1.width)/2, charsize1.height);
            _chargap = (charsize1.width-_pitch.Width)/2;
            g.ReleaseHdc(hdc);
            #endif
            g.Dispose();
        }
Example #3
0
        private void Init(CommonOptions opt)
        {
            //�N���̍������̂��߁A�t�H���g�̍쐬�͒x���]��
            _fontName = opt.FontName;
            _japaneseFontName = opt.JapaneseFontName;
            _fontSize = opt.FontSize;
            _useClearType = opt.UseClearType;
            _japaneseFont = _font = null;
            _esColorSet = (EscapesequenceColorSet)opt.ESColorSet.Clone();

            _forecolor = opt.TextColor;
            _bgcolor = opt.BGColor;
            _bgbrush = _brush = null;

            _backgroundImageFileName = opt.BackgroundImageFileName;
            _imageLoadIsAttempted = false;
            _imageStyle = opt.ImageStyle;
        }
Example #4
0
 private void ClearFont()
 {
     _font = null;
     _boldfont = null;
     _underlinefont = null;
     _boldunderlinefont = null;
     _japaneseFont = null;
     _japaneseBoldfont = null;
     _japaneseUnderlinefont = null;
     _japaneseBoldunderlinefont = null;
 }