Beispiel #1
0
        internal static string ConvertGlyphVector(java.awt.font.GlyphVector gv)
        {
            int count = gv.getNumGlyphs();

            char[] text = new char[count];
            for (int i = 0; i < count; i++)
            {
                text[i] = (char)gv.getGlyphCode(i);
            }
            return(new string(text));
        }
Beispiel #2
0
        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;
                }
            }
        }