-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
could not locate "helveticaBB" #18
Comments
@vladyslav2 Since the gotopdf project is closed, do you have any ideas about how to address this (short of forking it)? |
@mandolyte based on the error, it looks like gotopdf does have some default settings for various fonts (italic, bold, semi-bold and etc) and helveticaBB does not support all of those font variations. My best shot - check gotopdf settings and see if its configurable |
Debugged it. The request into the SetFont method is "Arial" with Style "bb". This is being converted to "Hevetica" with style "bb". This is not defined as can be seen here: https://github.com/go-pdf/fpdf/tree/main/font_embed This proves of course that the issue is either in blackfriday parser or in mdtopdf |
Not a fix but a functioning workaround: func (r *PdfRenderer) processText(node *ast.Text) {
currentStyle := r.cs.peek().textStyle
if currentStyle.Style == "bb" {
currentStyle.Style = "b"
}
r.setStyler(currentStyle) |
Hi @FrankStienhans2 , Thank you for the debugging info. I'll take a look at it. If you want a workaround pro tem, I'd suggest applying it in func (r *PdfRenderer) setStyler(s Styler) {
if s.Style == "bb" {
s.Style = "b"
}
r.Pdf.SetFont(s.Font, s.Style, s.Size)
r.Pdf.SetTextColor(s.TextColor.Red, s.TextColor.Green, s.TextColor.Blue)
r.Pdf.SetFillColor(s.FillColor.Red, s.FillColor.Green, s.FillColor.Blue)
} |
So, the problem is here: https://github.com/mandolyte/mdtopdf/blob/master/nodeProcessing.go#L299 This can be easily solved with something like: if entering {
if ! strings.Contains(r.cs.peek().textStyle.Style, "b"){
r.cs.peek().textStyle.Style += "b"
}
... But, because the code (rightly) removes the "b" when Cheers, |
Hello, I encountered similar error, For now I need to manually remove the |
Problem
While working with this library I found an interesting case. If you create this markdown
and when you try to convert, you will get an error:
Additional info
My understanding, gotopdf missing some fonts for italic headers
The text was updated successfully, but these errors were encountered: