![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Printing some fonts throws exception in XPS to GDI conversion I am working on a WPF-based application. When I attempt to print my document, the print job fails if the document contains certain TrueType fonts. Details of the failure: Using either the System.Windows.Controls.PrintDialog.PrintVisual method or the System.Windows.Xps.VisualsToXpsDocument.Write method, an exception is thrown if the Visual contains one of the problematic fonts. The exception is System.IndexOutOfRangeException. The message is “Index was outside the bounds of the array.” The stack trace is: at Microsoft.Internal.GDIExporter.TrueTypeFont.CheckSum(UInt32 pos, UInt32 len) at Microsoft.Internal.GDIExporter.TrueTypeFont.ProcessNameTable(UInt32 pos) at Microsoft.Internal.GDIExporter.FontInstallInfo.Install(FontStreamContext context, String& newFamilyName, UInt32 faceIndex) at Microsoft.Internal.GDIExporter.FontInfo.UsePrivate(GlyphTypeface typeface) at Microsoft.Internal.GDIExporter.CGDIDevice.CheckFont(GlyphTypeface typeface, String name) at Microsoft.Internal.GDIExporter.CGDIRenderTarget.CreateFontW(GlyphRun pGlyphRun, Double fontSize, Double scaleY) at Microsoft.Internal.GDIExporter.CGDIRenderTarget.RenderTextThroughGDI(GlyphRun pGlyphRun, Brush pBrush) at Microsoft.Internal.GDIExporter.CGDIRenderTarget.DrawGlyphRun(Brush pBrush, GlyphRun glyphRun) at Microsoft.Internal.AlphaFlattener.BrushProxyDecomposer.Microsoft.Internal.AlphaFlattener.IProxyDrawingContext.DrawGlyphs(GlyphRun glyphrun, Geometry clip, Matrix trans, BrushProxy foreground) at Microsoft.Internal.AlphaFlattener.PrimitiveRenderer.DrawGlyphs(GlyphRun glyphrun, Rect bounds, Matrix trans, String desp) at Microsoft.Internal.AlphaFlattener.Flattener.AlphaRender(Primitive primitive, List`1 overlapping, Int32 overlapHasTransparency, Boolean disjoint, String desp) at Microsoft.Internal.AlphaFlattener.Flattener.AlphaFlatten(IProxyDrawingContext dc, Boolean disjoint) at Microsoft.Internal.AlphaFlattener.Flattener.Convert(Primitive tree, ILegacyDevice dc, Double width, Double height, Double dpix, Double dpiy, Nullable`1 quality) at Microsoft.Internal.AlphaFlattener.MetroDevice0.FlushPage(ILegacyDevice sink, Double width, Double height, Nullable`1 outputQuality) at Microsoft.Internal.AlphaFlattener.MetroToGdiConverter.FlushPage() at System.Windows.Xps.Serialization.NgcSerializationManager.EndPage() at System.Windows.Xps.Serialization.NgcSerializationManager.WalkVisual(Visual visual) at System.Windows.Xps.Serialization.NgcSerializationManager.SaveAsXaml(Object serializedObject) at System.Windows.Xps.XpsDocumentWriter.SaveAsXaml(Object serializedObject, Boolean isSync) at System.Windows.Controls.PrintDialog.PrintVisual(Visual visual, String description) at PrintFontTest.Window1.Print(PrintDialog dlg) in C:\Users\me\Documents\Visual Studio 2005\Projects\PrintFontTest\PrintFontTest\Window1.xaml.cs:line 72 The defect doesn’t occur when printing to the built-in “Microsoft XPS Document Writer” print driver, since that is apparently an XPS-native print driver. The defect will occur when printing to any regular GDI print driver. I’ve used a couple of commercial font validation programs to determine if the font files are corrupt. They are not. These fonts print fine using a win32-based app. It’s only in the XPS to GDI conversion code that the exception occurs, as the stack trace shows. These are the fonts I have installed on my system that cause the defect: A770-Deco A780-Deco A850-Deco Abilene Accent AdvertisersGothic Alfredo AmericanText B650-Deco B790-Deco B821-Deco BallantinesSerial Balloon Xbold Bristol C650-Script C720-Deco C790-Deco Cimarron Cimarron-CE Cimarron-Exp Cimarron-Fig Cimarron-PC8 Cornered D730-Deco D891-Deco Delaware DiamanteSerial Xlight Dom E820-Deco EgyptianWide Estelle F761-Deco F820-Deco Gandalf Greyhound Greyhound BoldItalic Hubert Hudson Ingrid Inverserif LookingGlass M730-Deco OrganGrinder PalazzoWerk Pittsburgh The exception occurs on both Vista and XP, and both 32-bit and 64-bit systems. Any help with this problem would be greatly appreciated. I can also supply a simple test application that demonstrates the defect (though you would need at least one of the problematic fonts installed). Thanks, Jeremy@criticalpath.com (GeneW) |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using the ObjectDataProvider always throws an exception... | Desmond Cassidy | Avalon | 1 | 06-20-2007 07:05 AM |
| SendKeys throws "Hook cannot be created" security exception in Vista Beta 2 | Dan Dautrich | Vista security | 1 | 03-28-2007 03:47 PM |
| Bug: MediaElement throws exception on application resize | Philippe Lavoie | Avalon | 2 | 05-01-2006 08:54 AM |
| BUG: MediaPlayer throws an exception after multiple play / pause | Philippe Lavoie | Avalon | 0 | 04-06-2006 04:04 PM |