public override void setFont(java.awt.Font f) { if (f != null && f != font) { netfont = f.getNetFont(); font = f; } }
protected NetGraphics(Graphics g, java.awt.Font font, Color fgcolor, Color bgcolor) { if (font == null) { font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12); } this.font = font; netfont = font.getNetFont(); this.color = fgcolor; this.bgcolor = bgcolor; init(g); }
public override void drawGlyphVector(java.awt.font.GlyphVector gv, float x, float y) { java.awt.Font javaFont = gv.getFont(); if (javaFont == null) { javaFont = font; } int count = gv.getNumGlyphs(); char[] text = new char[count]; for (int i = 0; i < count; i++) { text[i] = (char)gv.getGlyphCode(i); } java.awt.font.FontRenderContext frc = gv.getFontRenderContext(); Matrix matrix = null; try { if (frc != null && !frc.getTransform().equals(getTransform())) { // save the old context and use the transformation from the renderContext matrix = g.Transform; g.Transform = J2C.ConvertTransform(frc.getTransform()); } g.DrawString(new string(text), javaFont.getNetFont(), brush, x, y - javaFont.getSize(), StringFormat.GenericTypographic); } finally { // Restore the old context if needed if (matrix != null) { g.Transform = matrix; } } }
protected NetGraphics(Graphics g, java.awt.Font font, Color fgcolor, Color bgcolor) { if (font == null) { font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12); } this.font = font; netfont = font.getNetFont(); this.color = fgcolor; this.bgcolor = bgcolor; composite = CompositeHelper.Create(javaComposite, g); init(g); }
protected NetGraphics(Graphics g, Object destination, java.awt.Font font, Color fgcolor, Color bgcolor) //: base( new sun.java2d.SurfaceData(destination) ) { if (font == null) { font = new java.awt.Font("Dialog", java.awt.Font.PLAIN, 12); } this.font = font; netfont = font.getNetFont(); this.color = fgcolor; this.bgcolor = bgcolor; composite = CompositeHelper.Create(javaComposite, g); init(g); }