This is a migrated thread and some comments may be shown as answers.

New Fonts

8 Answers 144 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
elaheh
Top achievements
Rank 1
elaheh asked on 03 Mar 2012, 08:43 AM
Hello,
How can I add new fonts to "Add Text" in ImageEditor?
(I have added the new fonts by customizing Add Text dialog, but it doesn't apply on the text) 
Thank you

8 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 Mar 2012, 11:35 AM
Hello,

I tested the customized Add Text dialog in the Customize Built-in Dialogs live demo and I was unable to reproduce the reported problem. Could you please see my test in the following video http://screencast.com/t/xdghYax3CiFa and let me know what I am missing?

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
elaheh
Top achievements
Rank 1
answered on 06 Mar 2012, 08:32 AM
Hello,
Thanks for your reply.
I have used this code in AddText.ascx:
 <telerik:RadComboBoxItem Text="Courier New" Value="courier new" />
        <
telerik:RadComboBoxItem Text="Georgia" Value="georgia" />
        <
telerik:RadComboBoxItem Text="Ms Sans Serif" Value="ms sans serif" />
Is this enough for applying the fonts on text?
when I choose one of this fonts and write some text, the font is applied on the shown text. But when I click Insert, my text doesn't have the specified font which had been shown before inserting.
This problem occurs only when I publish my page over the internet, and it doesn't have any problem in localhost.
0
elaheh
Top achievements
Rank 1
answered on 06 Mar 2012, 10:08 AM
Sorry, it seems that the problem is just related to some fonts like this.
Is there any solution for it?
0
Slav
Telerik team
answered on 08 Mar 2012, 12:37 PM
Hello,

Note that the linked fonts are custom and they cannot be used on your page out-of-the-box. You should ensure that they are installed on your server or that they are added to the fonts, used by your browser. After this is done, you will be able to utilize the specified fonts on the page, including in the Add Text dialog of RadImageEditor.

Kind regards,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
elaheh
Top achievements
Rank 1
answered on 09 Apr 2012, 09:02 AM
Hello,
Thanks for your reply.
I requested for installing my fonts on server, but they told me that it is not possible to install the fonts on server.
Is there another solution for useing those fonts? May I upload the fonts and call them in AddText dialog?
0
Slav
Telerik team
answered on 09 Apr 2012, 04:08 PM
Hello Elaheh,

The custom fonts should be installed on the machine that runs your application. Only the fonts that are available on the sever can be used for modifying the text in the edited image. This is a requirement of the .NET Framework and it cannot be circumvented.

Greetings,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
elaheh
Top achievements
Rank 1
answered on 15 Apr 2012, 09:55 AM
Hello,
I found that there is a way to use fonts which are uploaded on server, in ASP.NET:
PrivateFontCollection pr = new PrivateFontCollection();
       pr.AddFontFile(Server.MapPath("BNazanin.ttf"));
       Font font = new Font(pr.Families[0], 16.0f, FontStyle.Bold, GraphicsUnit.Point);
Isn't there any solution like this, for adding fonts in telerik image editor?
Thanks
0
Niko
Telerik team
answered on 18 Apr 2012, 11:09 AM
Hello,

This approach of loading custom fonts in the .NET environment is possible. However the drawback is that once loaded they should be used in the same context. Therefore you need to load them when the image is being edited. As currently there is no way to extend the graphics core of the ImageEditor without modifying the control itself, another solution should be found.

This could be a custom handling of the OnImageEditing event, where you should cancel the default execution of the event when the CommandName is AddText and do the manipulations on the image using custom code. Here is an example from our help pages - http://www.telerik.com/help/aspnet-ajax/radimageeditor-custom-server-side-operations.html

Hope this helps.


All the best,
Niko
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ImageEditor
Asked by
elaheh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
elaheh
Top achievements
Rank 1
Slav
Telerik team
Niko
Telerik team
Share this question
or