-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Encode FontPath data into an ArrayBuffer #20346
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
base: master
Are you sure you want to change the base?
Conversation
|
For the glyph paths, we should use the same format as "described" here: Lines 1491 to 1520 in d83cbb2
Using a SVG string is slightly slower and using this binary data would help to make the serialization a bit simpler. |
6d74dda to
9d2b39d
Compare
|
Thanks for the comments, @calixteman @timvandermeij they should be addressed now PTAL. |
9d2b39d to
089364a
Compare
5991539 to
692031c
Compare
src/shared/obj-bin-transform.js
Outdated
| let buffer; | ||
| if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { | ||
| buffer = new ArrayBuffer(path.length * 2); | ||
| data = new Float32Array(buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it Float16Array ?
test/unit/obj_bin_transform_spec.js
Outdated
|
|
||
| describe("FontPath data", function () { | ||
| let path; | ||
| if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests don't run in m-c so this is useless.
Serialize FontPath commands into a binary format and store it in an ArrayBuffer so that it can eventually be stored in a SharedArrayBuffer.
692031c to
1460415
Compare
Serialize FontPath commands into a binary format
and store it in an ArrayBuffer so that it can
eventually be stored in a SharedArrayBuffer.
This PR is along the same lines as #20197 and #20340