Closed andob closed 2 years ago
Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/
Hi @andob, been checking on this issue, the glyphs are missing because the font didn't support those glyphs. Here's a code snippet and font that I use to get the result without missing glyphs.
package main
import (
"fmt"
"os"
"github.com/unidoc/unipdf/v3/common/license"
"github.com/unidoc/unipdf/v3/creator"
"github.com/unidoc/unipdf/v3/model"
)
func main() {
err := license.SetMeteredKey(os.Getenv("UNIDOC_LICENSE_API_KEY"))
if err != nil {
panic(err)
}
font, err := model.NewCompositePdfFontFromTTFFile("times.ttf")
if err != nil {
panic(err)
}
pdf := creator.New()
pdf.SetPageSize(creator.PageSizeA4)
pdf.SetPageMargins(30, 30, 30, 30)
paragraph := pdf.NewParagraph("ĂÂÎŞŢăâîşţ")
paragraph.SetFont(font)
paragraph.SetFontSize(50)
paragraph.SetTextAlignment(creator.TextAlignmentCenter)
err = pdf.Draw(paragraph)
if err != nil {
panic(err)
}
err = pdf.WriteToFile("diacritics.pdf")
if err != nil {
panic(err)
}
fmt.Println("PDF was generated!")
}
Font: arial.zip Result: diacritics.pdf
thanks!
Description
When trying to generate a PDF containing text with romanian diacritics, some diacritics will not get displayed in the generated PDF file.
Steps to reproduce
Expected Behavior
A PDF file containing ĂÂÎŞŢăâîşţ
Actual Behavior
A PDF file containing only ÂÎâî
Attachments
diacritics.pdf