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

post table is created with defaults when calling toArrayBuffer #529

Closed
cthorner opened this issue Dec 15, 2022 · 0 comments · Fixed by #530
Closed

post table is created with defaults when calling toArrayBuffer #529

cthorner opened this issue Dec 15, 2022 · 0 comments · Fixed by #530

Comments

@cthorner
Copy link
Contributor

Expected Behavior

calling toArrayBuffer should create a font that has the same post table as the font it was created from

since the post table is created from scratch with defaults with post.make() things like underlineThickness and underlinePosition
are always set to 0 instead of using the values from the original post table

Here is the offending code:

const postTable = post.make();

I would expect something like this:

tables.push(gsub.make(font.tables.gsub));

tables.push(cpal.make(font.tables.cpal));

tables.push(colr.make(font.tables.colr));

Current Behavior

font.toArrayBuffer() creates font with post table defaults

Possible Solution

parse values from the font's post table to create the new set of tables

Steps to Reproduce (for bugs)

load a font with a value for tables.post.underlineThickness != 0
call:
font.toArrayBuffer()
use the font with underline, see that it is not underlined

Context

have working underlining in an SVG

Your Environment

  • Version used: 1.3.4
  • Font used: any font
  • Browser Name and version: N/A
  • Operating System and version (desktop or mobile): N/A
  • Link to your project: N/A
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.

1 participant