You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've done all the development on this library on a Mac. I was also wrongly under the assumption that the size and position of the text would be the same across platforms (since it's being rendered into a canvas). But it turns out that (of course) the text is interpreted by the browser before being draw into the canvas and there are minor differences in how the text is rendered.
Test results that depend on exact pixel numbers for height and positioning of letters are passing on Mac but not on other environments.
Supporting every environment would be pretty difficult but at a minimum, they should pass on both Mac and Windows. I have started running the tests through an "Electron" , which is AFAIK node + Chromium, which would normalize the environment. (This is at least happening in the pixi-6 branch, don't remember if it's been merged with main)
I fired up Parallels and tested under windows 10. I got the following failed tests...
FAIL test/layout.test.ts
layout module
calculateFinalTokens()
Stroked text × Shouldn't affect non-strked text. (16 ms)
× Should take the stroke into account when determining the size and the fontProperties (for baseline).
× Should not affect any other stroked text. Sometimes this happens when fontProperties are shared.
FAIL test/pixiUtils.test.ts
pixiUtils
getFontPropertiesOfText() × should throw an error if the Text has not had updateText() called at least once.
× should before setting any styles (but after calling updateTexT()) the metrics will be an expected default. (16 ms)
× should provide the correct numbers after changing the style for the text.
What if the text you want is exactly what the initial value is?
× should not throw an error if you happen to set your text to the same value as the initial values. (31 ms)
× ...however, it will throw if the fontSize is a string (rather than trying to convert it to pxs) unless you use force.
Added support for Pixi 6. There are some changes made in the pixi library that cause weird
behaviours in this library but only in tests. Currently, version 6.1.3 and earlier works well but
later versions don't work for tests. An electron-based runner for jest has been added. Also some
tests have been rewritten to work better with multiple environments (re #119).
BREAKING CHANGE: Going forward, this project will target v6 of pixi.js
fix#52
I've done all the development on this library on a Mac. I was also wrongly under the assumption that the size and position of the text would be the same across platforms (since it's being rendered into a canvas). But it turns out that (of course) the text is interpreted by the browser before being draw into the canvas and there are minor differences in how the text is rendered.
Test results that depend on exact pixel numbers for height and positioning of letters are passing on Mac but not on other environments.
Supporting every environment would be pretty difficult but at a minimum, they should pass on both Mac and Windows. I have started running the tests through an "Electron" , which is AFAIK node + Chromium, which would normalize the environment. (This is at least happening in the pixi-6 branch, don't remember if it's been merged with main)
I fired up Parallels and tested under windows 10. I got the following failed tests...
FAIL test/layout.test.ts
layout module
calculateFinalTokens()
Stroked text
× Shouldn't affect non-strked text. (16 ms)
× Should take the stroke into account when determining the size and the fontProperties (for baseline).
× Should not affect any other stroked text. Sometimes this happens when fontProperties are shared.
FAIL test/pixiUtils.test.ts
pixiUtils
getFontPropertiesOfText()
× should throw an error if the Text has not had updateText() called at least once.
× should before setting any styles (but after calling updateTexT()) the metrics will be an expected default. (16 ms)
× should provide the correct numbers after changing the style for the text.
What if the text you want is exactly what the initial value is?
× should not throw an error if you happen to set your text to the same value as the initial values. (31 ms)
× ...however, it will throw if the fontSize is a string (rather than trying to convert it to pxs) unless you use force.
Originally posted by @mimshwright in #52 (comment)
The text was updated successfully, but these errors were encountered: