英文:
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字符。
英文:
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="200" height="150" viewBox="0 0 50 40" version="1.1" id="svg121" inkscape:version="1.1.2 (b8e25be833, 2022-02-05)" sodipodi:docname="temp.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs id="defs115" />
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="3.200266" inkscape:cx="103.89761" inkscape:cy="71.71279" inkscape:document-units="px" inkscape:current-layer="layer1" inkscape:document-rotation="0" showgrid="false" units="px" borderlayer="true" inkscape:pagecheckerboard="0" inkscape:window-width="1920" inkscape:window-height="1001" inkscape:window-x="-9" inkscape:window-y="-9" inkscape:window-maximized="1" />
<metadata id="metadata118">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" style="font-size:7px;line-height:1;font-family:consolas;text-align:center;text-anchor:middle">
<text xml:space="preserve" x="25" y="10" id="text1">The <tspan style="fill:#ff0000" id="tspan1">♥</tspan>Heart</text>
<text xml:space="preserve" x="25" y="20" id="text2">The <tspan style="font-family:FontAwesome;fill:#ff0000" id="tspan2">&#xf004;</tspan>Heart</text>
<text xml:space="preserve" x="25" y="30" id="text3">The <tspan style="font-family:FontAwesome;fill:#ff0000" id="tspan3"></tspan>Heart</text>
</g>
</svg>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。



评论