Custom Font Factory for Windows application

  • mchamberlain 2 months, 2 weeks ago

    I would like to utilize the Custom Font Factory feature of AR 11 Pro, for which I am licensed, but I am not able to get it working in a Windows application. I have attached a sample that has been put together using the examples I can find, but nothing seems to be working. It includes a free font that is not installed on my machine, and the label control on the section report has its style to use the font. The size is reading correctly, but not the font itself.

  • 12p
    Ruchir Agarwal12p 2 months, 2 weeks ago

    Hello,

    Thank you for sharing the sample application.
    We could observe the issue at our end and there seems to be Bug since the report did not show correct pdf output for your font “Jost_Futuristic_Style” however works perfectly with another font “Black Ball Tattoo Personal Use”.
    Hence I have escalated the same as Bug to the concerned team {Tracking Id: 232065}. I will update you once this is fixed.

    Regards
    Ruchir Agarwal

  • 12p
    Ruchir Agarwal12p 2 months, 1 week ago

    Hi

    This issue has been confirmed as Bug by the concerned team.
    The issue will be fixed in next Service Pack release of AR but if its critical for you then, I may ask the concerned team to create a Hot Fix for you.
    Hope to hear from you soon.

    Regards
    Ruchir Agarwal

  • mchamberlain 2 months, 1 week ago

    Ruchir-

    I would like to request a hotfix, as the Custom Font Factory is the main reason I recently upgraded from Standard to Pro. We are utilizing it in a product that is due for release in two weeks.

    Thanks,
    Mark

  • 12p
    Ruchir Agarwal12p 2 months, 1 week ago

    Hello Mark,

    I have updated the team with your request for Hot Fix. I Hope to provide you a Hot Fix soon.

    Thanks
    Ruchir Agarwal

  • 12p
    Ruchir Agarwal12p 2 months ago

    Hi Mark,

    You may download the Hot Fix using the following link:

    http://cdn.grapecity.com/ActiveReports/ar11/hotfixes/ActiveReports-v11.1.10036.0.msi

    Do let me know if you still face any problems or need any help.

    Thanks & Regards
    Ruchir Agarwal

  • mchamberlain 2 months ago

    Ruchir-

    Thank you for providing the hotfix. Unfortunately there has been no difference in the produced output though, so I wonder if I have a configuration problem. Let me point out a couple of important parts:

    1. This is a Windows application, not an ASP.Net application. I have added the entries from the online documentation for the Custom Font Factory to the App.Config since this application does not have a Web.Config. The documentation specifically references web implementations. Based on some testing using SetFallbackFont, I do not believe the configuration is being read. I did some searching and found that GrapeCity.ActiveReports.Web.FontFactorySectionHandler is specific for web projects. I found AR version 6 documentation that pointed to this inheriting from DataDynamics.ActiveReports.Export.Pdf.FontFactorySectionHandler, so I switched my App.Config type declaration to use GrapeCity.ActiveReports.Export.Pdf.FontFactorySectionHandler instead but am experiencing the same behavior. I am hoping the base FontFactorySectionHandler has not been removed in versions after 6.

    2. In the attached sample, I have a Fonts folder that gets copied to \Bin\Debug during compilation, and the fonts get copied to it. I do not work with virtual paths so I left the configuration value as “~/Fonts”. The desired font, which is not installed on my system but is in this folder, is still not displaying. The root cause is however I believe to incorrect configuration in #1.

    I have attached an updated sample. The first label should display in Courier New, which does exist on the system. The second label should display in the “Black Ball Tattoo Personal Use” font you referenced. If that part does not work, I would expect Courier New to be used for the second label based on my setting for SetFallbackFont. None of this is working as anticipated though.

  • 12p
    Ruchir Agarwal12p 2 months ago

    Hi Mark,

    1. You are right in adding the entries for the Custom Font Factory to the App.Config file of your application but instead of using GrapeCity.ActiveReports.Export.Pdf.FontFactorySectionHandler you need to keep using GrapeCity.ActiveReports.Web.FontFactorySectionHandler only.
    Your App.Config should be similar to the following:

    < ?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <configsections>
        <sectiongroup name="ActiveReports.PdfExport">
          <section name="FontFactory" type="GrapeCity.ActiveReports.Web.FontFactorySectionHandler, GrapeCity.ActiveReports.Web.v11, Version=11.1.10036.0" requirePermission="false"></section>
        </sectiongroup>
      </configsections>
       <activereports .PdfExport>
        <fontfactory Mode="File">
          <addfolder Path ="Fonts" Recurse="true"></addfolder>
            <addfontlink Font="Arial" List="Jost_Futuristic_Style"></addfontlink>     
        </fontfactory>
      </activereports>
      <startup> 
        <supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5"></supportedruntime>
       </startup>
    </configuration>

    After modifying the App.Config as above and using the HotFix provided the pdf document generated contain the “Jost_Futuristic_Style” font properly as desired (please refer to attached screen-shot “PDF_Jost_Futuristic_Style.png”). I have also attached the application “FontFactoryTester_modified” for you to test the same at your end.

    2. Thank you for attaching the sample.
    Could you please modify the app.config as suggested above and test if the issue replicates. If the issue still does not resolves could you please share a screen-shot pointing to the issue/problem you are facing.

    Thanks
    Ruchir Agarwal

    Attachments:
    1. PDF_Jost_Futuristic_Style

      PDF_Jost_Futuristic_Style.png

    1. FontFactoryTester_modified.zip
  • mchamberlain 2 months ago

    Ruchir-

    Success! In the end the cause was the following differences from what I understood in the documentation (there is no current documentation on this for V11 that I could find, all is V9 or older):

    1. The entry you provided for the FontFactory section name was slightly different than what I had tried to put together.
    2. Usage of Path vs. VirtualPath

    Once I integrated those changes, everything “just worked.” I did not have a need for the addFontLink tag so I did not carry that forward into my solution.

    Thank You so much for your assistance! This will work much better for our report distribution needs than making sure fonts are installed on individual computers.

    Mark

  • 12p
    Ruchir Agarwal12p 2 months ago

    Hello Mark,

    Thank you for informing. Glad to know that it solved your issue.

    However, for improvement purposes could you please specify (may be with the help of link) what information you could not find in ActiveReports11 documentation that was there in ActiveReports9 documentation and older, this would help us in getting the ActiveReports11 documentation updated with the missing information.

    Also, do let me know if you need any assistance in future.

    Regards
    Ruchir Agarwal

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.