Skip to content

Commit 3c28c81

Browse files
authored
Added textAscent and textDescent functions on Webgl
1 parent 26a194e commit 3c28c81

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/webgl/text.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ p5.RendererGL.prototype.textWidth = function(s) {
1818
return 0; // TODO: error
1919
};
2020

21+
p5.RendererGL.prototype.textAscent = function(s) {
22+
if (this._isOpenType()) {
23+
return this._textFont._textAscent(this._textSize);
24+
}
25+
26+
return 0; // TODO: error
27+
};
28+
29+
p5.RendererGL.prototype.textDescent = function(s) {
30+
if (this._isOpenType()) {
31+
return this._textFont._textDescent(this._textSize);
32+
}
33+
34+
return 0; // TODO: error
35+
};
36+
2137
// rendering constants
2238

2339
// the number of rows/columns dividing each glyph

0 commit comments

Comments
 (0)