Skip to content
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

vg: remove {Add,Make}Font #696

Closed
6 tasks done
sbinet opened this issue Jun 1, 2021 · 3 comments · Fixed by #728
Closed
6 tasks done

vg: remove {Add,Make}Font #696

sbinet opened this issue Jun 1, 2021 · 3 comments · Fixed by #728

Comments

@sbinet
Copy link
Member

sbinet commented Jun 1, 2021

as #693 was proof, keeping vg.AddFont and vg.MakeFont is confusing.

they were kept because x/image/font/sfnt.Font didn't have the ability to give back access to the original []byte (or io.Reader) raw TTF data.

that's no longer the case thanks to https://go-review.googlesource.com/c/image/+/291149

  • remove AddFont
  • remove MakeFont
  • remove FontMap ?
  • remove vg/fonts (used by vgpdf)
  • remove use of vg.{Add,Make}Font{,Map} in vg/vgpdf
  • remove use of vg.{Add,Make}Font{,Map} in vg/vggio

(AFAICT, vg.FontMap is only used in plot/vg/vgpdf to embed fonts. with the x/image CL above being merged, we don't need vg.FontMap there either.)

sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 1, 2021
@kortschak
Copy link
Member

SGTM

sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 1, 2021
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 1, 2021
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 1, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 1, 2021
Use plot/font.Face to translate fonts data to the format Gio is
expecting, without relying on vg.FontMap or vg/fonts.Asset.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
Use plot/font.Face to translate fonts data to the format Gio is
expecting, without relying on vg.FontMap or vg/fonts.Asset.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
Use plot/font.Face to translate fonts data to the format Gio is
expecting, without relying on vg.FontMap or vg/fonts.Asset.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 2, 2021
Use plot/font.Face to translate fonts data to the format Gio is
expecting, without relying on vg.FontMap or vg/fonts.Asset.

Updates gonum#696.
sbinet added a commit that referenced this issue Jun 2, 2021
sbinet added a commit that referenced this issue Jun 2, 2021
Use plot/font.Face to translate fonts data to the format Gio is
expecting, without relying on vg.FontMap or vg/fonts.Asset.

Updates #696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 3, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
@stippi2
Copy link

stippi2 commented Jun 10, 2021

JFYI: I've tried to have a plot rendered to SVG using another default font (plot.DefaultFont = font.Font{Typeface: "Arial"}). This was incredibly painful to get going up to a certain point. Along the way it just crashes, because FontFaces are accessed without checking if they are nil. To work around that, I needed to make font directories known to the vg package, then use vg.MakeFont() to obtain a Face, then register this face with the DefaultFontCache. Only to have it fail regardless, because the SVG renderer has a hard-coded, non-changeable map of type faces to CSS style strings. :-(

@kortschak
Copy link
Member

@stippi2 Please file an issue.

sbinet added a commit to sbinet-gonum/plot that referenced this issue Jun 24, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Aug 9, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Aug 13, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Updates gonum#696.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Aug 13, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Fixes gonum#696.
Fixes gonum#637.
sbinet added a commit to sbinet-gonum/plot that referenced this issue Aug 17, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Fixes gonum#696.
Fixes gonum#637.
sbinet added a commit that referenced this issue Aug 19, 2021
Use embedded characted encoding table for embedded fonts.
This relies on Go >= 1.16 for the "embed" package.

Fixes #696.
Fixes #637.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants