Use custom font with AnnotationManager

Discussions about annotation support.
Post Reply
jannera
Posts: 2
Joined: Thu Jul 18, 2019 2:52 pm

Use custom font with AnnotationManager

Post by jannera » Tue Dec 29, 2020 1:34 pm

Hi

I'm using WPF GdViewer and I'm wondering if it's possible to use custom font when adding new TextAnnotation. I would like to use FontAwesome or another custom font to display simple images within text.

TextAnnotation seems to only have FontName property instead of FontFamily. I wonder if I can register custom fonts for the AnnotationManager/GdViewer so that TextAnnotation can use them without forcing user to install the fonts? Perhaps using PrivateFontCollection class somehow?

Code sample of how I add the annotation: (Doesn't work because I haven't installed the font on user's computer)

Code: Select all

var anno = GdViewer.GetAnnotationManager().AddTextAnnot(3, 3, 100, 20, "\uf0ca" + " text annotation");
anno.FontName = "Font Awesome 5 Free Solid";
Version: GdPicture.NET.14, Version=14.1.0.96

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Use custom font with AnnotationManager

Post by Fabio » Thu Aug 12, 2021 2:25 pm

Hello Jannera,

Sorry for the late!
At the moment, you can add your custom font using the AddTrueTypeFontU method through the GdPicturePDF class.
Here is the documentation: https://www.gdpicture.com/guides/gdpict ... ean).html

We do not have the parameter for the AnnotationManager class, do you want me to create a task for our developers to add this feature?

With best,
Fabio

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests