如何在Inkscape中向文本添加独特的彩色符号?

huangapple go评论118阅读模式
英文:

How do I add unique, colored symbols to text in Inkscape?

问题

I'm designing a card for a board game. I want a heart symbol to appear next to every mention of the word "health". Such as "<3 Health" but instead of text it's a unique path/object thing that looks like a heart. I may have as many as 12 of these symbols in a body of text.

Naturally you can add spaces and add the symbol yourself, but I'd like the symbol to scale with the size of the text, and for removing characters in the text to move the symbol, especially as the text area wraps.

英文:

I'm designing a card for a board game. I want a heart symbol to appear next to every mention of the word "health". Such as "<3 Health" but instead of text it's a unique path/object thing that looks like a heart. I may have as many as 12 of these symbols in a body of text.

Naturally you can add spaces and add the symbol yourself, but I'd like the symbol to scale with the size of the text, and for removing characters in the text to move the symbol, especially as the text area wraps.

答案1

得分: 0

这是Unicode的理想用法。您可以使用“标准”表情符号在某些常规字体中,使用扩展字体(例如Font Awesome)中的自定义表情符号,或者创建带有自定义符号的自定义字体。

以下是我在Inkscape中使用3种不同方法制作的SVG。

  • text1使用“标准”心形Unicode字符在Consolas字体中。
  • text2使用Font Awesome心形符号,使用HTML转义字符。
  • text3使用Font Awesome心形符号,使用Unicode字符。

如何在Inkscape中向文本添加独特的彩色符号?

英文:

This is an ideal use of Unicode. You can either use "standard" emoji in some normal font, custom emoji in an extended font (e.g. Font Awesome), or create your own custom font with your own custom symbols.

Here is an SVG I made in Inkscape using 3 different methods.

  • text1 uses the "standard" heart Unicode character in the consolas font
  • text2 uses the Font Awesome heart symbol using an HTML escape character
  • text3 uses the Font Awesome heart symbol using the Unicode character
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
&lt;svg width=&quot;200&quot; height=&quot;150&quot; viewBox=&quot;0 0 50 40&quot; version=&quot;1.1&quot; id=&quot;svg121&quot; inkscape:version=&quot;1.1.2 (b8e25be833, 2022-02-05)&quot; sodipodi:docname=&quot;temp.svg&quot; xmlns:inkscape=&quot;http://www.inkscape.org/namespaces/inkscape&quot; xmlns:sodipodi=&quot;http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:svg=&quot;http://www.w3.org/2000/svg&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:cc=&quot;http://creativecommons.org/ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;&gt;
 &lt;defs id=&quot;defs115&quot; /&gt;
 &lt;sodipodi:namedview id=&quot;base&quot; pagecolor=&quot;#ffffff&quot; bordercolor=&quot;#666666&quot; borderopacity=&quot;1.0&quot; inkscape:pageopacity=&quot;0.0&quot; inkscape:pageshadow=&quot;2&quot; inkscape:zoom=&quot;3.200266&quot; inkscape:cx=&quot;103.89761&quot; inkscape:cy=&quot;71.71279&quot; inkscape:document-units=&quot;px&quot; inkscape:current-layer=&quot;layer1&quot; inkscape:document-rotation=&quot;0&quot; showgrid=&quot;false&quot; units=&quot;px&quot; borderlayer=&quot;true&quot; inkscape:pagecheckerboard=&quot;0&quot; inkscape:window-width=&quot;1920&quot; inkscape:window-height=&quot;1001&quot; inkscape:window-x=&quot;-9&quot; inkscape:window-y=&quot;-9&quot; inkscape:window-maximized=&quot;1&quot; /&gt;
 &lt;metadata id=&quot;metadata118&quot;&gt;
  &lt;rdf:RDF&gt;
   &lt;cc:Work rdf:about=&quot;&quot;&gt;
    &lt;dc:format&gt;image/svg+xml&lt;/dc:format&gt;
    &lt;dc:type rdf:resource=&quot;http://purl.org/dc/dcmitype/StillImage&quot; /&gt;
   &lt;/cc:Work&gt;
  &lt;/rdf:RDF&gt;
 &lt;/metadata&gt;
 &lt;g inkscape:label=&quot;Layer 1&quot; inkscape:groupmode=&quot;layer&quot; id=&quot;layer1&quot; style=&quot;font-size:7px;line-height:1;font-family:consolas;text-align:center;text-anchor:middle&quot;&gt;
  &lt;text xml:space=&quot;preserve&quot; x=&quot;25&quot; y=&quot;10&quot; id=&quot;text1&quot;&gt;The &lt;tspan style=&quot;fill:#ff0000&quot; id=&quot;tspan1&quot;&gt;♥&lt;/tspan&gt;Heart&lt;/text&gt;
  &lt;text xml:space=&quot;preserve&quot; x=&quot;25&quot; y=&quot;20&quot; id=&quot;text2&quot;&gt;The &lt;tspan style=&quot;font-family:FontAwesome;fill:#ff0000&quot; id=&quot;tspan2&quot;&gt;&amp;#xf004;&lt;/tspan&gt;Heart&lt;/text&gt;
  &lt;text xml:space=&quot;preserve&quot; x=&quot;25&quot; y=&quot;30&quot; id=&quot;text3&quot;&gt;The &lt;tspan style=&quot;font-family:FontAwesome;fill:#ff0000&quot; id=&quot;tspan3&quot;&gt;&lt;/tspan&gt;Heart&lt;/text&gt;
 &lt;/g&gt;
&lt;/svg&gt;

如何在Inkscape中向文本添加独特的彩色符号?

huangapple
  • 本文由 发表于 2023年2月24日 05:03:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75550307.html
  • inkscape
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定