mirror of
https://codeberg.org/icewind/ptouch-api.git
synced 2026-06-03 10:54:07 +02:00
set proper font
This commit is contained in:
parent
1b82593cf1
commit
8f1bce185c
1 changed files with 1 additions and 1 deletions
|
|
@ -267,7 +267,7 @@ const render = () => {
|
||||||
let width = element.width(renderCtx);
|
let width = element.width(renderCtx);
|
||||||
if (element.type === 'text') {
|
if (element.type === 'text') {
|
||||||
renderCtx.filter = '';
|
renderCtx.filter = '';
|
||||||
renderCtx.font = `${element.size}px serif`;
|
renderCtx.font = `${element.size}px sans-serif`;
|
||||||
let textSize = renderCtx.measureText(element.text);
|
let textSize = renderCtx.measureText(element.text);
|
||||||
let textHeight = textSize.fontBoundingBoxAscent - textSize.emHeightDescent;
|
let textHeight = textSize.fontBoundingBoxAscent - textSize.emHeightDescent;
|
||||||
renderCtx.fillText(element.text, calcX(element.base, element.x, width), element.y + textHeight);
|
renderCtx.fillText(element.text, calcX(element.base, element.x, width), element.y + textHeight);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue