FreeText Annotation TextStyle

I am using FreeText Annotations, in android sdk. I want to set TextStyle as Bold/Italic/Normal. Please tell me what API to use.

I think it’s setDefaultAppreance, but I didn’t get it. Please explain.


You need to do this by setting a different bold/italic font, and you set the font by calling setDefaultAppearance. So I would call getDefaultAppearance, and look for the following entry.

“/op1 op2 Tf” and change op1 to a font, and the call the setting. Note the “/” forward slash character for op1, this is required for the Tf operator. op2 is the font size.

The following are the 14 built in fonts. I would use one of these, as picking an arbitrary font and making it work with the default appearance setting is more work to get right.

Times-Roman, Helvetica, Courier, Symbol, Times-Bold, Helvetica-Bold, Courier-Bold, ZapfDingbats, Times-Italic, HelveticaOblique, Courier-Oblique, Times-BoldItalic, Helvetica-BoldOblique, Courier-BoldOblique

We are looking to improve this interface but there is no concrete plan/timeline yet.