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

emHeightDescent and emHeightAscent return value that should returns from fontBoundingBoxAscent and fontBoundingBoxDescent #2395

Open
musou1500 opened this issue Jul 9, 2024 · 0 comments

Comments

@musou1500
Copy link
Contributor

musou1500 commented Jul 9, 2024

According to specification, fontBoundingBoxAscent returns following.

The distance from the horizontal line indicated by the textBaseline attribute to the ascent metric of the first available font.

ascent metric is generally takes from font metrics.
(see https://drafts.csswg.org/css-inline/#ascent-descent)

node-canvas seems implemented it in emHeightAscent.
https://github.com/Automattic/node-canvas/blob/master/src/CanvasRenderingContext2d.cc#L2778-L2779

about em-square, ascent and descent, see https://learn.microsoft.com/en-us/typography/opentype/spec/ttch01#funits-and-the-em-square .

my investigation result on Firefox.
image

related #1940

Your Environment

  • Version of node-canvas (output of npm list canvas or yarn list canvas):
  • Environment (e.g. node 20.9.0 on macOS 14.1.1):
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

No branches or pull requests

1 participant