locked
Cannot find font '?' RRS feed

  • Question

  • User766478441 posted
    I'm working with a web chart control that's giving me the error below. It works fine on my ISPs Win 2003 server but throws this exception on my Win 2000 Server box. I'm guessing that I don't have the font its looking for on my server (GenericSansSerif). Is it just a matter of copying some fonts over? Thanks. Cannot find font '?'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Cannot find font '?'. Source Error: Line 41: Line 42: Line 43: <web:chartcontrol runat="server" id="ChartControl1" Line 44: height="400" width="350" gridlines="none" legend-position="Bottom" /> Source File: D:\Inetpub\BoardAnalystDev\rss\chart.compensation.aspx Line: 43 Stack Trace: [ArgumentException: Cannot find font '?'.] System.Drawing.FontFamily.get_GenericSansSerif() +75 System.Drawing.Font.CreateFontFamilyWithFallback(String familyName) +86 System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit) +18 System.Drawing.Font..ctor(String familyName, Single emSize) +35 WebChart.ChartText..cctor() +31 [TypeInitializationException: The type initializer for "WebChart.ChartText" threw an exception.] WebChart.ChartText.get_DefaultFont() +0 WebChart.ChartLegend..ctor() +63 WebChart.ChartEngine..ctor() +237 WebChart.ChartControl..ctor() +78 ASP.chart_compensation_aspx.__BuildControlChartControl1() in D:\Inetpub\BoardAnalystDev\rss\chart.compensation.aspx:43 ASP.chart_compensation_aspx.__BuildControlTree(Control __ctrl) in D:\Inetpub\BoardAnalystDev\rss\chart.compensation.aspx:1 ASP.chart_compensation_aspx.FrameworkInitialize() System.Web.UI.Page.ProcessRequest() +85 System.Web.UI.Page.ProcessRequest(HttpContext context) +18 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
    Friday, December 10, 2004 9:59 AM

All replies

  • User-960547388 posted
    I think there's something going terribly wrong on your w2k box. Default behaviour of GDI+ is that it falls back to generic system font if requested font isn't found. And that's exactly what it's trying to do in your case by calling System.Drawing.FontFamily.get_GenericSansSerif(). For some odd reason your system isn't able to determine a generic default font. To answer your question, in order the new fonts to work they must be installed in the system fonts. There's a way to load fonts dynamicaly, unfortunately I don't remember exact way.
    Friday, December 17, 2004 11:07 AM
  • User1157455073 posted

    I have the same issue. Did you solve it?

    Wednesday, October 18, 2006 6:22 AM
  • User-538024033 posted

    Me too.  Any solutions?

    Thursday, August 21, 2008 5:32 PM