Ticket T195586
Visible to All Users

ASPxReportDesigner / MVCxReportDesigner - Provide a capability to use custom fonts

created 10 years ago

The user will have a MICR font they will use. We need to be able to

  1. Show the MICR font in the web report designer. The font will be on the users machine. Each user may have a different MICR font.

  2. Use the font selected by the user when exporting the report to pdf in the MVC applications controller method.

What steps do we have to do take to accomplish the above?

Comments (2)
Dmitry Tokmachev (DevExpress) 10 years ago

    Hello Chad,Thank you for your valuable input.

    I'm afraid that at the moment the ASPxReportDesigner component has only a predefined fonts list and there is no easy way to achieve this goal. At the moment, you can use the following workaround to achieve this goal:

    ASPx
    <script type="text/javascript"> //Adding custom font to the fonts list DevExpress.Designer.fontInfoFake.filter(function (value) { return value.displayName === "Font Name"; })[0].values["Custom Font Name"] = "Custom Font Name"; </script>

    In case it is also necessary to force the report controls to draw text using a custom font right within the ASPxReportDesigner, add the following style:

    ASPx
    <style type="text/css"> @font-face { font-family: "Custom Font Name"; src: url(Fonts/Custom_Font_File.ttf); } </style>

    Please note that this workaround will allow you to use custom fonts that are taken from the server side.

    I believe that this feature makes sense in case it is introduced out of the box, so I've taken the liberty to convert this thread to a feature-request thread. This thread is forwarded to our R&D team for further research so that they'll consider implementing this feature in our future releases. We'll update this thread with the corresponding information as soon as we have any results.

    Would you mind if I make this thread public so that our other customers will be able to track our progress with this feature?

    Thank you for sharing your ideas with us and helping us improve our products,
    Dmitry

      sure, you can set it to public. I wish next version can more think over  Asian people

      Answers approved by DevExpress Support

      created 9 years ago (modified 6 years ago)

      We have implemented the functionality described in this ticket. It will be included in our next update(s).

      Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.

      Additional information:

      To provide the capability to use custom fonts within the Web Report Designer, we have added the updateFont method to the client-side Report Designer model. To register a custom font, call this method with a specified key-value pair, where key is the font name and value is its display name. The code sample below demonstrates how to register a custom font in the Web Report Designer's client-side Init event.

      ASPx
      <dx:ASPxReportDesigner ID="ASPxReportDesigner1" runat="server"> <ClientSideEvents Init="function(s){ s.designerModel.updateFont({'Custom Font Name': 'Custom Font Name'}); delete DevExpress.JS.Widgets.availableFonts['Arial']; } " /> </dx:ASPxReportDesigner>
        Comments (2)
        PI PI
        Prima Informática 8 years ago

          I did the same process on my Report Design and works fine. But, when a user tries to print the report the font don't look like  expected. Should I do some configuration on WebDocumentViewer?

          Vasily (DevExpress Support) 8 years ago

            Hello Eduardo,

            To avoid discussing multiple topics in this thread, I have extracted it to a separate ticket created on your behalf: T507683: WebDocumentViewer - How to use a custom font. It has been placed in our processing queue and will be answered shortly.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.