←Select platform

CustomFonts Property

Summary
Gets the list of custom fonts attached to this AnnAndroidRenderingEngine.
Syntax
Java
 public static HashMap<String, Typeface> getCustomFonts() 

Property Value

The list of custom fonts attached to this AnnAndroidRenderingEngine.

Remarks

You can use this CustomFonts list to add a user-defined font with a specific key to the rendering engine and use it when drawing text objects.

Follow the steps below to use your custom font with text-based objects:

  1. Add your custom font to the demo as a resource (such as verdana.ttf) and create a typeface object.

    Java
    Typeface verdana = ResourcesCompat.getFont(this,R.font.verdana); 

  2. Attach the newly created typeface object to the CustomFonts list.

    Java
    AnnAndroidRenderingEngine.getCustomFonts().put("verdana",verdana); 

  3. Now you can create your font with a custom font name and set it to the annotation text based object.

    Java
    AnnFont font = new AnnFont("verdana",12); 
    annObject.setFont(font); 
    Notice that when creating AnnFont, the fontFamily should be the same as the key of the custom font you added to the custom fonts list in step 2 above (such as "verdana").

Requirements

Target Platforms

Help Version 21.0.2021.6.30
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Rendering.WinForms Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.