示例#1
0
文件: G.cs 项目: uwx/MadSharp
 public static void SetFont(Font p0)
 {
     _fontCached = Fonts.GetOrCompute(p0, () =>
     {
         var fmt = new TextFormat(FactoryDW, p0.FontName, p0.Size);
         return(fmt, new FontMetrics(fmt));
     });
     _textFormat = _fontCached.Format;
 }
示例#2
0
        public virtual GlyphImage getGlyph(CachedFont font, int glyphCode)
        {
            GlyphImage g = getGlyphs(font)[glyphCode];

            //		System.out.println(g != null);

            if (g == null || g.cache.IsEmpty || g.cache.Width < 0)
            {
                return(null);
            }

            return(g);
        }
示例#3
0
        public virtual GlyphImage renderGlyph(CachedFont font, int glyphCode)
        {
#if PENDING
            GlyphImage g = TextRenderer.renderGlyph(font.font, font.transform, glyphCode);

            g.cache = cacheImage.addImage(g);
            g.data  = null;
            getGlyphs(font)[glyphCode] = g;

            return(g);
#endif
            return(new GlyphImage());
        }
示例#4
0
        public virtual GlyphImage[] getGlyphs(CachedFont font)
        {
#if PENDING
            GlyphImage[] r = (GlyphImage[])fontMap.get_Renamed(font);

            if (r == null)
            {
                //UPGRADE_ISSUE: Method 'java.awt.Font.getNumGlyphs' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFontgetNumGlyphs_3"'
                r = new GlyphImage[font.font.getNumGlyphs()];
                fontMap.put(font, r);
            }

            return(r);
#endif
            return(new GlyphImage[0]);
        }
示例#5
0
 internal PDFFont(CachedFont cachedFont, string fontFamily, string pdfFontFamily, string fontCMap, string registry, string ordering, string supplement, FontStyle gdiFontStyle, int emHeight, float gridHeight, bool internalFont, bool simulateItalic, bool simulateBold)
 {
     CachedFont       = cachedFont;
     FontFamily       = fontFamily;
     FontPDFFamily    = pdfFontFamily;
     FontCMap         = fontCMap;
     Registry         = registry;
     Ordering         = ordering;
     Supplement       = supplement;
     GDIFontStyle     = gdiFontStyle;
     EMHeight         = emHeight;
     GridHeight       = gridHeight;
     InternalFont     = internalFont;
     EMGridConversion = 1000f / (float)emHeight;
     SimulateItalic   = simulateItalic;
     SimulateBold     = simulateBold;
 }
示例#6
0
 public PDFFont(CachedFont cachedFont, string fontFamily, string pdfFontFamily, string fontCMap, string registry, string ordering, string supplement, FontStyle gdiFontStyle, int emHeight, float gridHeight, bool internalFont, bool simulateItalic, bool simulateBold)
 {
     this.CachedFont       = cachedFont;
     this.FontFamily       = fontFamily;
     this.FontPDFFamily    = pdfFontFamily;
     this.FontCMap         = fontCMap;
     this.Registry         = registry;
     this.Ordering         = ordering;
     this.Supplement       = supplement;
     this.GDIFontStyle     = gdiFontStyle;
     this.EMHeight         = emHeight;
     this.GridHeight       = gridHeight;
     this.InternalFont     = internalFont;
     this.EMGridConversion = (float)(1000.0 / (float)emHeight);
     this.SimulateItalic   = simulateItalic;
     this.SimulateBold     = simulateBold;
 }
示例#7
0
            public override bool Equals(System.Object o)
            {
                CachedFont f = (CachedFont)o;

                return(font.Equals(f.font) && transform.Equals(f.transform));
            }