【问题标题】:SVG textLength doesn't work, any other solution?SVG textLength 不起作用,还有其他解决方案吗?
【发布时间】:2016-01-18 22:37:49
【问题描述】:

我在处理 SVG 文本时遇到了一些问题,谁能帮帮我?

我想在我已经绘制的多边形内放置一个文本。文字的中心是完美的,但我无法控制文字的大小。

无论我为 textLength 设置什么,文本与inkscape 保持一致。

<text id="monId" x="100" y="70" textLength="100" lengthAdjust="spacingAndGlyphs" fill="red" stroke="darkred" stroke-width=".2" alignment-baseline="middle" text-anchor="middle">Mon texte</text>

如何控制文字的长度(和高度)? text-font 可以改变大小,但它没有显示精确的大小。 text-font="55" 与文本长度的关系究竟意味着什么?我试过 text-font="55px" 但它没有改变任何东西:它比 55 像素大。

非常感谢

【问题讨论】:

  • 您可以尝试将其转换为定义并将其作为 元素插入。没试过 - 只是一个建议。
  • 您要查找的属性是font-size 而不是text-font

标签: text svg fonts size inkscape


【解决方案1】:

也许您正在寻找 inkscape 中的字母间距和行间距:

字母间距

Alt +>  expand line/paragraph by 1 
Shift + Alt +>  expand line/paragraph by 10 pixels
Alt +<  contract line/paragraph by 1 pixel
Shift + Alt +<  contract line/paragraph by 10 pixels
These commands (only when editing text) adjust letter spacing in the current line (regular text) or paragraph (flowed text).
The actual adjustment for pixel movements depends on zoom level. Zoom in for finer adjustment.

行距

Ctrl + Alt +>   make the text object taller by 1 pixel
Shift + Ctrl + Alt +>   make the text object taller by 10 pixels
Ctrl + Alt +<   make the text object shorter by 1 pixel
Shift + Ctrl + Alt +<   make the text object shorter by 10 pixels
These commands (only when editing text) adjust line spacing in the entire text object (regular or flowed).
The actual adjustment for pixel movements depends on zoom level. Zoom in for finer adjustment.

来源:Inkscape shortcuts

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多