Пример #1
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var report = new SampleReport();

            report.Font = new Font(CustomFontsHelper.GetFamily("Miss Fajardose"), 48F, System.Drawing.FontStyle.Regular, GraphicsUnit.Point);

            var cachedReportSource = new CachedReportSource(report, new MemoryDocumentStorage());

            preview.DocumentSource = cachedReportSource;
            cachedReportSource.CreateDocumentAsync();
        }
        protected override object CreateObject(string[] values)
        {
            Font font = base.CreateObject(values) as Font;

            if (values.Length > 0)
            {
                FontFamily fontFamily = CustomFontsHelper.GetFamily(values[0]);
                if (fontFamily != null)
                {
                    return(new Font(fontFamily, font.Size, font.Style, font.Unit, font.GdiCharSet, font.GdiVerticalFont));
                }
            }
            return(font);
        }