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; }
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); }
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()); }
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]); }
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; }
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; }
public override bool Equals(System.Object o) { CachedFont f = (CachedFont)o; return(font.Equals(f.font) && transform.Equals(f.transform)); }