Skip to content

SVG to PDF encoding error #1239

Discussion options

You must be logged in to vote

Thank you for your suggestion. I found that either style="font-family: ... or "font-family: ..." works. I used the latter because of the definition. But to work it needs font as the name not the path and font_families to be added.

require 'victor'
require 'prawn-svg'
require 'prawn'

svgout = Victor::SVG.new

svgout.build { text "木", x: 100, y: 100, "font-family": "YuMin" }

Prawn::Document.generate("svg.pdf") do
	font_families.update({'YuMin' => {normal: { file: "#{ENV["HOME"]}/Library/Fonts/yumin.ttf"}, font: 'YuMincho-Medium'}})
	font 'YuMin'
	svg svgout.render
end

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@pointlessone
Comment options

@fidothe
Comment options

@tsurezuregusa
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@tsurezuregusa
Comment options

@fidothe
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by tsurezuregusa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants