public override void WriteFont( IHtmlGenerator generator, IFontData originalFont, IFontData substitutedFont, string fontStyle, string fontWeight, byte[] fontData) { string fontName = substitutedFont == null ? originalFont.FontName : substitutedFont.FontName; string path = string.Format("{0}.woff", fontName); // some path sanitaze may be needed File.WriteAllBytes(Path.Combine(m_basePath, path), fontData); generator.AddHtml("<style>"); generator.AddHtml("@font-face { "); generator.AddHtml(string.Format("font-family: '{0}'; ", fontName)); generator.AddHtml(string.Format("src: url('{0}')", path)); generator.AddHtml(" }"); generator.AddHtml("</style>"); }
public override void WriteAllFonts(IHtmlGenerator generator, IPresentation presentation) { generator.AddHtml("<!-- Embedded fonts -->"); base.WriteAllFonts(generator, presentation); }
public override void WriteDocumentStart(IHtmlGenerator generator, IPresentation presentation) { generator.AddHtml(string.Format(Header, m_cssFileName)); WriteAllFonts(generator, presentation); }
void IHtmlFormattingController.WriteSlideEnd(IHtmlGenerator generator, ISlide slide) { generator.AddHtml(SlideFooter); }
void IHtmlFormattingController.WriteSlideStart(IHtmlGenerator generator, ISlide slide) { generator.AddHtml(string.Format(SlideHeader, generator.SlideIndex + 1)); }