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
Add new option to CanvasFont "getCharScale" which returns scale factor 0-1 for a code point (playcanvas#1307)
Default CanvasFont scale works for most characters, for particular fonts or characters a custom scale may be required
Provide your own function that returns a scale 0-1 for a code point to customize
Copy file name to clipboardExpand all lines: src/framework/components/text/canvas-font.js
+17-7Lines changed: 17 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ Object.assign(pc, function () {
30
30
* @param {pc.Color} [options.color] The color the font will be rendered into the texture atlas as, defaults to white
31
31
* @param {Number} [options.width] The width of each texture atlas, defaults to 2048
32
32
* @param {Number} [options.height] The height of each texture atlas, defaults to 2048
33
+
* @param {Number} [options.getCharScale] A custom function which takes a codepoint and return scale value 0-1 to scale char down before rendering into atlas. Return -1 to use default scale value.
0 commit comments