better fonts temporarily
This commit is contained in:
parent
bc186d658c
commit
86422888de
2 changed files with 3 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ const measureCanvas = document.createElement('canvas');
|
|||
const measureCtx = measureCanvas.getContext('2d')!;
|
||||
if (!measureCtx)
|
||||
throw new Error('Failed to create canvas');
|
||||
measureCtx.font = '16px "Courier New", monospace';
|
||||
measureCtx.font = '16px "SF Mono", "Monaco", "Menlo", "Consolas", "Courier New", monospace';
|
||||
|
||||
function expectInt(v: Value, name: string): number {
|
||||
if (v.kind !== 'int')
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function renderUI(ui: UIValue, ctx: CanvasRenderingContext2D, x: number, y: numb
|
|||
|
||||
case 'text':
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.font = '16px "Courier New", monospace';
|
||||
ctx.font = '16px "SF Mono", "Monaco", "Menlo", "Consolas", "Courier New", monospace';
|
||||
ctx.fillText(ui.content, x + ui.x, y + ui.y);
|
||||
break;
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ function renderUI(ui: UIValue, ctx: CanvasRenderingContext2D, x: number, y: numb
|
|||
|
||||
case 'text-input': {
|
||||
ctx.fillStyle = ui.value ? '#000000' : '#999999';
|
||||
ctx.font = '16px monospace';
|
||||
ctx.font = '16px "SF Mono", "Monaco", "Menlo", "Consolas", "Courier New", monospace';
|
||||
ctx.fillText(
|
||||
ui.value || ui.placeholder,
|
||||
x + ui.x + 8,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue