Automattic / Automattic/node-canvas

Font-Size different (LARGE) in Azure Web App

Open
#857 37 comments 0 reactions 0 assignees View on GitHub
Bug Text & Fonts
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

When I deploy a working example to my Azure Web App instance the font-size at 14px is GIGANTIC (like 100x). I have to set the font size to 1px to be able to see more than part of one letter.

Any idea what causes this inconsistency between environments? They are both:

- Windows 64-bit
- Node 6.9.1 (64-bit)
- Canvas 1.6.2
- Prebuilt canvas.node (in git repo)

### Examples

**Working Localhost (Size 20px Font)**
![image](https://cloud.githubusercontent.com/assets/1424946/21146448/af03de8c-c11f-11e6-893c-3a4461d37997.png)

**Busted Azure Web App (Size 1px Font)**
![image](https://cloud.githubusercontent.com/assets/1424946/21146455/b3f98e78-c11f-11e6-8c42-81bc0c4d3c94.png)

## Steps to Reproduce

```js
var Canvas = require('canvas');
var canvas = new Canvas(400,100);
var ctx = canvas.getContext('2d');

const fontSize = process.env.FONT_SIZE || '20';

ctx.fillStyle = 'black';
ctx.font = `${fontSize}px Calibri`;
ctx.fillText("Hello World", 105, 30);
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.