元編程參考文件

單線書寫

3 個節點

本頁內容 3

測量墨跡

函數

The rectangle the ink of a run occupies, relative to the run's origin, without the nib's
own width.

簽名
測量墨跡 -> (低精度數字, 低精度數字, 低精度數字, 低精度數字)
    字型: Stroke Font
    文字: 文字
    大寫字母高度: 低精度數字
    傾斜: 低精度數字
(float, float, float, float) MeasureInk(
    StrokeFont font,
    string text,
    float capHeight,
    float slant = -0.1f)

參數

名稱型別預設值說明
字型Stroke Font—
文字文字—
大寫字母高度低精度數字—
傾斜低精度數字-0.1

返回

結果(低精度數字, 低精度數字, 低精度數字, 低精度數字)

備註

Traced rather than derived from the font's metrics, because that is the only answer that is
right for a face whose glyphs lean and overshoot. A run that puts no ink on the paper at all -
nothing but spaces - reports its advance by the cap height instead, so that a caller sizing an
image around it gets a picture rather than a one-pixel sliver.

所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
單線書寫
所屬包
影像處理

書寫文字

函數

Writes a run of text into a new image sized to the ink.

簽名
書寫文字 -> Pixel Image
    文字: 文字
    字型: Stroke Font
    大寫字母高度: 低精度數字
    墨水顏色: 可選顏色
    背景顏色: 可選顏色
    內邊距: 低精度數字
    傾斜: 低精度數字
    筆: Nib
    進度: 低精度數字
PixelImage WriteText(
    string text,
    StrokeFont font,
    float capHeight = 64f,
    ColorElement? inkColor,
    ColorElement? backgroundColor,
    float padding = 16f,
    float slant = -0.1f,
    Nib pen,
    float progress = 1f)

參數

名稱型別預設值說明
文字文字—The text to write.
字型Stroke Font—The face to write with; the embedded Hershey Script when not given.
大寫字母高度低精度數字64Height from baseline to cap line, in pixels.
墨水顏色可選顏色—The ink. Black when not given.
背景顏色可選顏色—The paper. Transparent when not given.
內邊距低精度數字16Margin around the ink, in pixels.
傾斜低精度數字-0.1Shear per unit of height; negative leans right, as a hand does.
筆Nib—The nib to sweep; a fountain pen scaled to the cap height when not given.
進度低精度數字1How much of the pen's journey to show, 0 to 1.

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
單線書寫
所屬包
影像處理

書寫到影像上

函數

Writes a run of text onto an image the caller already has.

簽名
書寫到影像上 -> Pixel Image
    原圖: Pixel Image
    文字: 文字
    X: 低精度數字
    基線: 低精度數字
    字型: Stroke Font
    大寫字母高度: 低精度數字
    墨水顏色: 可選顏色
    傾斜: 低精度數字
    筆: Nib
    進度: 低精度數字
    就地: 真否
PixelImage WriteTextOnto(
    PixelImage original,
    string text,
    float x,
    float baseline,
    StrokeFont font,
    float capHeight = 64f,
    ColorElement? inkColor,
    float slant = -0.1f,
    Nib pen,
    float progress = 1f,
    bool inPlace = true)

參數

名稱型別預設值說明
原圖Pixel Image—The image to write on.
文字文字—The text to write.
X低精度數字—Where the run starts.
基線低精度數字—The baseline the run sits on.
字型Stroke Font—The face to write with; the embedded Hershey Script when not given.
大寫字母高度低精度數字64Height from baseline to cap line, in pixels.
墨水顏色可選顏色—The ink. Black when not given.
傾斜低精度數字-0.1Shear per unit of height; negative leans right, as a hand does.
筆Nib—The nib to sweep; a fountain pen scaled to the cap height when not given.
進度低精度數字1How much of the pen's journey to show, 0 to 1.
就地真否TrueWhether to write onto the caller's image or onto a copy.

返回

結果Pixel Image
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
單線書寫
所屬包
影像處理