元编程参考文档

单线书写

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
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
单线书写
所属包
图像处理