Open ales6164 opened 6 years ago
I just guess, the issue is number format of font size. check your output pdf file (or debugging) format of font size should look like in this picture
*12 in picture is font size
Is this feature/issue something that you would be willing to resolve and implement floating font size in your project? I've been looking at it for quite some time now and haven't made any progress.
@ales6164 Check https://github.com/signintech/gopdf/blob/master/cache_content_text.go#L127 There your number gets formated as int ( %d ) not as a float ( %f )
I dont know if a float world even work. The specs are pretty non specific about that.
I dont know if a float world even work.
The PDFReference (for 1.4) says "[font] size is a number representing a scale factor" (TABLE 5.2 "Text state operators", in the description of the Tf
-operator). And Section 3.2.2 "Numeric Objects" says "Throughout this book, the term number refers to an object whose type may be either integer or real."
I read that as "font size can be int or float", and looking at PDFs "in the wild", or what other PDF-generating libs do (e.g. iText setFontSize(float)
)... a float is fine :)
@oneplus1000 can you close this issue if it has been resolved? Looks like https://github.com/signintech/gopdf/pull/192 would have resolved the issue.
I've forked your project and updated font size types to float64. Now it doesn't display any text. Do you have any idea what could be the issue?