internal MyGLCanvas( CanvasGL2d canvasGL2d, int left, int top, int width, int height) { this.canvasGL2 = canvasGL2d; painter1 = new GLCanvasPainter(canvasGL2d, width, height); this.left = left; this.top = top; this.right = left + width; this.bottom = top + height; currentClipRect = new Rectangle(0, 0, width, height); this.CurrentFont = new RequestFont("tahoma", 10); this.CurrentTextColor = Color.Black; internalPen = new InternalPen(Color.Black); internalBrush = new InternalBrush(Color.Black); #if DEBUG debug_canvas_id = dbug_canvasCount + 1; dbug_canvasCount += 1; #endif this.StrokeWidth = 1; }
public GLBmpGlyphTextPrinter(GLCanvasPainter painter, IFontLoader fontLoader) { //create text printer for use with canvas painter this.painter = painter; this.canvas2d = painter.Canvas; _fontLoader = fontLoader; //------ ChangeFont(painter.CurrentFont); }
public GLBmpGlyphTextPrinter(GLCanvasPainter painter, IFontLoader fontLoader) { //create text printer for use with canvas painter this.painter = painter; this.canvas2d = painter.Canvas; GlyphPosPixelSnapX = GlyphPosPixelSnapKind.Integer; GlyphPosPixelSnapY = GlyphPosPixelSnapKind.Integer; _fontLoader = fontLoader; ChangeFont(painter.CurrentFont); this._glyphLayout.ScriptLang = painter.CurrentFont.GetOpenFontScriptLang(); _loadedGlyphs = new GLBitmapCache <SimpleFontAtlas>(atlas => { //create new one Typography.Rendering.GlyphImage totalGlyphImg = atlas.TotalGlyph; //load to glbmp GLBitmap found = new GLBitmap(totalGlyphImg.Width, totalGlyphImg.Height, totalGlyphImg.GetImageBuffer(), false); found.IsInvert = false; return(found); }); }
public AggTextSpanPrinter(GLCanvasPainter canvasPainter, int w, int h) { //this class print long text into agg canvas //then copy pixel buffer from aff canvas to gl-bmp //then draw the gl-bmp into target gl canvas //TODO: review here this.canvasPainter = canvasPainter; this.canvas = canvasPainter.Canvas; bmpWidth = w; bmpHeight = h; actualImage = new ActualImage(bmpWidth, bmpHeight, PixelFormat.ARGB32); imgGfx2d = new ImageGraphics2D(actualImage); _aggPainter = new AggCanvasPainter(imgGfx2d); _aggPainter.FillColor = Color.Black; _aggPainter.StrokeColor = Color.Black; //set default1 _aggPainter.CurrentFont = canvasPainter.CurrentFont; textPrinter = new VxsTextPrinter(_aggPainter, YourImplementation.BootStrapOpenGLES2.myFontLoader); _aggPainter.TextPrinter = textPrinter; }