GetFontSize for Variable Text Annotations.
Part of feature work to make Pdfium more usable by mobile platforms that
wish to render comboboxes and textfields using custom displays. Will
return Tf font size for the annotation if applicable. This is obtained
from CPDFSDK_Widget because it is not guaranteed to be set on
CPDF_FormField which only sets font information if DR entry is present.
R=thestig@chromium.org
Bug: b/130297350
Change-Id: Iba866bb47cad78e2aa16343ae8d055887714e6f6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/53051
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Smith <rycsmith@google.com>
diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h
index f2622e6..7fb2405 100644
--- a/public/fpdf_annot.h
+++ b/public/fpdf_annot.h
@@ -591,6 +591,23 @@
FPDF_WCHAR* buffer,
unsigned long buflen);
+// Experimental API.
+// Get the float value of the font size for an |annot| with variable text.
+// If 0, the font is to be auto-sized: its size is computed as a function of
+// the height of the annotation rectangle.
+//
+// hHandle - handle to the form fill module, returned by
+// FPDFDOC_InitFormFillEnvironment.
+// annot - handle to an annotation.
+// value - Required. Float which will be set to font size on success.
+//
+// Returns true if the font size was set in |value|, false on error or if
+// |value| not provided.
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FPDFAnnot_GetFontSize(FPDF_FORMHANDLE hHandle,
+ FPDF_ANNOTATION annot,
+ float* value);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus