<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="302701" data-post-id="302701">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If for some reason that’s not possible in <code>revsg</code> you can do it in <a href="https://hex.pm/packages/image" rel="nofollow">image</a> with:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">"&lt;svg&gt; .....&lt;/svg&gt;"
|&gt; Image.from_svg!()
|&gt; Image.write(conn)
</code></pre>
<p>Unfortunately the underlying <a href="https://hex.pm/packages/vix" rel="nofollow">vix</a> isn’t supported on Windows so if that’s a requirement then this isn’t the solution for you.  Also it uses <code>librsvg</code> as the svg renderer, not <code>libresvg</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="302701" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-302701" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="302701"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="302702" data-post-id="302702">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MRdotB" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/MRdotB/120/30487_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MRdotB
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Is your input a svg file or a svg as a string ?<br>
If it’s a svg as a string there is <a href="https://hexdocs.pm/resvg/Resvg.html#svg_string_to_png_buffer/2" rel="noopener nofollow ugc">svg_string_to_png_buffer/2</a><br>
I did not implement svg_to_png_buffer but it should be easy.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="302702" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-302702" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="302702"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="325617" data-post-id="325617">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Unlike what I’ve written above, my data visualization library is currently using Resvg instead of Typst due to serious performance problems when I try to use Typst to render visualizations with &gt; 1000 elements/datapoints.</p>
<p>Currently I’m generating SVG files, and I use Resvg (with the query_all function) to get text dimensions. And also to render SVGs into PNG.</p>
<p>However, one often wants to export SVG as PDF or at least to publish SVG files with embedded fonts so that rendering is reproducible.</p>
<p>I’ve thought of the following:</p>
<ol>
<li>
<p>Would you include functionality to render SVG into PDF using the <code>svg2pdf</code> crate? Or do you think it is out of scope for your library?</p>
</li>
<li>
<p>Regarding the embedding of fonts… Does Resvg provide a way of querying the SVG file for the fonts that are actually used so that one knows which fonts to embed?</p>
</li>
</ol>
<p>If this is considered out of scope for Resvg, would you like to add the relevant NIF functionality to my Quartz package? This later option would be quite convenient because I might want to add further rust libraries for more calculation-intensive tasks.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="325617" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-325617" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="325617"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="325874" data-post-id="325874">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MRdotB" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/MRdotB/120/30487_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MRdotB
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><img src="https://forum.elixirforum.com/images/emoji/apple/wave.png?v=15" title=":wave:" class="emoji" alt=":wave:" loading="lazy" width="20" height="20"> Hello thanks for your last contribution,</p>
<ol>
<li><a href="https://github.com/RazrFalcon/resvg?tab=readme-ov-file" rel="noopener nofollow ugc">Resvg</a> does not provide pdf export so this is out of scope.</li>
<li>I did not found a way to access it out of the box in resvg but it’s in the <a href="https://github.com/RazrFalcon/resvg/blob/master/crates/usvg/src/parser/text.rs#L282" rel="noopener nofollow ugc">data tree</a>. So doing a filter by text node / uniq by font should work. This feature could be a useful addition to resvg_nif.</li>
</ol>
<p>I don’t have much time to work on OSS this days I will maintain and review PR but that’s all.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="325874" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-325874" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="325874"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="325935" data-post-id="325935">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dkuku" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dkuku/120/15613_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dkuku
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey <a class="mention" href="/u/mrdotb" rel="nofollow">@MRdotB</a>. I recently started playing with rustler and I wanted to check how did you annotate the functions with nif scheduler but It’s missing. Do you think it should include dirty_io when loading a file and dirty_cpu when processing it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="325935" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-325935" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="325935"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="325941" data-post-id="325941">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MRdotB" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/MRdotB/120/30487_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MRdotB
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In my current use case, the execution of NIFs for creating small images is instantaneous, which is ideal. However, this might pose a problem when rendering large and complex SVG which is more cpu intensive. Flagging them as <code>DirtyCpu</code> is probably what’s needed.<br>
It’s worth noting that this is my first and only experience with Elixir NIFs, so I’m open to further insights <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"><br>
<a href="https://docs.rs/rustler/latest/rustler/attr.nif.html" rel="noopener nofollow ugc">doc</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="325941" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-325941" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="325941"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="325946" data-post-id="325946">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>For complex Quartz plots (i.e. &gt; 20,000 data points) rendering to PNG is definitely not instantaneous, but that is admittedly an unusual case…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="325946" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-325946" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="325946"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="326120" data-post-id="326120">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Would you mind if I copied the <code>resvg_code</code> into my package so that I could tweak it for my use case? I agree with you that Resvg shouldn’t try to be too generic. I promise I won’t bother you with questions regarding the modified code. I understand if you don’t want slightly modified versions of your code in other projects, though.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326120" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-326120" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326120"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="326125" data-post-id="326125">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MRdotB" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/MRdotB/120/30487_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MRdotB
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sure it’s MIT license you can fork and do whatever <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326125" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-326125" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326125"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="342981" data-post-id="342981">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="MRdotB" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/MRdotB/120/30487_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  MRdotB
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks to <a class="mention" href="/u/tmbb" rel="nofollow">@tmbb</a>’s PR, <a href="https://hexdocs.pm/resvg/readme.html" rel="noopener nofollow ugc">resvg v0.4.0</a> is out!</p>
<ul>
<li>Fixed a rendering issue with <code>&lt;tspan&gt;</code> inside <code>&lt;text&gt;</code> by upgrading underlying Rust libraries (resvg, usvg).</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="342981" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/resvg-svg-rendering-in-elixir-with-rust/56635/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-342981" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="342981"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/56635/load_more?page=3">Load more posts</a>
</div></template></turbo-stream>