DrawFormula

文字、公式排版、向量圖形

描述

以目前的字型、文字大小、文字顏色、字形後備設定與向量規則繪製數學公式

語法

Delphi

Function TPDFlib.DrawFormula(Left, Top: Double; Const Formula, AltText: WideString): Integer;

ActiveX

Function PDFlib::DrawFormula(Left As Double, Top As Double, Formula As String, AltText As String) As Long

DLL

int DLDrawFormula(int InstanceID, double Left, double Top, const wchar_t * Formula, const wchar_t * AltText);

參數

Left公式邊界框的水平位置
Top公式邊界框的上緣
Formula受支援數學標記表示的公式來源
AltText自動標記開啟 Formula 結構元素時使用的無障礙朗讀描述

傳回值

繪製後傳回 1;Formula 為空時傳回 0

備註

分式用 \frac{a}{b},上下標用 x^{2} 與 x_{i},根號用 \sqrt{x} 或 \sqrt[3]{x},符號則用 \alpha、\Gamma、\times、\sum、\infty 這類指令群組可以巢狀;字型狀態不變時,重複量測或繪製會重用已解析的版面

The DLL

DLDrawFormulaA 變體依設定的 ANSI 模式接受文字