I think you want to include the original font data. When you parse the font in 
Go it only needs the hints/fidelity for the Go renderer. When you create the 
pdf you want to have the full font for optimum rendering. 

> On Feb 4, 2021, at 2:00 PM, Sebastien Binet <s...@sbinet.org> wrote:
> 
> yes.
> but as I wrote in the OP, it's not completely satisfying.
> one needs to keep track of the association font.Face/[]byte.
> so that's either double the memory (give or take), or a filename/io.Reader 
> handle to keep around.
> 
> -s
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
>> On Thursday, February 4th, 2021 at 8:28 PM, Robert Engels 
>> <reng...@ix.netcom.com> wrote:
>> 
>> If you have the data to pass to Parse then you have the data to embed the 
>> font in the pdf.
>> 
>>>> On Feb 4, 2021, at 12:02 PM, Sebastien Binet s...@sbinet.org wrote:
>>> 
>>> hi there,
>>> 
>>> Right now, I am pretty happy with the state of the
>>> 
>>> x/image/font{,/sfnt,/opentype}} packages. I can load TTF/OTF files, draw
>>> 
>>> some glyphs in a way that (almost) resembles LaTeX1.
>>> 
>>> Great. (and many thanks, by the way.)
>>> 
>>> We migrated gonum/plot2 from freetype to x/image/font recently and all
>>> 
>>> our use cases worked well (as far as I know.)
>>> 
>>> Well, all, save for one: being able to embed fonts into PDFs.
>>> 
>>> To some extent, embedding fonts into PDF files needs to re-serialize
>>> 
>>> sfnt.Font back into a []byte following the OTF format.
>>> 
>>> Unless I am mistaken, x/image/font doesn't seem to provide the reverse
>>> 
>>> function of sfnt.Parse.
>>> 
>>> (This is a bit annoying because one needs to provide a way to associate
>>> 
>>> a given font.Face or sfnt.Font with its original []byte raw data.)
>>> 
>>> Is it something that x/image/font should or would provide?
>>> 
>>> --
>>> 
>>> You received this message because you are subscribed to the Google Groups 
>>> "golang-nuts" group.
>>> 
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to golang-nuts+unsubscr...@googlegroups.com.
>>> 
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/mDlexRfwWwESA2w9pIRqq4SD72RMobdQ109RV5g0uQ%40cp3-web-020.plabs.ch.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0C0E2F5C-DB82-4CEE-A343-28E7277AF0A2%40ix.netcom.com.

Reply via email to