示例#1
0
        public ScrollText(string text)
        {
            _font = new FtGl.FTGLExtrudeFont("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
            _font.Depth(0.01f);
            _font.FaceSize(1);
            _font.Outset(0.0f, 0.02f);
            _font.CharMap(FT_Encoding.FT_ENCODING_UNICODE);

            _layout = new FtGl.FTSimpleLayout();
            _layout.SetLineLength(_width);
            _layout.SetFont(_font);
            _layout.SetAlignment(FtGl.TextAlignment.ALIGN_CENTER);

            _text      = text;
            _starttime = DateTime.Now;
        }
示例#2
0
        private static void setUpFonts()
        {
            fonts[FTGL_BITMAP]  = new FtGl.FTGLBitmapFont(fontName);
            fonts[FTGL_PIXMAP]  = new FtGl.FTGLPixmapFont(fontName);
            fonts[FTGL_OUTLINE] = new FtGl.FTGLOutlineFont(fontName);
            fonts[FTGL_POLYGON] = new FtGl.FTGLPolygonFont(fontName);
            fonts[FTGL_EXTRUDE] = new FtGl.FTGLExtrudeFont(fontName);
            fonts[FTGL_TEXTURE] = new FtGl.FTGLTextureFont(fontName);

            for (int x = 0; x < 6; ++x)
            {
                if (fonts[x].Error() < 0)
                {
                    Console.WriteLine("Failed to open font {0}", fontName);
                    System.Environment.Exit(0);
                }

                if (fonts[x].FaceSize(144) == 0)
                {
                    Console.WriteLine("Failed to set size");
                    System.Environment.Exit(0);
                }

                fonts[x].Depth(20);

                fonts[x].CharMap(FT_Encoding.FT_ENCODING_UNICODE);
            }

            //infoFont.FTGLPixmapFont(fontName);

            if (infoFont.Error() < 0)
            {
                Console.WriteLine("Failed to open font {0}", fontName);
                System.Environment.Exit(0);
            }

            infoFont.FaceSize(18);

            //myString[0] = 65;
            //myString[1] = 0;
        }