3
25
Fork
You've already forked fpdf
10

Makefont fails! #64

Open
opened 2024年04月03日 22:57:06 +02:00 by lordofscripts · 4 comments
lordofscripts commented 2024年04月03日 22:57:06 +02:00 (Migrated from github.com)
Copy link
  • I downloaded the Amaranth TrueType fonts from Google Fonts
  • I compiled the makefont.go source and also downloaded both the cp1252 & iso-8859-1 map files

However, when running it as indicated in the utility help instructions:

makefont --dst embed/fonts --embed --enc embed/fonts/cp1252.map ~/.fonts/Amaranth-Regular.ttf

And I get this error:

Unexpected EOF

The same error occurs when I omit the --embed option.

- I downloaded the **Amaranth** TrueType fonts from **Google Fonts** - I compiled the makefont.go source and also downloaded both the cp1252 & iso-8859-1 map files However, when running it as indicated in the utility help instructions: ``` makefont --dst embed/fonts --embed --enc embed/fonts/cp1252.map ~/.fonts/Amaranth-Regular.ttf ``` And I get this error: ``` Unexpected EOF ``` The same error occurs when I omit the `--embed` option.
lordofscripts commented 2024年04月11日 18:12:19 +02:00 (Migrated from github.com)
Copy link

Really need to use as nicer-looki g font other than the defaults, unfortunately make font seems to be hopelessly broken. It always says "Unexpected EOF" when fed a TTF font file.

At least the original FPDF project had an online version. Unfortunately the GO version uses a JSON file so I am stuck on trying to use a non-default font.

If not can anybody point me to a similarly capable GO PDF creation package that is actually supported? I noticed there is also a jung-kurt/gofpdf but it was archived in 2021.

Really need to use as nicer-looki g font other than the defaults, unfortunately make font seems to be hopelessly broken. It always says "Unexpected EOF" when fed a TTF font file. At least the original FPDF project had an online version. Unfortunately the GO version uses a JSON file so I am stuck on trying to use a non-default font. If not can anybody point me to a similarly capable GO PDF creation package that is actually supported? I noticed there is also a jung-kurt/gofpdf but it was archived in 2021.
sbinet commented 2024年04月23日 11:21:30 +02:00 (Migrated from github.com)
Copy link

hum... are you sure you're running the expected binary ?
makefont doesn't take a --dest flag (but -dst).

compiling makefont and downloading Amaranth from https://www.1001freefonts.com/amaranth.font worked for me:

$> makefont -dst out -embed -enc ./cp1252.map ./Amaranth-Regular.ttf 
Character florin is missing
Character ellipsis is missing
Character dagger is missing
Character daggerdbl is missing
Character perthousand is missing
Character Scaron is missing
Character Zcaron is missing
Character trademark is missing
Character scaron is missing
Character zcaron is missing
Font file compressed: out/Amaranth-Regular.z
Font definition file successfully generated: out/Amaranth-Regular.json
$> ll out
total 48K
-rw-r--r-- 1 binet binet 1.4K Apr 23 11:15 Amaranth-Regular.json
-rw-r--r-- 1 binet binet 41K Apr 23 11:15 Amaranth-Regular.z

if that helps, here is what I am doing in gonum/plot to embed fonts from within the same program (w/o having to shell out):

hum... are you sure you're running the expected binary ? `makefont` doesn't take a `--dest` flag (but `-dst`). compiling `makefont` and downloading `Amaranth` from https://www.1001freefonts.com/amaranth.font worked for me: ```sh $> makefont -dst out -embed -enc ./cp1252.map ./Amaranth-Regular.ttf Character florin is missing Character ellipsis is missing Character dagger is missing Character daggerdbl is missing Character perthousand is missing Character Scaron is missing Character Zcaron is missing Character trademark is missing Character scaron is missing Character zcaron is missing Font file compressed: out/Amaranth-Regular.z Font definition file successfully generated: out/Amaranth-Regular.json $> ll out total 48K -rw-r--r-- 1 binet binet 1.4K Apr 23 11:15 Amaranth-Regular.json -rw-r--r-- 1 binet binet 41K Apr 23 11:15 Amaranth-Regular.z ``` if that helps, here is what I am doing in `gonum/plot` to embed fonts from within the same program (w/o having to shell out): - https://github.com/gonum/plot/blob/master/vg/vgpdf/vgpdf.go#L244-L263 - https://github.com/gonum/plot/blob/master/vg/vgpdf/vgpdf.go#L422-L472
lordofscripts commented 2024年04月29日 20:57:29 +02:00 (Migrated from github.com)
Copy link

hum... are you sure you're running the expected binary ?
makefont doesn't take a --dest flag (but -dst).

compiling makefont and downloading Amaranth from https://www.1001freefonts.com/amaranth.font worked for me:

$> makefont -dst out -embed -enc ./cp1252.map ./Amaranth-Regular.ttf 
Character florin is missing
Character ellipsis is missing
Character dagger is missing
Character daggerdbl is missing
Character perthousand is missing
Character Scaron is missing
Character Zcaron is missing
Character trademark is missing
Character scaron is missing
Character zcaron is missing
Font file compressed: out/Amaranth-Regular.z
Font definition file successfully generated: out/Amaranth-Regular.json
$> ll out
total 48K
-rw-r--r-- 1 binet binet 1.4K Apr 23 11:15 Amaranth-Regular.json
-rw-r--r-- 1 binet binet 41K Apr 23 11:15 Amaranth-Regular.z

if that helps, here is what I am doing in gonum/plot to embed fonts from within the same program (w/o having to shell out):

I did, typo on my OP, it is -dst the problem is not the option but the actual processing.

> hum... are you sure you're running the expected binary ? > `makefont` doesn't take a `--dest` flag (but `-dst`). > > compiling `makefont` and downloading `Amaranth` from https://www.1001freefonts.com/amaranth.font worked for me: > > ```sh > $> makefont -dst out -embed -enc ./cp1252.map ./Amaranth-Regular.ttf > Character florin is missing > Character ellipsis is missing > Character dagger is missing > Character daggerdbl is missing > Character perthousand is missing > Character Scaron is missing > Character Zcaron is missing > Character trademark is missing > Character scaron is missing > Character zcaron is missing > Font file compressed: out/Amaranth-Regular.z > Font definition file successfully generated: out/Amaranth-Regular.json > > $> ll out > total 48K > -rw-r--r-- 1 binet binet 1.4K Apr 23 11:15 Amaranth-Regular.json > -rw-r--r-- 1 binet binet 41K Apr 23 11:15 Amaranth-Regular.z > ``` > > if that helps, here is what I am doing in `gonum/plot` to embed fonts from within the same program (w/o having to shell out): > > - https://github.com/gonum/plot/blob/master/vg/vgpdf/vgpdf.go#L244-L263 > - https://github.com/gonum/plot/blob/master/vg/vgpdf/vgpdf.go#L422-L472 > I did, typo on my OP, it is -dst the problem is not the option but the actual processing.
lordofscripts commented 2024年04月29日 21:10:50 +02:00 (Migrated from github.com)
Copy link

hum... are you sure you're running the expected binary ?
makefont doesn't take a --dest flag (but -dst).

compiling makefont and downloading Amaranth from https://www.1001freefonts.com/amaranth.font worked for me:

$> makefont -dst out -embed -enc ./cp1252.map ./Amaranth-Regular.ttf 
Character florin is missing
Character ellipsis is missing
Character dagger is missing
Character daggerdbl is missing
Character perthousand is missing
Character Scaron is missing
Character Zcaron is missing
Character trademark is missing
Character scaron is missing
Character zcaron is missing
Font file compressed: out/Amaranth-Regular.z
Font definition file successfully generated: out/Amaranth-Regular.json
$> ll out
total 48K
-rw-r--r-- 1 binet binet 1.4K Apr 23 11:15 Amaranth-Regular.json
-rw-r--r-- 1 binet binet 41K Apr 23 11:15 Amaranth-Regular.z

if that helps, here is what I am doing in gonum/plot to embed fonts from within the same program (w/o having to shell out):

I truly don't know what's going on. I recompiled makefont, even re-dowmloaded Amaranth from the site hou mentioned, used it as stated and still get the Unexpected EOF error. I'm on an ARMHF machine.

Is there perhaps a way you can send me those files I need to embed on GoPDF (I guess it's only the JSON file, right?). I tried generating it online but only the original PDF project has that and doesn't generate a JDON but a PHP file if I remember correctly.

> hum... are you sure you're running the expected binary ? > `makefont` doesn't take a `--dest` flag (but `-dst`). > > compiling `makefont` and downloading `Amaranth` from https://www.1001freefonts.com/amaranth.font worked for me: > > ```sh > $> makefont -dst out -embed -enc ./cp1252.map ./Amaranth-Regular.ttf > Character florin is missing > Character ellipsis is missing > Character dagger is missing > Character daggerdbl is missing > Character perthousand is missing > Character Scaron is missing > Character Zcaron is missing > Character trademark is missing > Character scaron is missing > Character zcaron is missing > Font file compressed: out/Amaranth-Regular.z > Font definition file successfully generated: out/Amaranth-Regular.json > > $> ll out > total 48K > -rw-r--r-- 1 binet binet 1.4K Apr 23 11:15 Amaranth-Regular.json > -rw-r--r-- 1 binet binet 41K Apr 23 11:15 Amaranth-Regular.z > ``` > > if that helps, here is what I am doing in `gonum/plot` to embed fonts from within the same program (w/o having to shell out): > > - https://github.com/gonum/plot/blob/master/vg/vgpdf/vgpdf.go#L244-L263 > - https://github.com/gonum/plot/blob/master/vg/vgpdf/vgpdf.go#L422-L472 > I truly don't know what's going on. I recompiled makefont, even re-dowmloaded Amaranth from the site hou mentioned, used it as stated and still get the Unexpected EOF error. I'm on an ARMHF machine. Is there perhaps a way you can send me those files I need to embed on GoPDF (I guess it's only the JSON file, right?). I tried generating it online but only the original PDF project has that and doesn't generate a JDON but a PHP file if I remember correctly.
Sign in to join this conversation.
No Branch/Tag specified
main
v0.12.0
v0.11.1
v0.10.0
v0.11.0
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v1.4.3
v0.4.1
v0.4.0
v0.3.1
v0.3.0
v0.2.0
v0.1.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
go-pdf/fpdf#64
Reference in a new issue
go-pdf/fpdf
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?