Skip to content

vg: remove {Add,Make}Font #696

Closed

Description

@sbinet

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.)

Activity

  1. kortschak commented on Jun 1, 2021

    @kortschak
    Member

    SGTM

  2. stippi2 commented on Jun 10, 2021

    @stippi2

    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. :-(

  3. kortschak commented on Jun 10, 2021

    @kortschak
    Member

    @stippi2 Please file an issue.

  4. added a commit that references this issue on Aug 19, 2021
    d08bae0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions