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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest