eclipsesource / eclipsesource/tabris-js

Custom fonts cannot not be used with varying font weights

Open
#1,841 2 comments 1 reaction 0 assignees View on GitHub
api bug
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

### Problem description

Currently it is not possible to use custom fonts with `markupEnabled` and tags like `` and ``, since a TTF/OTF file defining only one combination of font weight and style, has to be bound to a single font family alias:

```
app.registerFont('Raleway-Bold', 'resources/Raleway-Bold.ttf'); // font family must not be bound to font weight and style!
```

### Expected behavior

An API similar to the CSS' [`@font-face`](https://developer.mozilla.org/en/docs/Web/CSS/@font-face) can be introduced, which would allow using a single font family with different weights and styles (see [@font-face tip: define font-weight and font-style to keep your CSS simple](https://www.456bereastreet.com/archive/201012/font-face_tip_define_font-weight_and_font-style_to_keep_your_css_simple/)).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.